buildCustom() public method

public buildCustom ( $name )
 /**
  * Insert custom controller
  *
  * @param Request $request
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 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);
     $roles = Role::all();
     $rolesInsert = '';
     $first = true;
     foreach ($roles as $role) {
         if ($request->{'role-' . $role->id} == 1) {
             if ($first != true) {
                 $rolesInsert .= ',';
             }
             $rolesInsert .= $role->id;
             $first = false;
         }
     }
     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 != 0 ? $request->parent_id : null, 'roles' => $rolesInsert]);
     return redirect()->route('menu');
 }
 /**
  * Insert custom controller
  *
  * @param Request $request
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function insertCustom(Request $request)
 {
     // Create controller
     $controllerBuilder = new ControllerBuilder();
     $controllerBuilder->buildCustom($request->name);
     // Create views
     $viewsBuilder = new ViewsBuilder();
     $viewsBuilder->buildCustom($request->name);
     $roles = Role::all();
     $rolesInsert = '';
     $first = true;
     foreach ($roles as $role) {
         if ($request->{'role-' . $role->id} == 1) {
             if ($first != true) {
                 $rolesInsert .= ',';
             }
             $rolesInsert .= $role->id;
             $first = false;
         }
     }
     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, 'roles' => $rolesInsert]);
     return redirect()->route('menu');
 }
 /**
  * Insert custom controller
  *
  * @param Request $request
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function insertCustom(Request $request)
 {
     // Create controller
     $controllerBuilder = new ControllerBuilder();
     $controllerBuilder->buildCustom($request->name);
     // Create views
     $viewsBuilder = new ViewsBuilder();
     $viewsBuilder->buildCustom($request->name);
     Menu::create(['position' => 0, 'menu_type' => 3, 'icon' => $request->icon != '' ? $request->icon : 'fa-database', 'name' => $request->name, 'title' => $request->title, 'parent_id' => null, 'roles' => '1']);
     return redirect()->route('menu');
 }
 /**
  * Insert custom controller
  *
  * @param Request $request
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 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');
 }