/** * Display a list of Vehicle's registration number * @return static */ public function vehicle() { return Vehicles::all()->lists('registration', 'registration')->sort(); }
public function vehicles($eid) { $vehicle = Vehicles::all()->where('eid', $eid)->pluck('registration')->first(); return $vehicle; }
/** * 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')); }
/** * 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 : ''; }