Dario Genova
Dario Genova
FFilament
Created by Wirkhof on 11/26/2024 in #❓┊help
After "php artisan migrate:fresh" the admin is lost
Add inside run method of the file "database/seeders/DatabaseSeeder.php" this code: public function run() { $this->call(AdminUserSeeder::class); }
9 replies
FFilament
Created by Wirkhof on 11/26/2024 in #❓┊help
After "php artisan migrate:fresh" the admin is lost
Ensure that in the model the fillable fields are configured protected $fillable = [ 'name', 'email', 'password', ];
9 replies
FFilament
Created by Wirkhof on 11/26/2024 in #❓┊help
After "php artisan migrate:fresh" the admin is lost
<?php namespace Database\Seeders; use Illuminate\Database\Seeder; use Illuminate\Support\Facades\Hash; use App\Models\User; class AdminUserSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { // Crea un utente admin User::updateOrCreate( ['email' => '[email protected]'], [ 'name' => 'Admin', 'email' => '[email protected]', 'password' => Hash::make('admin password'), ] ); $this->command->info('Admin user created successfully!'); } }
9 replies
FFilament
Created by Wirkhof on 11/26/2024 in #❓┊help
After "php artisan migrate:fresh" the admin is lost
php artisan make:seeder AdminUserSeeder
9 replies
FFilament
Created by Wirkhof on 11/26/2024 in #❓┊help
After "php artisan migrate:fresh" the admin is lost
You need to use this command: "php artisan migrate:fresh --seed". At the end of the database reconstruction, the seeder will create a new admin. But before doing this, make sure you have a seeder that creates the "admin" user.
9 replies