app/Http/Controllers/Admin/MainCategoriesController.php
// SHOW TABLE OF ALL WEBSITE MAIN CATEGORIES.
SHOW TABLE OF ALL WEBSITE MAIN CATEGORIES.
SHOW TABLE OF ALL WEBSITE MAIN CATEGORIES .
public function index()
    {
        try {
            $defaultLang = getDefaultLang();
            $mainCates = MainCate::where(
                'trans_lang',
                '=',
                $defaultLang
            )->selection()->paginate(PAGINATION_COUNT);
            return view(
                'admin.main-categories.index',
                compact('mainCates')
            );
        } catch (\Throwable $th) {
            return redirect()->route('admin.dashboard')->with([
                'error' => 'Something went terribly wrong'
            ]);
        }
    }
public function index ( ) { try { $ defaultLang = getDefaultLang ( ) ; $ mainCates = MainCate :: where ( 'trans_lang' , '=' , $ defaultLang ) -> selection ( ) -> paginate ( PAGINATION_COUNT ) ; return view ( 'admin.main-categories.index' , compact ( 'mainCates' ) ) ; } catch ( \ Throwable $ th ) { return redirect ( ) -> route ( 'admin.dashboard' ) -> with ( [ 'error' => 'Something went terribly wrong' ] ) ; } }
SHOW TABLE OF ALL WEBSITE MAIN CATEGORIES.
SHOW TABLE OF ALL WEBSITE MAIN CATEGORIES .
// CONFIGURATION DEFAULT LANGUAGE // COLLECTION OF ALL DB MAIN CATEGORIES // MAIN CATEGORIES TABLE VIEW. // REDIRECT TO ADMIN DASHOBOARD WITH ERROR MESSAGE