/** * Store a newly created resource in storage. * * @param CreateProgramRequest|Request $request * @return Response */ public function store(CreateProgramRequest $request) { // ProgramsModel::create($request->all()); $sub1 = new SubjectRequiredModel(); $sub = new SubjectRequiredModel(); $sub1->program_code = $request->program_code; $sub1->subject_code = $request->required_subject_1; $sub1->save(); $sub->program_code = $request->program_code; $sub->subject_code = $request->required_subject_2; $sub->save(); return redirect('admin/programs'); }
private function setPrograms() { $programs = ProgramsModel::where('program_category', $this->combination)->where('program_min_points', '<=', $this->total_points)->get(); $this->programs_draft = $programs->toArray(); }
public function getProgramsByCat($category) { $programs = ProgramsModel::where('program_category', $category)->get(); return $programs->toArray(); }