Implementations
To create the Admin
model using artisan and inherit from the AdminUser
model, you can run the following command:
After creating the Admin
model, you can extend it from the AdminUser
model as shown in the provided code snippet:
Seeds
To avoid running internal installation every time after refreshing the database or moving to a server, you can add the standard data seeding to your seeding file DatabaseSeeder.php
. Here's an example of how you can do this:
In this code snippet:
\App\Models\User::factory(10)->create();
seeds some default users using Laravel's factory.$this->call(AdminSeeder::class);
calls theAdminSeeder
to seed admin-related data. Make sure theAdminSeeder
exists and contains the necessary logic to seed admin data.You can add more call methods for additional seeders as needed.
Ensure that the AdminSeeder
class is properly implemented and contains the necessary logic to seed admin-related data.