public function getDevice() { if (!Request::ajax()) { return Redirect::to('/'); } $device_id = Request::input('device_id'); $device = Phone::getDevice($device_id); return view('device', ['phone' => $device]); }