Пример #1
0
 public function complaint_submit(Request $request)
 {
     $name = $request->get('name');
     $building = $request->get('option');
     $rollnumber = Session('roll_number');
     $subject = $request->get('subject');
     $details = $request->get('details');
     $hostel_name = $request->get('hostel_name');
     $complaint = Complaints::insert(['building' => $building, 'hostel' => $hostel_name, 'subject' => $subject, 'description' => $details, 'created_name' => $name, 'created_rollnumber' => $rollnumber]);
     if ($complaint) {
         return Redirect::to('/complaintts')->with('message', 'Complaint recorded successfully.');
     } else {
         return Redirect::to('/complaints')->with('message', 'Complaint could not be recorded.');
     }
     //return view('Hostels.complaint', ['details' => $hostel]);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // Uncomment the bsaelow to run the seeder
     Complaints::insert(['id' => '100000', 'hostel' => 'o', 'subject' => '', 'description' => '', 'created_name' => '']);
 }