Exemple #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     //Fake Pigeons
     for ($i = 0; $i < 10; $i++) {
         if (rand(1, 10) > 5) {
             $sex = 'male';
         } else {
             $sex = 'female';
         }
         if (rand(1, 10) > 5) {
             $race = 'white';
         } else {
             $race = 'black';
         }
         Pigeon::create(['name' => $faker->name, 'union_number' => $faker->creditCardNumber, 'ring_number' => $faker->creditCardNumber, 'breeder' => $faker->name, 'country' => $faker->country, 'sex' => $sex, 'year' => $faker->year, 'race' => $race, 'color' => $faker->colorName, 'info' => $faker->text(300)]);
     }
 }
Exemple #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Pigeon::destroy([$id]);
     return redirect(action('PigeonController@index'));
 }
Exemple #3
0
 public function preview($id)
 {
     $pigeon = Pigeon::findOrFail($id);
     return view('bloodline.bloodline', ['pigeon' => $pigeon]);
 }