/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function update(PositionRequest $request, $id) { $position = Position::find($id); $position->update(['name' => $request->get('name'), 'description' => $request->get('description'), 'status' => $request->get('status')]); echo $position->status; return \Redirect::route('positions.index')->with('message', 'Position has been updated'); }
public function run() { $faker = \Faker\Factory::create(); foreach (range(1, 8) as $index) { Position::create(['name' => $faker->text(10), 'description' => $faker->paragraph(4), 'status' => 1]); } }
/** * Display a listing of the resource. * * @return Response */ public function index() { $positions = Position::select('id', 'name')->Where('status', '1')->get(); return view('forms.index')->with('positions', $positions); }