/** * 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); }
/** * 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'); }
public function update(SpecieRequest $request, $id) { $data = $request->all(); Species::find($id)->update($data); return redirect()->router('species'); }
/** * 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'); }