/** * @param SortCategoriesRequest $request * @return \Illuminate\Http\JsonResponse */ public function updateHierarchy(SortCategoriesRequest $request) { $this->categories->updateHierarchy($request->get('data')); return response()->json(['status' => 'OK']); }
/** * @param $category_id * @return mixed */ public function index($category_id = null) { return view('backend.quiz.questions.index')->withQuestions($this->questions->getQuestionsPaginated(config('quiz.questions.default_per_page'), $category_id))->withCategories(Category::getNestedList('name', null, ' - '))->withCategory($category_id); }
/** * Run the database seeds. * * @return void */ public function run() { Category::rebuild(true); }
public function getAllCategories() { return Category::all(); }