public function edit($id) { if (!$this->user || !$this->user->isClerk()) { $this->alert('warning', 'Only Clerks are allowed to edit Job Lists.'); return redirect("job-lists/{$id}"); } $this->view->job_list = JobList::find($id); $this->view->title = 'Edit Job List #' . $this->view->job_list->id; $this->view->job_types = JobType::orderBy('name', 'ASC')->get(); $this->view->crews = Crew::orderBy('name', 'ASC')->get(); $this->view->breadcrumbs = ['job-lists' => 'Job Lists', 'job-lists/' . $this->view->job_list->id => $this->view->job_list->name, 'job-lists/' . $this->view->job_list->id . '/edit' => 'Edit']; return $this->view; }
public function index(Request $request) { $this->view->title = 'Crews'; $this->view->breadcrumbs = ['crews' => 'Crews']; $this->view->crews = Crew::orderBy('name', 'ASC')->get(); $calendar = new \CalendR\Calendar(); $this->view->months = []; $now = new \DateTime('First day of this month'); for ($i = 0; $i < 6; $i++) { $this->view->months[] = $calendar->getMonth($now); $now->add(new \DateInterval('P1M')); } return $this->view; }