You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
fix: Correctly disable FlasherMiddleware when inject_assets is set to false
This commit is contained in:
@@ -6,6 +6,7 @@ namespace Flasher\Laravel\Support;
|
||||
|
||||
use Flasher\Prime\Factory\NotificationFactoryLocator;
|
||||
use Flasher\Prime\Plugin\PluginInterface;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contracts\Foundation\CachesConfiguration;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
@@ -35,6 +36,14 @@ abstract class PluginServiceProvider extends ServiceProvider
|
||||
return rtrim($this->getResourcesDir(), '/').'/config.php';
|
||||
}
|
||||
|
||||
protected function getConfig(string $key = null, mixed $default = null): mixed
|
||||
{
|
||||
/** @var Repository $config */
|
||||
$config = $this->app->make('config');
|
||||
|
||||
return $key ? $config->get('flasher.'.$key, $default) : $config;
|
||||
}
|
||||
|
||||
protected function getResourcesDir(): string
|
||||
{
|
||||
$r = new \ReflectionClass($this);
|
||||
|
||||
Reference in New Issue
Block a user