// One-line description of route
Route::get('url', [
'as' => 'domain.name',
'before' => [ 'filter' ],
'uses' => '\Controller@name' ]);
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
/* This uses Leaflet.js's markers: | |
* L.divIcon({ | |
* iconSize: [30, 0], | |
* className: 'comment', | |
* html: '<i class="fa fa-fw"></i>' | |
* }); | |
* to inject a FontAwesome icon into the marker .leaflet-marker-icon. | |
* It copies that same icon using the :after pseudo element and applies | |
* a shadow transform to it. Use content to change the icon. | |
*/ |
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
@task('setup') | |
composer install --no-dev | |
npm install | |
php artisan key:generate | |
migrations | |
php artisan db:seed | |
build | |
git commit -am 'Initial commit.' | |
git push origin master | |
echo 'Finished setting up new FooBar project!' |
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 Generic; | |
class Collection implements Contract | |
{ | |
/** | |
* Untyped items in collection. | |
* | |
* @var array |
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 | |
$attributes = ['name' => 'John Doe']; | |
$query = User::where('email', 'john@example.com'); // $query->toSql() --> select * from `users` where `email` = ? | |
$grammar = $query->getQuery()->getGrammar(); | |
$sql = $grammar->compileUpdate($query->getQuery(), $attributes); // update `users` set `name` = ? where `email` = ? | |
$bindings = $query->getBindings(); // ['john@example.com'] | |
if( ! array_has($bindings, 'join') ) { | |
array_set($bindings, 'join', []); // because Grammar stupidly assumes a join binding | |
} |
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 | |
/** | |
* @return array | |
*/ | |
function crc64Table() | |
{ | |
$crc64tab = []; | |
// ECMA polynomial |