Пример #1
0
 public function logVehicle($id)
 {
     return $id == 0 ? '' : Vehicles::findOrFail($id)->registration;
 }
Пример #2
0
 /**
  * Show vehicle log from storage
  * Created by smartrahat Date: 21.11.2015 Time: 08:32PM
  * @param $id
  * @return \Illuminate\View\View
  */
 public function vehicleLog($id)
 {
     $vehicle = Vehicles::findOrFail($id);
     $logs = Log::where('bid', $id)->orderBy('date', 'desc')->orderBy('id', 'desc')->get();
     $title = 'Vehicle Log';
     $repository = $this->repository;
     return view('vehicle.vehicleLog', compact('title', 'logs', 'vehicle', 'repository'));
 }
Пример #3
0
 public function removeVehicle(Request $request)
 {
     $redirect = $request['cid'];
     $request['c_description'] = 'Bus removed';
     $request['b_description'] = 'Removed form client';
     $request['action'] = 'Remove';
     Log::create($request->all());
     // update log
     $vehicle = Vehicles::findOrFail($request['bid']);
     $request['cid'] = 0;
     $vehicle->update($request->only(['cid']));
     // update vehicle's foreign key
     return redirect('client/' . $redirect);
 }