Exemplo n.º 1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $vehicles = Vehicle::all();
     if (!$vehicles) {
         return response()->json(['message' => 'No vehicles found', 'code' => 404], 404);
     }
     return response()->json(['data' => $vehicles], 200);
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $estimates = Estimate::orderBy('id', 'DESC')->get();
     $customers = Customer::all();
     $vehicles = Vehicle::all();
     $departments = Department::all();
     $users = User::all();
     return view('estimates.estimates', compact('estimates', 'customers', 'vehicles', 'departments', 'users'));
 }
Exemplo n.º 3
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $vehicles = Vehicle::all();
     return response()->json(['data' => $vehicles], 200);
 }
Exemplo n.º 4
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $customers = Customer::all();
     $vehicles = Vehicle::all();
     return view('customers.customers', compact('customers', 'vehicles'));
 }
Exemplo n.º 5
0
 /**
  * Show a list of all the languages posts formatted for Datatables.
  *
  * @return Datatables JSON
  */
 public function data()
 {
     //weird workaround because datable was broken
     $users = Vehicle::all();
     return Datatables::of($users)->remove_column('created_at')->remove_column('updated_at')->remove_column('deleted_at')->remove_column('locations')->remove_column('last_tracked')->remove_column('type')->remove_column('key')->remove_column('user_id')->remove_column('marker_color')->add_column('actions', '@if ($id!="1337123123")<a href="{{{ URL::to(\'admin/vehicle/\' . $id . \'/edit\' ) }}}" class="btn btn-success btn-sm iframe" ><span class="glyphicon glyphicon-pencil"></span>  {{ trans("admin/modal.edit") }}</a>
                 <a href="{{{ URL::to(\'admin/vehicle/\' . $id . \'/delete\' ) }}}" class="btn btn-sm btn-danger iframe"><span class="glyphicon glyphicon-trash"></span> {{ trans("admin/modal.delete") }}</a>
             @endif')->make();
 }