app/Http/Controllers/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(Request $request)
    {
        $role =  Role::create(['name' => $request->name]);
        $role->givePermissionTo($request->get('permissions'));
        toastr()->success('Rol creado con exito!');
        return redirect()->route('roles.index',$role->id);
    }
public function store ( Request $ request ) { $ role = Role :: create ( [ 'name' => $ request -> name ] ) ; $ role -> givePermissionTo ( $ request -> get ( 'permissions' ) ) ; toastr ( ) -> success ( 'Rol creado con exito!' ) ; return redirect ( ) -> route ( 'roles.index' , $ role -> id ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .