public function test()
 {
     $subjects = \App\Subject::lists('name')->toJson();
     $file = 'subjects.json';
     $write = File::put($file, $subjects);
     if ($write == false) {
         return 'False roi em oi';
     }
     return 'Good!';
 }
Ejemplo n.º 2
0
 /**
  * Create a new user controller instance.
  *
  * @return void
  */
 public function __construct()
 {
     $this->priviledge_user();
     $this->_user = \Auth::user();
     if (2 == $this->_user->role_id) {
         $this->_query_connect = "=";
         $this->_query_value = $this->_user->department_id;
     }
     $this->_faculty_departments = Department::where('id', $this->_query_connect, $this->_query_value)->lists('name', 'id');
     $this->_faculty_subjects = Subject::lists('name', 'id');
 }
Ejemplo n.º 3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function semesters($id)
 {
     $plan = Plan::findOrFail($id);
     $semesters = $plan->semesters;
     $ordinals = $this->_ordinals;
     $subjects = Subject::lists('name', 'id');
     return view('plans.semesters', compact('plan', 'semesters', 'subjects', 'ordinals'));
 }
Ejemplo n.º 4
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $data['title'] = 'Edit Class';
     $data['classes_menu'] = 1;
     $data['staffs'] = Staff::select(\DB::raw('concat (fname," ",lname) as full_name, id'))->where('staff_type_id', 1)->lists('full_name', 'id')->prepend('Please Select');
     $data['subjects'] = Subject::lists('subject', 'id')->prepend('Please Select');
     $data['class'] = StudentClass::find($id);
     $data['staffs'] = Staff::select(\DB::raw('concat (fname," ",lname) as full_name, id'))->where('staff_type_id', 1)->lists('full_name', 'id');
     return view('settings.class.edit', $data);
 }