404 NOT FOUND after initial Filament install

I am starting a new app a trying to use Filament, I did the initial install as recommanded on https://filamentphp.com/docs/3.x/panels/installation. I is a new project where I just did the basic lavarel install and a first migration with blueprint.
I do have a 404 NOT FOUND error on my local when reaching http://127.0.0.1:8000/admin or http://localhost:8000/admin My Console does not show much error I have :
cleared my cache on my browser php artisan cache:clear php artisan optimize php artisan view:clear php artisan filament:clear-cached-components My web.php is empty app/Providers/AppServiceProvider.php
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Model;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}

/**
* Bootstrap any application services.
*/
public function boot(): void
{
Modell::unguard();
}
}
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Model;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}

/**
* Bootstrap any application services.
*/
public function boot(): void
{
Modell::unguard();
}
}
app/Providers/Filament/AdminPanelProvider.php will follow under What am I missing to get the Filament Magic ? Can someone help ? Thank you for your support
50 Replies
Eky-Michael
Eky-MichaelOP8mo ago
AdminPanelProvider.php
<?php
namespace App\Providers\Filament;
use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Pages;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
<?php
namespace App\Providers\Filament;
use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Pages;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin')
->login()
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
}
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin')
->login()
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
}
Dennis Koch
Dennis Koch8mo ago
Panel looks good. APP_URL matches your domain? Does plain Laravel work?
Eky-Michael
Eky-MichaelOP8mo ago
This is from my /config/app.php
'url' => env('APP_URL', 'http://localhost'),
'url' => env('APP_URL', 'http://localhost'),
Lavarel seems to be working, but shows 404 NOT FOUND on http://localhost:8000/ and http://localhost:8000/admin/ I believe this is normal as I deleted the route from web.php Here is the error from my console
No description
Dennis Koch
Dennis Koch8mo ago
Whats the URL on your .env though?
Eky-Michael
Eky-MichaelOP8mo ago
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:HXm96nyySy4V4yVWKHxdrICywSFKcKRSpD9L15gZv10=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=ekynav
DB_USERNAME=root
DB_PASSWORD=root

SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database

CACHE_STORE=database
CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=log
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

VITE_APP_NAME="${APP_NAME}"
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:HXm96nyySy4V4yVWKHxdrICywSFKcKRSpD9L15gZv10=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=ekynav
DB_USERNAME=root
DB_PASSWORD=root

SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database

CACHE_STORE=database
CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=log
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

