@role Blade Directive For Laravel Spark
Assumes you're using teams
Add this to the boot() method of your AppServiceProvider
\Blade::directive('role', function($roles) {
$user = auth()->user();@role Blade Directive For Laravel SparkAssumes you're using teams
Add this to the boot() method of your AppServiceProvider
\Blade::directive('role', function($roles) {
$user = auth()->user();Use array syntax to define a list of scopes to apply to a model
Assuming you have scopePopular & scopeRecent as query scopes
Book::scopes(['popular', 'recent'])->get();Add this to your model
| $originalStartDate = app('Carbon\Carbon')->parse('1/30/2017'); | |
| $newStartDate = app('Carbon\Carbon')->parse('2/27/2017'); | |
| $difference = $originalStartDate->diffInDays($newStartDate); | |
| $dates = [ | |
| '2/20/2017', | |
| '2/24/2017', | |
| '3/6/2017', |