app/Http/Controllers/__Old__/__RoleController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(CreateRoleRequest $request)
    {
        $role = new Role();
            $role->name = $request->input('name');
            $role->display_name = $request->input('display_name');
            $role->description = $request->input('description');
        $role->save();
        foreach ($request->input('permission') as $key => $value) {
            $role->attachPermission($value);
        }
        Session::flash('success','Role created successfully');
        return redirect()->route('roles.index');
    }
public function store ( CreateRoleRequest $ request ) { $ role = new Role ( ) ; $ role -> name = $ request -> input ( 'name' ) ; $ role -> display_name = $ request -> input ( 'display_name' ) ; $ role -> description = $ request -> input ( 'description' ) ; $ role -> save ( ) ; foreach ( $ request -> input ( 'permission' ) as $ key => $ value ) { $ role -> attachPermission ( $ value ) ; } Session :: flash ( 'success' , 'Role created successfully' ) ; return redirect ( ) -> route ( 'roles.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .