Ejemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  App\Http\Requests\Admin\LocationRequest  $request
  * @return \Illuminate\Http\Response
  */
 public function store(LocationRequest $request)
 {
     $dataInsert = $request->except(['_token', 'width', 'height']);
     $dataInsert['size_display'] = $request->input('width') . ',' . $request->input('height');
     Location::create(beforeSql($dataInsert));
     return redirect()->action('Admin\\LocationController@index');
 }
Ejemplo n.º 2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  App\Http\Requests\Admin\LocationRequest  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(LocationRequest $request, int $id)
 {
     $dataUpdate = $request->except(['_token', '_method']);
     Location::where('id', $id)->update(beforeSql($dataUpdate));
     Cache::forget('cacheMenuLeft');
     return redirect()->action('Admin\\LocationController@index');
 }