Exemplo n.º 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     User::create(['name' => 'Vlada', 'email' => '*****@*****.**', 'password' => bcrypt('123123')]);
     Species::create(['name' => 'Shark']);
     Species::create(['name' => 'Swordfish']);
     Species::create(['name' => 'Tuna']);
     // $this->call(UserTableSeeder::class);
 }
Exemplo n.º 2
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $species = Species::all()->toArray();
     $species = array_pluck($species, 'name', 'id');
     return view('dash.create')->with(['species' => $species]);
 }
 public function deleteSettings($id)
 {
     Species::destroy($id);
     return redirect('/settings');
 }
Exemplo n.º 4
0
 public function update(SpecieRequest $request, $id)
 {
     $data = $request->all();
     Species::find($id)->update($data);
     return redirect()->router('species');
 }
Exemplo n.º 5
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $species = \App\Species::findOrFail($id);
     $species->delete();
     return redirect('species');
 }