app/Http/Controllers/Admin/MainCategoriesController.php
// SHOW FORM OF EDITING MAIN CATEGORY'S VIEW
SHOW FORM OF EDITING MAIN CATEGORY'S VIEW
SHOW FORM OF EDITING MAIN CATEGORY ' S VIEW
public function edit($cate_id)
    {
        try {
            $cate = MainCate::with(['trans_cates'])->selection()->find($cate_id);
            if (!$cate) {
                return redirect()->route('admin.main.cates')->with([
                    'error' => 'No such main category'
                ]);
            }
            return view(
                'admin.main-categories.edit',
                compact('cate')
            );
        } catch (\Throwable $th) {
            return redirect()->route('admin.main.cates')-with([
                'error' => 'Something went terribly wrong'
            ]);
        }
    }
public function edit ( $ cate_id ) { try { $ cate = MainCate :: with ( [ 'trans_cates' ] ) -> selection ( ) -> find ( $ cate_id ) ; if ( ! $ cate ) { return redirect ( ) -> route ( 'admin.main.cates' ) -> with ( [ 'error' => 'No such main category' ] ) ; } return view ( 'admin.main-categories.edit' , compact ( 'cate' ) ) ; } catch ( \ Throwable $ th ) { return redirect ( ) -> route ( 'admin.main.cates' ) - with ( [ 'error' => 'Something went terribly wrong' ] ) ; } }
SHOW FORM OF EDITING MAIN CATEGORY'S VIEW
SHOW FORM OF EDITING MAIN CATEGORY ' S VIEW
// DATABASE MAIN CATEGORY WITH ITS TRANSLATIONS // MAIN CATEGORY DB EXISTANCE CHECK // REDIRECT TO EDITING FORM VIEW // REDIRECT TO ADMIN MAIN CATEGORITES TABLE