public function create() { $regions = Region::lists("name", "id"); $users = User::select(\DB::raw("CONCAT(surname, ' ', name) AS full_name, id"))->lists("full_name", "id"); $vehicles = Vehicle::lists("name", "id"); return View::make('Middle.Web.VehiclesRegionsAllotment.create', compact(['regions', 'users', 'vehicles'])); }
public function destroy(Region $region) { if (is_integer($region)) { $region = Region::find($region); } $region->delete(); Flash::success('Region has been created Deleted!'); return Redirect::back(); }
public function edit(Vehicle $vehicle) { $currencies = Currency::select(\DB::raw("CONCAT(name, ' ', symbol) AS full_name, id"))->lists("full_name", "id"); $users = User::select(\DB::raw("CONCAT(surname, ' ', name) AS full_name, id"))->lists("full_name", "id"); $vehicles = Vehicle::lists("name", "id"); $regions = Region::lists("name", "id"); $families = Family::lists("name", "id"); $dealsterms = Dealsterm::lists("Description", "idDealsTerm"); $dealsstages = Dealsstage::lists("Description", "idDealsStage"); $dealscategories = Dealscategory::lists("Description", "idDealsCategories"); $vehicleTypes = VehicleType::lists("name", "id"); return View::make('Middle.Web.Vehicle.edit', compact(['vehicle', 'currencies', 'users', 'vehicles', 'regions', 'contacts', 'families', 'dealsterms', 'dealsstages', 'dealscategories', 'vehicleTypes', 'contacts'])); }
public function destroy($region) { $region = Region::find($region); $region->delete(); return response(['data' => true, 'status' => 'success', 'message' => 'successfully deleted']); }