Skip to content

Commit

Permalink
Added filament lookup for extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
korridor committed Apr 22, 2024
1 parent 5e979db commit bd62637
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
25 changes: 23 additions & 2 deletions app/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
use Illuminate\Session\Middleware\StartSession;
use Illuminate\Support\Facades\App;
use Illuminate\View\Middleware\ShareErrorsFromSession;
use Nwidart\Modules\Facades\Module;
use pxlrbt\FilamentEnvironmentIndicator\EnvironmentIndicatorPlugin;

class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
$panel->default()
->id('admin')
->path('admin')
->colors([
Expand Down Expand Up @@ -72,5 +72,26 @@ public function panel(Panel $panel): Panel
->authMiddleware([
Authenticate::class,
]);

$modules = Module::allEnabled();

foreach ($modules as $module) {
$panel->discoverResources(
in: module_path($module->getName(), 'app/Filament/Resources'),
for: 'Extensions\\'.$module->getName().'\\App\\Filament\\Resources'
);

$panel->discoverPages(
in: module_path($module->getName(), 'app/Filament/Pages'),
for: 'Extensions\\'.$module->getName().'\\App\\Filament\\Pages'
);

$panel->discoverWidgets(
in: module_path($module->getName(), 'app/Filament/Widgets'),
for: 'Extensions\\'.$module->getName().'\\App\\Filament\\Widgets'
);
}

return $panel;
}
}
2 changes: 1 addition & 1 deletion app/Providers/TelescopeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function register(): void

$this->hideSensitiveRequestDetails();

Telescope::filter(function (IncomingEntry $entry) {
Telescope::filter(function (IncomingEntry $entry): bool {
if ($this->app->environment('local')) {
return true;
}
Expand Down
11 changes: 11 additions & 0 deletions config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
'replace_placeholders' => true,
],

'stack_production' => [
'driver' => 'stack',
'channels' => ['single', 'sentry'],
],

'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
Expand All @@ -84,6 +89,12 @@
'replace_placeholders' => true,
],

'sentry' => [
'driver' => 'sentry',
'level' => env('LOG_LEVEL', 'error'),
'bubble' => true,
],

'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
Expand Down

0 comments on commit bd62637

Please sign in to comment.