src/Controllers/QuickadminMenuController.php
public function insertCustom(Request $request)
    {
        $validation = Validator::make($request->all(), [
            'name'  => 'required|unique:menus,name',
            'title' => 'required'
        ]);
        if ($validation->fails()) {
            return redirect()->back()->withInput()->withErrors($validation);
        }
        // Create controller
        $controllerBuilder = new ControllerBuilder();
        $controllerBuilder->buildCustom($request->name);

        // Create views
        $viewsBuilder = new ViewsBuilder();
        $viewsBuilder->buildCustom($request->name);

        $menu = Menu::create([
            'position'  => 0,
            'menu_type' => 3,
            'icon'      => $request->icon != '' ? $request->icon : 'fa-database',
            'name'      => $request->name,
            'title'     => $request->title,
            'parent_id' => $request->parent_id ?: null,
        ]);
        $menu->roles()->sync($request->input('roles', []));

        return redirect()->route('menu');
    }
public function insertCustom(Request $request)
    {
        $validation = Validator::make($request->all(), [
            'name'  => 'required|unique:menus,name',
            'title' => 'required'
        ]);
        if ($validation->fails()) {
            return redirect()->back()->withInput()->withErrors($validation);
        }
        // Create controller
        $controllerBuilder = new ControllerBuilder();
        $controllerBuilder->buildCustom($request->name);

        // Create views
        $viewsBuilder = new ViewsBuilder();
        $viewsBuilder->buildCustom($request->name);

        $menu = Menu::create([
            'position'  => 0,
            'menu_type' => 3,
            'icon'      => $request->icon != '' ? $request->icon : 'fa-database',
            'name'      => $request->name,
            'title'     => $request->title,
            'parent_id' => $request->parent_id ?: null,
        ]);
        $menu->roles()->sync($request->input('roles', []));

        return redirect()->route('menu');
    }
public function insertCustom ( Request $ request ) { $ validation = Validator :: make ( $ request -> all ( ) , [ 'name' => 'required|unique:menus,name' , 'title' => 'required' ] ) ; if ( $ validation -> fails ( ) ) { return redirect ( ) -> back ( ) -> withInput ( ) -> withErrors ( $ validation ) ; } // Create controller $ controllerBuilder = new ControllerBuilder ( ) ; $ controllerBuilder -> buildCustom ( $ request -> name ) ; // Create views $ viewsBuilder = new ViewsBuilder ( ) ; $ viewsBuilder -> buildCustom ( $ request -> name ) ; $ menu = Menu :: create ( [ 'position' => 0 , 'menu_type' => 3 , 'icon' => $ request -> icon != '' ? $ request -> icon : 'fa-database' , 'name' => $ request -> name , 'title' => $ request -> title , 'parent_id' => $ request -> parent_id ? : null , ] ) ; $ menu -> roles ( ) -> sync ( $ request -> input ( 'roles' , [ ] ) ) ; return redirect ( ) -> route ( 'menu' ) ; }
Insert custom controller

@param Request $request

@return \Illuminate\Http\RedirectResponse
Insert custom controller