Controllers: plural
- For example:
UsersControllers
Models: singular
- A model representes one item, i.e. a record from a database. So:
User
orUserModel
.
<?php | |
use Illuminate\Support\Facades\Request; | |
use Illuminate\Support\Str; | |
Request::macro('startsWith', function () { | |
return Str::startsWith(func_get_args()); | |
}); | |
Request::macro('endsWith', function () { |
<?php | |
namespace App\Http\Middleware; | |
use Aws\Sns\Message; | |
use Aws\Sns\MessageValidator; | |
use Closure; | |
class VerifySnsMessageCameFromAmazon | |
{ |
'use strict'; | |
const https = require('https'); | |
const querystring = require('querystring'); | |
String.prototype.capitalizeFirstLetter = function () { | |
return this.charAt(0).toUpperCase() + this.slice(1); | |
} | |
exports.handler = function (event, context) { |
key.replace(/\.(\w+)/g, '[$1]'); |
#!/bin/sh | |
cd 'project-dir' | |
composer install | |
php artisan migrate | |
php artisan db:seed | |
npm install --loglevel error | |
export DISABLE_NOTIFIER=true | |
gulp |
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\GeneratorCommand; | |
class RepositoryMakeCommand extends GeneratorCommand | |
{ | |
/** | |
* The console command name. |
<?php | |
// whitelist columns to filter by | |
$filterable = array( | |
'colour', | |
'size', | |
'price' | |
); | |
// build up string for WHERE clause | |
$where = array(); |
<?php | |
class NewsArticle extends AppModel { | |
public $name = 'NewsArticle'; | |
public $hasAndBelongsToMany = array( | |
'Image' => array( | |
'joinTable' => 'news_articles_images' | |
) | |
); | |
{ | |
"require": { | |
"aws/aws-php-sdk": "dev-master" | |
} | |
} |