Ejemplo n.º 1
0
 /**
  * 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]);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 /**
  *  Display first three price panel data
  *  @return Json
  *
  * */
 public function priceApi(PriceModel $price)
 {
     $priceData = $price->firstThreePricePanel();
     return response()->json($priceData);
 }
Ejemplo n.º 4
0
 /**
  * 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');
 }