Пример #1
0
 /**
  * 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');
 }
Пример #2
0
 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]);
     }
 }
Пример #3
0
 /**
  * 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);
 }