This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\Auth; | |
use Illuminate\Http\Request; | |
use Illuminate\Routing\Controller; | |
use Illuminate\Foundation\Auth\VerifiesEmails; | |
class VerificationController extends Controller | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document.vhr).submit(function (e) { | |
$vin = $(this).find('input[name="decodeVIN"]'); | |
if (!$vin.val() || $vin.val().length <= 10) { | |
$('.digits-error').show(); | |
$('.triangle-border').hide(); | |
return false; | |
} | |
else { | |
e.preventDefault(); | |
$('.miniBox ul:eq( 0 )').after('<div class="loader"></div>'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class Auth | |
* Dirty hack used to avoid error within corcel | |
*/ | |
class Auth { | |
public static function provider($name, $callback){ | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* AJAX handler to generate and return a PDF of the desired report | |
* | |
* @param string $shareCode The share code for the report | |
* @return Response PDF download response | |
*/ | |
public function view_onDownloadPdf($shareCode) | |
{ | |
return Backend::redirect("author/plugin/download-pdf/$shareCode"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See: https://medium.com/@barryvdh/streaming-large-csv-files-with-laravel-chunked-queries-4158e484a5a2 | |
/* | |
* Response | |
*/ | |
$response = new StreamedResponse(function() { | |
// Set the file name | |
$filename = 'claims.csv'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APP_DEBUG=true | |
APP_URL=http://example.local | |
APP_KEY= | |
DB_CONNECTION=mysql | |
DB_HOST=localhost | |
DB_PORT=3306 | |
DB_DATABASE=website-oc-example-LOCAL | |
DB_USERNAME=homestead | |
DB_PASSWORD=secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const request = async (handler, data) => { | |
let response = await fetch('/api', { | |
method: 'POST', | |
credentials: 'same-origin', | |
body: JSON.stringify(data), | |
cache: 'no-cache', | |
headers: { | |
'X-Requested-With': 'XMLHttpRequest', | |
'Content-Type': 'application/json', | |
'X-OCTOBER-REQUEST-HANDLER': handler, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Scope locations near a pair of coordinates | |
* | |
* @param Builder $query | |
* @param float $int | |
* @param float $lng | |
*/ | |
public function scopeIsNear($query, $lat, $lng) | |
{ | |
$statement = sprintf("id, name, street, locality, region, postal_code, country, website, phone, lat, lng, ( 3959 * acos( cos( radians('%s') ) * cos( radians( lat ) ) * cos( radians( lng ) - radians('%s') ) + sin( radians('%s') ) * sin( radians( lat ) ) ) ) AS distance", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$stages = $this->getStages(); // ['foo'=>'bar','bar'=>'foo'] | |
while (key($stages) !== $this->status) { | |
next($stages); // advance til there's a match | |
} | |
return next($stages); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Input Trigger API | |
* This API allows to change elements' visibility or status (enabled/disabled) basing on other elements' statuses. | |
* Example: enable a button if any checkbox inside another element is checked. | |
* - Checked Condition: | |
<input type="checkbox" id="triggerChk1" /> | |
<button class="btn disabled" | |
data-trigger-action="enable" | |
data-trigger="#triggerChk1" | |
data-trigger-condition="checked"> |
OlderNewer