/** * * @return \Illuminate\View\View */ public function index() { $tableOptions = ['id' => 'reader-manage', 'class' => 'table-readers', 'row_index' => true]; $options = ['aoColumnDefs' => [['sClass' => 'min-width text-right', 'aTargets' => [0, 1]], ['sClass' => 'min-width', 'aTargets' => [2, -1, -2]]]]; $table = Datatable::table()->addColumn('', trans('ilib::reader.code_th'), trans('user::user.name'), trans('ebook::common.ebook'), trans('ilib::reader.expires_at'), '')->setOptions($options)->setCustomValues($tableOptions); $this->buildHeading([trans('common.manage'), trans('ilib::reader.allow_ebooks')], 'fa-file-pdf-o', [route($this->route_prefix . 'backend.reader.index') => trans('ilib::reader.reader'), '#' => trans('ilib::reader.allowed')]); $readers = Reader::forSelectize()->get()->all(); $ebooks = Ebook::forSelectize()->orderUpdated()->get()->all(); return view('ilib::backend.reader.ebook', compact('tableOptions', 'options', 'table', 'readers', 'ebooks')); }
/** * Lấy danh sách ebooks sử dụng cho selectize ebooks * * @param string $title * * @return \Illuminate\Http\JsonResponse */ public function select($title) { return response()->json(Ebook::forSelectize()->orderUpdated()->findText('title', $title)->get()->all()); }