public function saveCreateCollege(CreateCollegeRequest $req) { $college = new College(); $college->college_guid = Uuid::uuid(); $college->abrr = $req->abrr; $college->name = $req->name; $college->save(); }
public function updateCollege(UpdateCollegeRequest $req) { $college = College::find($req->id); $college->abrr = $req->abrr; $college->name = $req->name; $college->status = $req->status; $college->save(); }
protected function addAcademics() { // Academic details. $this->add('college_id', 'entity', ['label' => 'College', 'class' => 'App\\College', 'selected' => College::where('name', 'None')->value('id')])->add('course_id', 'entity', ['label' => 'Course', 'class' => 'App\\Course', 'property' => 'course_with_type', 'query_builder' => function ($obj) { return $obj::get(); }, 'selected' => Course::where('name', 'None')->value('id')])->add('start_year', 'number', ['label' => 'Matriculation year', 'default_value' => Carbon::today()->year])->add('end_year', 'number', ['label' => 'Graduation year (estimated)', 'default_value' => Carbon::today()->year + 3]); return $this; }
public function getIndex() { if (Request::ajax()) { $colleges = College::all(); $courses = Course::all(); $scholarships = Scholarship::all(); $students = Student::where('archived', 0)->get(); return compact('colleges', 'courses', 'scholarships', 'students'); } }
</div> <?php } } } } } else { ?> <div class="wrap"> <div class="container-fluid"> <div class="row"> <div class="col-md-6 col-md-offset-3"> <?php $colleges = College::all(); if (isset($_GET['type']) && $_GET['type'] == "faculty") { ?> <form id="facultyform" action="register.php<?php echo $opt; ?> " method="POST"> <h2>Faculty Registration</h2> <div class="form-group"> <select name="college" class="form-control" required> <option value="" disabled selected>Select College</option> <?php foreach ($colleges as $key => $op) { ?> <option value="<?php echo $op->id;
public function postUpdate($id) { return College::where('id', $id)->update(Input::get('data')); }
public function courseUpdate($id) { $colleges = College::All(); $course = Course::find($id); $majors = Major::where('course', $course->course_guid)->get(); return view('admin.update-course', compact('colleges', 'course', 'majors')); }
public function getColleges() { $colleges = College::all(); return view('admin.collegesList', compact('colleges')); }
public function deleteCollege($id) { $college = College::find($id)->delete(); return Redirect::to('/admin'); }