Пример #1
0
 /**
  * Display a list of Vehicle's registration number
  * @return static
  */
 public function vehicle()
 {
     return Vehicles::all()->lists('registration', 'registration')->sort();
 }
Пример #2
0
 public function vehicles($eid)
 {
     $vehicle = Vehicles::all()->where('eid', $eid)->pluck('registration')->first();
     return $vehicle;
 }
Пример #3
0
 /**
  * Display records of a specified driver.
  *
  * @param  int  $id
  * @return \Illuminate\View\View
  */
 public function show($id)
 {
     $employee = Employee::query()->findOrFail($id);
     $title = $employee['name'];
     $client = Client::all()->where('id', $employee['cid'])->sortByDesc('updated_at')->first();
     $vehicle = Vehicles::all()->where('eid', $employee['id'])->sortByDesc('updated_at')->first();
     $police = Log::all()->where('action', 'Police Case')->where('eid', $employee['id'])->sortByDesc('updated_at')->count();
     $accident = Log::all()->where('action', 'Accident')->where('eid', $employee['id'])->sortByDesc('updated_at')->count();
     $repository = $this->repository;
     return view('employee.show', compact('title', 'employee', 'vehicle', 'client', 'status', 'repository', 'accident', 'police'));
 }
Пример #4
0
 /**
  * Created by smartrahat Date: 03.12.2015 Time: 05:43AM
  * @param $id
  * @return mixed
  */
 public function currentVehicle($id)
 {
     $vehicle = Vehicles::all()->where('eid', $id)->sortByDesc('updated_at')->first();
     return $vehicle != null ? $vehicle->registration : '';
 }