/**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($course_id, $schedule_id)
 {
     $schedule = Schedule::findOrFail($schedule_id);
     $schedule_statuses = ScheduleStatus::lists('name', 'id');
     $states = State::orderBy('name')->lists('name', 'id');
     return view('schedules.edit', compact('schedule', 'states', 'schedule_statuses'));
 }
示例#2
0
 private function getStates()
 {
     $states_rs = State::orderBy('name', 'asc')->get();
     $states = [0 => 'Choose a state'];
     foreach ($states_rs as $s) {
         $states[$s->abbreviation] = $s->name;
     }
     return $states;
 }
示例#3
0
 public function destroy($id)
 {
     State::find($id)->delete();
     $states = State::orderBy('name')->paginate(env('STATE_PAGINATION_MAX'));
     return view('states.index')->with('states', $states);
 }
示例#4
0
 public function index()
 {
     $todos = State::orderBy('id', 'desc')->get();
     return view('todos/index', compact('todos'));
 }