Skip to content

Commit

Permalink
FEATURE ✨ Check if config settings are correct (for Flux version)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeblauw committed Nov 24, 2024
1 parent 5b0bd93 commit 240d0ac
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/BlueAdminServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class BlueAdminServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->checkIfConfigSettingsAreCorrect();

Blade::directive('bind', function ($bind) {
return '<?php app(Ndeblauw\BlueAdmin\FormDataBinder::class)->bind(' .$bind.'); ?>';
});
Expand All @@ -28,6 +30,7 @@ public function boot()
$this->loadViewsFrom(__DIR__.'/../resources/views/layouts', 'BlueAdminLayouts');
$this->loadViewsFrom(__DIR__.'/../resources/views/generic', 'BlueAdminGeneric');


// Load the auxiliary routes
$this->loadRoutesFrom(__DIR__.'/routes.php');

Expand Down Expand Up @@ -114,4 +117,20 @@ public function register()
return new BlueAdmin;
});
}

private function checkIfConfigSettingsAreCorrect()
{
if(config('blue-admin.flux-layout', false)) {
if(!config('blue-admin.livewire_v3',false)) {
abort(400, 'Livewire v3 needs to be supported');
}
if(!config('blue-admin.vite',false)) {
abort(400, 'Vite needs to be supported');
}
if(!config('blue-admin.flux',false)) {
abort(400, 'Flux needs to be supported');
}
}

}
}

0 comments on commit 240d0ac

Please sign in to comment.