bram1028 / laravel-support
Adds common functionality to Laravel.
1.3.1
2021-03-30 19:19 UTC
Requires
- php: ^7.3|^8.0
- hanneskod/classtools: ^1.2.1
- illuminate/bus: ^8.0
- illuminate/collections: ^8.0
- illuminate/console: ^8.0
- illuminate/support: ^8.0
- symfony/finder: ^4|^5
This package is auto-updated.
Last update: 2025-03-08 23:44:33 UTC
README
This library contains common funtionality that I use across many Laravel applications. I think some of this stuff belongs in the framework, but what do I know?
Installation is simple:
composer require bram1028/laravel-support
The service provider will be loaded automatically.
@optional
Checks if a section has content, so you can wrap a yield in other code.
@optional('hero') <div class="hero"> <div class="hero-body"> {!! $yield !!} </div> </div> @endoptional
Route::if()
Makes styling active nav links much cleaner.
<ul> <li class="{!! Route::if('about', 'is-active') !!}"> <a href="{{ route('about') }}">About Us</a> </li> </ul>
And yes, you can pass multiple route names. The last parameter is used as the output value.
artisan job:list
Lists all jobs under App\Jobs
.
artisan job:run
Runs a job under App\Jobs
.
Currently only supports jobs without constructor parameters.