/** * Store a newly created resource in storage. * * @return Response */ public function store(CreateRequest $createRequest) { $result = $this->roleRepository->store($createRequest->all()); $alert = ['type' => $result ? 'success' : 'warning', 'data' => $result ? ['新角色创建成功'] : ['角色创建失败']]; return redirect('admin/rbac/role/create')->with('am-alert', $alert); }
/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(CreateRequest $createRequest) { $result = $this->roleRepository->store($createRequest->all()); $result ? $alert = '创建成功' : ($alert = '创建失败'); return redirect('rbac/role')->with('message', $alert); }