public function show(Datatables $datatables, $id) { $store = Store::findOrFail($id); $device = Device::findOrFail($id); if ($datatables->getRequest()->ajax()) { return $datatables->of(Visitor::select(['type', 'device_id', 'created_at'])->where('device_id', $device->id)->orderBy('created_at', 'desc'))->make(true); } $html = $datatables->getHtmlBuilder()->columns(['type', 'created_at']); return view('backend.admin.stores.show', compact('device', 'store', 'html')); }
/** * Run the database seeds. * * @return void */ public function run() { $data = [['uuid' => 'DEVICE_1', 'device_type_id' => DeviceType::first()->id, 'store_id' => Store::first()->id, 'created_at' => Carbon\Carbon::create(), 'updated_at' => Carbon\Carbon::create()]]; Device::insert($data); }
/** * Run the database seeds. * * @return void */ public function run() { $data = [['name' => 'ASpace - Manila', 'client_id' => Client::first()->id, 'created_at' => Carbon\Carbon::create(), 'updated_at' => Carbon\Carbon::create()]]; Store::insert($data); }