1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| public $competence = array(
/************************
* CATEGORIE : COMBAT *
* **********************/
array(
"nom" => "pistolet mitrailleur",
"categorie_nom" => "arme à distance",
"attrModifie" => "AGI",
"modificateurBase" => 1,
"description" => "A completer"
),
array(
"nom" => "fusil",
"categorie_nom" => "arme à distance",
"attrModifie" => "AGI",
"modificateurBase" => 1,
"description" => "A completer"
)
);
public function run()
{
foreach($this->competence as $comp)
{
DB::table('competence')->insert(
['nom' => $comp['nom'], 'categorie_id' => DB::table("categorie_de_competence")->select('id')->where('nom',$comp['categorie_nom'])->first()->id, 'attrModifie' => $comp['attrModifie'],
'modificateurBase' => $comp['modificateurBase'], 'description' => $comp['description']]
);
}
} |
Partager