/**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(int $id)
 {
     $setData['data'] = Location::where('id', $id)->get();
     $cutData = explode(',', $setData['data'][0]['size_display']);
     $setData['data'][0]['width'] = $cutData[0];
     $setData['data'][0]['height'] = $cutData[1];
     // d($setData['data']->toArray()) ;
     $setData['actionLink'] = action('Admin\\LocationController@update', ['id' => $id]);
     if ($setData['data']) {
         $setData['action'] = 'edit';
         return View::make('admin.location.add_edit', $setData);
     } else {
         return abort(404);
     }
 }
Пример #2
0
 public static function getLocation()
 {
     return Location::where('types', 'ShopOfTheWeek')->where('types', self::$type);
 }
Пример #3
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(int $id) : int
 {
     return Location::where('id', $id)->first()->delete();
 }