Invalid route action: [App\Filament\Auth\AdminLogin]. after running php artisan filament:optimize

So i currently developing this locally and run php artisan filament:optimize in order minimize latency cause i have a demo tomorrow, but now it shown an error which it cannot detect my custom login page ? whats the possible solution to this?
No description
No description
Solution:
check your file namespace
Jump to solution
6 Replies
Mohamed Ayaou
Mohamed Ayaou5w ago
just clear the cache with php artisan filament:optimize-clear In many projects I create two simple laravel commands for both optimizing and clearing caches For caching and optimizing:
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;

class Optimize extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:optimize';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Optimize application performance.';

/**
* Execute the console command.
*/
public function handle()
{
Artisan::call('view:cache');
Artisan::call('config:cache');
Artisan::call('route:cache');
Artisan::call('event:cache');
Artisan::call('icons:cache');
Artisan::call('optimize');
Artisan::call('filament:cache-components');
Artisan::call('filament:optimize');
Artisan::call('opcache:compile');
}
}
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;

class Optimize extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:optimize';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Optimize application performance.';

/**
* Execute the console command.
*/
public function handle()
{
Artisan::call('view:cache');
Artisan::call('config:cache');
Artisan::call('route:cache');
Artisan::call('event:cache');
Artisan::call('icons:cache');
Artisan::call('optimize');
Artisan::call('filament:cache-components');
Artisan::call('filament:optimize');
Artisan::call('opcache:compile');
}
}
for clearing caches and optimizations:
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;

class RefreshCaches extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:refresh-caches';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Clear All application caches.';

/**
* Execute the console command.
*/
public function handle()
{
// clear all caches
Artisan::call('cache:clear');
Artisan::call('view:clear');
Artisan::call('config:clear');
Artisan::call('route:clear');
Artisan::call('event:clear');
Artisan::call('icons:clear');
Artisan::call('optimize:clear');
Artisan::call('filament:clear-cached-components');
Artisan::call('filament:optimize-clear');
Artisan::call('clear-compiled');
Artisan::call('opcache:clear');
}
}
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;

class RefreshCaches extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:refresh-caches';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Clear All application caches.';

/**
* Execute the console command.
*/
public function handle()
{
// clear all caches
Artisan::call('cache:clear');
Artisan::call('view:clear');
Artisan::call('config:clear');
Artisan::call('route:clear');
Artisan::call('event:clear');
Artisan::call('icons:clear');
Artisan::call('optimize:clear');
Artisan::call('filament:clear-cached-components');
Artisan::call('filament:optimize-clear');
Artisan::call('clear-compiled');
Artisan::call('opcache:clear');
}
}
TegarJK
TegarJKOP5w ago
hello whats the file name for both of those? im new to laravel
TegarJK
TegarJKOP5w ago
i copy your code and return error and they are not cached
No description
No description
TegarJK
TegarJKOP5w ago
nevermind i moved the auth folder to App\Pages then it fixed itself, now everything is working and snappy, thank you!
Solution
Rolland
Rolland5w ago
check your file namespace
TegarJK
TegarJKOP5w ago
i already did its fixed now

Did you find this page helpful?