database/seeders/AbilityCharacterSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        Ability::where('name', '3 HP')->firstOrFail()->characters()->attach(Character::findOrFail(1));
        Ability::where('name', 'Nævekamp 2')->firstOrFail()->characters()->attach(Character::findOrFail(1));
        Ability::where('name', 'Nævekamp 3')->firstOrFail()->characters()->attach(Character::findOrFail(1));
        Ability::where('name', 'Nævekamp 4')->firstOrFail()->characters()->attach(Character::findOrFail(1));
    }
public function run ( ) { Ability :: where ( 'name' , '3 HP' ) -> firstOrFail ( ) -> characters ( ) -> attach ( Character :: findOrFail ( 1 ) ) ; Ability :: where ( 'name' , 'Nævekamp 2') - >f irstOrFail( ) - >c haracters( ) - >a ttach( C haracter: :f indOrFail( 1 ) ) ; Ability :: where ( 'name' , 'Nævekamp 3') - >f irstOrFail( ) - >c haracters( ) - >a ttach( C haracter: :f indOrFail( 1 ) ) ; Ability :: where ( 'name' , 'Nævekamp 4') - >f irstOrFail( ) - >c haracters( ) - >a ttach( C haracter: :f indOrFail( 1 ) ) ; }
Run the database seeds.
Run the database seeds .