This file contains hidden or 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 | |
use AppName\Posts\Post; | |
use Illuminate\Http\Request; | |
class GenericAclMiddleware | |
{ | |
private $entityClasses = [ | |
'post' => Post::class | |
]; |
This file contains hidden or 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 MyAppName\Http\Requests\Members; | |
use Illuminate\Contracts\Validation\Validator; | |
use InternalPackage\Laravel\Traits\SessionFlashNotifierTrait; | |
use MyAppName\Http\Requests\Request; | |
class ImportMembersRequest extends Request | |
{ | |
use SessionFlashNotifierTrait; |
This file contains hidden or 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\Providers; | |
use Illuminate\Support\ModuleServiceProvider; | |
class FooModuleServiceProvider extends ModuleServiceProvider | |
{ | |
protected $moduleName = 'Foo Module'; | |
protected $moduleNamespaces = ['App\FooModule']; | |
This file contains hidden or 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 FacebookUrlHelper | |
{ | |
private $graphApiUrl; | |
private $fbHostname; | |
public function __construct($graphApiUrl = 'http://graph.facebook.com', $fbHostname = 'facebook.com') | |
{ |
This file contains hidden or 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
#!/bin/bash | |
#Retrieves an environment variable from the correct environment file | |
#Based on the specified environment | |
#Example: getEnvVariable local DB_USER VARIABLE | |
#Will attempt to retrieve the DB_USER array value from the file at .env.local.php | |
#And then store the result in VARIABLE | |
getEnvVariable(){ | |
local RESULT=$3 | |
local LOCAL_RESULT=$(php -r ' | |
$file = getcwd() . "/.env." . trim($argv[1]) . ".php"; |
This file contains hidden or 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 ServiceContainer | |
{ | |
protected $services = []; | |
protected function setCallable($serviceKey, Callable $service) | |
{ | |
$this->services[$serviceKey] = $service; | |
return $this; |
This file contains hidden or 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 | |
//Template for all required environment variables | |
return array( | |
'DB_USER' => '', | |
'DB_PASS' => '', | |
'DB_DATABASE' => '', | |
'BUGSNAG_KEY' => '', | |
'NEW_RELIC_APPNAME' => '' | |
); |
This file contains hidden or 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 BaseController extends Controller | |
{ | |
public function callAction($method, $params) | |
{ | |
$ajax = Request::isAjax(); | |
try { | |
return parent::callAction($method, $params); |
This file contains hidden or 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 ContactFormHandler | |
{ | |
public function __construct(ContactFormTemplate $template, ContactFormValidator $validator, ContactFormMailer $mailer) | |
{ | |
$this->template = $template; | |
$this->validator = $validator; | |
$this->mailer = $mailer; | |
} |
This file contains hidden or 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 EloquenFooRepository | |
{ | |
/** | |
* The base eloquent model | |
* @var Eloquent | |
*/ | |
protected $model; |