/** * Creates a new role. * * @param RoleRequest $request * * @return \Illuminate\Http\RedirectResponse */ public function store(RoleRequest $request) { $this->authorize('admin.roles.create'); $role = $this->role->newInstance(); if ($this->dispatch(new Store($request, $role))) { flash()->success('Success!', 'Successfully created role.'); return redirect()->route('admin.roles.index'); } flash()->error('Error!', 'There was an issue creating a role. Please try again.'); return redirect()->route('admin.roles.create'); }
/** * Creates a new role. * * @param RoleRequest $request * * @return bool */ public function store(RoleRequest $request) { $this->authorize('admin.roles.create'); $role = $this->role->newInstance(); return $this->dispatch(new Store($request, $role)); }