Пример #1
0
 /**
  * @param  SortCategoriesRequest      $request
  * @return \Illuminate\Http\JsonResponse
  */
 public function updateHierarchy(SortCategoriesRequest $request)
 {
     $this->categories->updateHierarchy($request->get('data'));
     return response()->json(['status' => 'OK']);
 }
Пример #2
0
 /**
  * @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);
 }
Пример #3
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Category::rebuild(true);
 }
 public function getAllCategories()
 {
     return Category::all();
 }