/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { /* * car data * */ $car = new CarsModel(); $carsAll = $car->allCarsList(); /* * Extra Data * */ $extra = new ExtraModel(); $extraAll = $extra->allExtradata(); /* * PriceData * */ $price = new PriceModel(); $threePricePanels = $price->firstThreePricePanel(); //Return view with data return view('site.index', ['cars' => $carsAll, 'extra' => $extraAll, 'threePricePanel' => $threePricePanels]); }
public function testDeleteButtonPricePanel() { $price = PriceModel::all()->last(); $delete = $price->delete(); $user = factory(User::class)->create(); $this->actingAs($user)->withSession(['sarbik' => 'sarbik'])->visit('admin/price/')->press('Delete')->returnArgument($delete); }
/** * Display first three price panel data * @return Json * * */ public function priceApi(PriceModel $price) { $priceData = $price->firstThreePricePanel(); return response()->json($priceData); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { //Delete Button $price = PriceModel::find($id); $price->delete(); return Redirect::to('admin/price'); }