database/seeders/DatabaseSeeder.php
/**
     * Seed the application's database.
     *
     * @return void
     */
Seed the application's database.
@return void
Seed the application ' s database . @return void
public function run()
    {
        \App\Models\User::factory(10)->create();
        $this->call(RoleTableSeeder::class);
        User::find(1)->roles()->attach(1);
        User::find(2)->roles()->attach(2);
        User::find(3)->roles()->attach(3);
        User::find(4)->roles()->attach(4);
    }
public function run ( ) { \ App \ Models \ User :: factory ( 10 ) -> create ( ) ; $ this -> call ( RoleTableSeeder :: class ) ; User :: find ( 1 ) -> roles ( ) -> attach ( 1 ) ; User :: find ( 2 ) -> roles ( ) -> attach ( 2 ) ; User :: find ( 3 ) -> roles ( ) -> attach ( 3 ) ; User :: find ( 4 ) -> roles ( ) -> attach ( 4 ) ; }
Seed the application's database.
Seed the application ' s database .
// Personnel::factory(10)->create();