/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $model = Registro::findOrFail($id); try { Storage::delete($model->filename); } catch (Exception $e) { // The file was deleted on the server, someone should know about this... } $model->delete(); return redirect('registros')->with('message', 'Registro eliminado exitosamente!'); }
public function placas() { $dates = array(); $plates = array(); $dataset = Registro::groupBy('day')->get([DB::raw('DATE(created_at) as day'), DB::raw('count(*) as placas_vistas')]); foreach ($dataset as $data) { array_push($dates, $data['day']); array_push($plates, $data['placas_vistas']); } return view('reportes.placas', compact('dates', 'plates')); }