public function getStartGardening() { $user = Auth::user(); $countPlantCharacters = PlantCharacter::all()->count(); $plantSpecies = PlantSpecies::all(); foreach ($plantSpecies as $plantSpecie) { $randChar = round(rand(1, $countPlantCharacters)); $plantCharacter = PlantCharacter::find($randChar); // get a plant character $plantSpecie->plantCharacter = $plantCharacter; } return view('application.start-gardening', compact('user', 'plantSpecies')); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('plantCharacters')->delete(); // Donna, needy PlantCharacter::create(['name' => 'Donna', 'welcome_phrase_1' => 'Hey, fancypant…', 'welcome_phrase_2' => 'Well hello there…', 'need_water_phrase_1' => 'Hey, can you water me…', 'need_water_phrase_2' => "Hey, fancypant, i'd like some water…", 'received_water_phrase_1' => 'Hmm, thanks…', 'received_water_phrase_2' => 'Hmm, I was really, really thirsty…', 'need_fertilizer_phrase_1' => 'Hey, can you fertilize me…', 'need_fertilizer_phrase_2' => "Hey, fancypant, i'd like some fertilizer…", 'received_fertilizer_phrase_1' => 'Hmm, thanks…', 'received_fertilizer_phrase_2' => 'Hmm, I really, really needed to be fertilized…']); // Florence, french PlantCharacter::create(['name' => 'Florence', 'welcome_phrase_1' => 'Bonjour there.', 'welcome_phrase_2' => 'Salut.', 'need_water_phrase_1' => "I need l'eau.", 'need_water_phrase_2' => "Some leau s'il vous plait.", 'received_water_phrase_1' => "Merci pour l'eau.", 'received_water_phrase_2' => "Hmm, l'eau.", 'need_fertilizer_phrase_1' => 'I need some fertilizer.', 'need_fertilizer_phrase_2' => 'I need some fertilizer.', 'received_fertilizer_phrase_1' => 'Merci pour le fertilizer.', 'received_fertilizer_phrase_2' => 'Hmm, fertilizer.']); // Ruth, desperate seducer PlantCharacter::create(['name' => 'Ruth', 'welcome_phrase_1' => 'Hello ladies and gentlemen.', 'welcome_phrase_2' => 'Hi there.', 'need_water_phrase_1' => 'Hey sexy, I need some water!', 'need_water_phrase_2' => 'Hey, I need some water!', 'received_water_phrase_1' => 'Thanks for the cold fresh water!', 'received_water_phrase_2' => 'Brrr, that was cold!', 'need_fertilizer_phrase_1' => 'Hey sexy, I need some fertilizer', 'need_fertilizer_phrase_2' => 'Hey, I need some fertilizer!', 'received_fertilizer_phrase_1' => 'Thanks for the yummy fertilizer!', 'received_fertilizer_phrase_2' => 'Ha, that was yummy!']); // Albert, rude PlantCharacter::create(['name' => 'Albert', 'welcome_phrase_1' => 'Yo human!', 'welcome_phrase_2' => 'Peace bitches!', 'need_water_phrase_1' => "Yo human, I'm thirsty!", 'need_water_phrase_2' => "Hey bitches, I need water!", 'received_water_phrase_1' => 'Chug chug chug!', 'received_water_phrase_2' => 'Ow yes, I really needed that water!', 'need_fertilizer_phrase_1' => "Yo human, I need fertilizer!", 'need_fertilizer_phrase_2' => "Hey bitches, I need fertilizer!", 'received_fertilizer_phrase_1' => 'That went down well!', 'received_fertilizer_phrase_2' => 'Ow yes, I really needed that fertilizer!']); // Gary, from the south PlantCharacter::create(['name' => 'Gary', 'welcome_phrase_1' => "Howdy y'all!", 'welcome_phrase_2' => "Yo peepz!", 'need_water_phrase_1' => "Howdy y'all my feet are kinda dry!", 'need_water_phrase_2' => "I'm thirsty", 'received_water_phrase_1' => 'Oh, yes! I was really thirsty!', 'received_water_phrase_2' => 'Well, my thirst is ower! Dude.', 'need_fertilizer_phrase_1' => "Howdy y'all my tummy is low on vitamins!", 'need_fertilizer_phrase_2' => 'I need fertilizer!', 'received_fertilizer_phrase_1' => 'Oh, yes! I really needed fertilizer!', 'received_fertilizer_phrase_2' => "Well, I'm all full now! Dude"]); // Bob, correct PlantCharacter::create(['name' => 'Bob', 'welcome_phrase_1' => 'Hello, gardener!', 'welcome_phrase_2' => 'Hello, gardener!', 'need_water_phrase_1' => 'I need water, gardener!', 'need_water_phrase_2' => 'I need water, gardener!', 'received_water_phrase_1' => 'Thanks for the water, gardener!', 'received_water_phrase_2' => 'Thanks for the water, gardener!', 'need_fertilizer_phrase_1' => 'I need fertilizer, gardener!', 'need_fertilizer_phrase_2' => 'I need fertilizer, gardener!', 'received_fertilizer_phrase_1' => 'Thanks for the fertilizer, gardener!', 'received_fertilizer_phrase_2' => 'Thanks for the fertilizer, gardener!']); }