VITE_APP_NAME="${APP_NAME}"
I also can access from http://127.0.0.1:8000/admin and http://127.0.0.1:8000/ with same error
Dennis Koch
Dennis Koch8mo ago
APP_URL=http://localhost !== APP_URL=http://localhost:8000 Can you try that?
Eky-Michael
Eky-MichaelOP8mo ago
No description
Dennis Koch
Dennis Koch8mo ago
Did you change the .env to http://localhost:8000?
Eky-Michael
Eky-MichaelOP8mo ago
Yes, getting same error, I also restarted the server
Dennis Koch
Dennis Koch8mo ago
What dev environment are you using?
Eky-Michael
Eky-MichaelOP8mo ago
You mean Lavarel version ?
Dennis Koch
Dennis Koch8mo ago
Also: Does artisan route:list show any Filament routes? /admin/login for example No. What server and OS are you running on your machine?
Eky-Michael
Eky-MichaelOP8mo ago
Here is the route list I had to comment Modell::unguard(); from AppServiceProvider as it was throwing an error
No description
Dennis Koch
Dennis Koch8mo ago
Hm. Looks fine to me
Eky-Michael
Eky-MichaelOP8mo ago
Sonoma 14.1.1, with M1 chip
Dennis Koch
Dennis Koch8mo ago
And built in PHP server? Or artisan serve?
Eky-Michael
Eky-MichaelOP8mo ago
with artisan serve
Dennis Koch
Dennis Koch8mo ago
Hm. I think that should be supported. I am running out of ideas. When you go to http://localhost:8000/up is that working? Is there anything else already running on port 8000?
Tieme
Tieme8mo ago
How does your composer.json looks like?
Eky-Michael
Eky-MichaelOP8mo ago
That is what I get on http://localhost:8000
No description
Dennis Koch
Dennis Koch8mo ago
Is artisan serve logging your requests to the console?
Eky-Michael
Eky-MichaelOP8mo ago
composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"license": "MIT",
"require": {
"php": "^8.2",
"filament/filament": "^3.2",
"laravel/framework": "^11.0",
"laravel/tinker": "^2.9"
},
"require-dev": {
"doctrine/dbal": "^3.8",
"fakerphp/faker": "^1.23",
"laravel-shift/blueprint": "^2.10",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.0",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-laravel": "^2.3",
"spatie/laravel-ignition": "^2.4"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
{
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"license": "MIT",
"require": {
"php": "^8.2",
"filament/filament": "^3.2",
"laravel/framework": "^11.0",
"laravel/tinker": "^2.9"
},
"require-dev": {
"doctrine/dbal": "^3.8",
"fakerphp/faker": "^1.23",
"laravel-shift/blueprint": "^2.10",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.0",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-laravel": "^2.3",
"spatie/laravel-ignition": "^2.4"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan filament:upgrade"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi",
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
"@php artisan migrate --graceful --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan filament:upgrade"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi",
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
"@php artisan migrate --graceful --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}
Eky-Michael
Eky-MichaelOP8mo ago
No description
Dennis Koch
Dennis Koch8mo ago
Hm. That's really weird.
Eky-Michael
Eky-MichaelOP8mo ago
I tried to re install 3 times from scratch... other Lavaler apps are working fine on my local. Thank you Denis for your help
Tieme
Tieme8mo ago
Are the panels registerd in the providers.php (./bootstrap/providers.php)
Dennis Koch
Dennis Koch8mo ago
The route command shows Filament routes, so it should be
Tieme
Tieme8mo ago
True, missed that
Dennis Koch
Dennis Koch8mo ago
Just a sanity check: You are in the right project? 🙈
Eky-Michael
Eky-MichaelOP8mo ago
yes 🙂
Eky-Michael
Eky-MichaelOP8mo ago
🙂
No description
No description
Tieme
Tieme8mo ago
can you try php artisan serve --port=8123 ?
Eky-Michael
Eky-MichaelOP8mo ago
providers.php
<?php

return [
App\Providers\AppServiceProvider::class,
App\Providers\Filament\AdminPanelProvider::class,
];
<?php

return [
App\Providers\AppServiceProvider::class,
App\Providers\Filament\AdminPanelProvider::class,
];
Eky-Michael
Eky-MichaelOP8mo ago
Getting the same with http://127.0.0.1:8123
No description
Tieme
Tieme8mo ago
Realy strange
Eky-Michael
Eky-MichaelOP8mo ago
Can my Models create the issue ?
Tieme
Tieme8mo ago
Dont think so, it is route and dont think your model creates routes
LeandroFerreira
LeandroFerreira8mo ago
Try to create a route /test in the web.php and check if it renders something
Eky-Michael
Eky-MichaelOP8mo ago
I just added this in my web.php but it does not work, same error
<?php

use Illuminate\Support\Facades\Route;

Route::get('/test', function () {
return view('welcome');
});
<?php

use Illuminate\Support\Facades\Route;

Route::get('/test', function () {
return view('welcome');
});
Tieme
Tieme8mo ago
and if you run php artisan route:clear
Eky-Michael
Eky-MichaelOP8mo ago
I did and restrted artisan serve but nothing changes, sorry..
LeandroFerreira
LeandroFerreira8mo ago
Fresh laravel project? Did you do something in the appserviceprovider?
Dennis Koch
Dennis Koch8mo ago
Did you try restarting your computer? 🙈
Eky-Michael
Eky-MichaelOP8mo ago
I added Modell::unguard(); and then commented it as it was throwing some error.
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Model;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}

/**
* Bootstrap any application services.
*/
public function boot(): void
{
// Modell::unguard();
}
}
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Model;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}

/**
* Bootstrap any application services.
*/
public function boot(): void
{
// Modell::unguard();
}
}
Dennis Koch
Dennis Koch8mo ago
It's throwing an error because you added two l at the end. But that shouldn't matter here. If Laravels normal routing doesn't work you have different issues. Can we start over? 1. Restart your computer 2. Create a new Laravel project (without Filament) 3. Add a /test route check whether that works 4. Add Filament, Check whether that works.
Eky-Michael
Eky-MichaelOP8mo ago
ok, I'll do that After restarting my computer + php artisan config:cache Thank you
Eky-Michael
Eky-MichaelOP8mo ago
No description
Dennis Koch
Dennis Koch8mo ago
Turning it on and off again does wonders 😅
Eky-Michael
Eky-MichaelOP8mo ago
Thank you, I was getting crazy 🙂 Have a great day
Dennis Koch
Dennis Koch8mo ago
Thanks. You, too.
Want results from more Discord servers?
Add your server