revolution / laravel-namespaced-helpers
Laravel Namespaced helpers
Installs: 13 642
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- illuminate/support: ^10.0||^11.0
Requires (Dev)
- orchestra/testbench: ^8.0||^9.0
README
Another way to avoid env()
conflicts.
Requirements
- PHP >= 8.1
- Laravel >= 10.0
Versioning
- Basic : semver
- Drop old PHP or Laravel version :
+0.1
. composer should handle it well. - Support only latest major version (
master
branch), but you can PR to old branches.
Installation
composer require revolution/laravel-namespaced-helpers
Uninstall
composer remove revolution/laravel-namespaced-helpers
Usage
env()
In config files,
add use function Revolution\Illuminate\Support\env;
This env()
is not global.
<?php use function Revolution\Illuminate\Support\env; return [ 'name' => env('APP_NAME', 'Laravel'), ];
dispatch_now()
dispatch_now()
was removed in Laravel 10. If you want to use it to get a return value from a job class, you can use this.
<?php use function Revolution\Illuminate\Support\dispatch_now; $bar = dispatch_now(new FooJob());
DispatchNow trait
use Illuminate\Contracts\Queue\ShouldQueue; use Revolution\Illuminate\Support\DispatchNow; class FooJob implements ShouldQueue { use DispatchNow; }
$bar = FooJob::dispatchNow();
LICENSE
MIT