本文整理汇总了PHP中Laracasts\Flash\Flash类的典型用法代码示例。如果您正苦于以下问题:PHP Flash类的具体用法?PHP Flash怎么用?PHP Flash使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Flash类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Create a new Larabook user
* @param SaveUserRequest $request
* @return string
*/
public function store(SaveUserRequest $request)
{
$user = $this->dispatchFrom(RegisterUserJob::class, $request);
Auth::login($user);
Flash::overlay("Glad to have you as a new Larabook member!");
return redirect(route('home'));
}
示例2: destroy
public function destroy($id)
{
$user = User::find($id);
$user->delete();
Flash::error('El usuario ' . $user->name . ' ha sido borrado con exito!');
return redirect()->route('registrar.index');
}
示例3: updateTask
public function updateTask($id)
{
$task = Task::find($id);
$task->update(Input::all());
Flash::success('Task was updated');
return redirect()->back();
}
示例4: storeNode
/**
* store nestable node
*
* @param $class
* @param string|null $path
* @param integer|null $id
* @throws StoreException
* @return array
*/
protected function storeNode($class, $path = null, $id = null)
{
DB::beginTransaction();
try {
$datas = $this->request->parent != 0 || $this->request->related != 0 ? $this->getDefineDatas($class) : $this->request->all();
$this->model = $class::create($datas);
$this->model->setNode($class, $this->request);
// eğer başka ilişki varsa onları da ekle
if ($this->opsRelation && !$this->fillModel($this->opsRelation)) {
throw new StoreException($this->request->all());
}
event(new $this->events['success']($this->model));
DB::commit();
if (is_null($path)) {
$attribute = "{$this->name}_uc_first";
return response()->json(['id' => $this->model->id, 'name' => $this->model->{$attribute}]);
}
Flash::success(trans('laravel-modules-base::admin.flash.store_success'));
return $this->redirectRoute($path);
} catch (StoreException $e) {
DB::rollback();
event(new $this->events['fail']($e->getDatas()));
if (is_null($path)) {
return response()->json($this->returnData('error'));
}
Flash::error(trans('laravel-modules-base::admin.flash.store_error'));
return $this->redirectRoute($path);
}
}
示例5: destroy
public function destroy($id)
{
$article = Article::find($id);
$article->delete();
Flash::error('Se ha borrado el artículo ' . $article->title . ' exitosamente!');
return redirect()->route('admin.articles.index');
}
示例6: submit
public function submit(Request $request)
{
//dd(bcrypt('123456'));
//dd($request->all());
$user = $this->user;
$this->validate($request, ['email' => 'required|email', 'password' => 'required|confirmed|min:6']);
$input = $request->all();
$findUser = User::where('email', $input['email'])->first();
//dd($findUser);
if ($findUser) {
if ($findUser->id === $user->id) {
//dd('ok');
$user->update(['password' => bcrypt($input['password'])]);
Flash::success('گذرواژه با موفقیت تغییر کرد');
Auth::logout();
return redirect(route('xadmin.index'));
} else {
Flash::error('اطلاعات وارد شده صحیح نمی باشد');
return redirect(route('xadmin.index'));
}
} else {
Flash::error('اطلاعات وارد شده صحیح نمی باشد');
return redirect()->back();
}
}
示例7: destroy
public function destroy($id)
{
$horario = Horario::find($id);
$horario->delete();
Flash::error('El Horario de ' . $horario->name . ' ha sido borrado con exito!');
return redirect()->route('horarios.index');
}
示例8: destroy
public function destroy($id)
{
$paciente = Paciente::find($id);
$paciente->delete();
Flash::error('Paciente ' . $paciente->rfc . ' ha sido borrado con exito!');
return redirect()->route('pacientes.index');
}
示例9: store
/**
* Store a newly created resource in storage.
*
* @param RegisterRequest $request
* @param Authenticator $auth
* @return Response
*/
public function store(RegisterUserRequest $request, Authenticator $auth)
{
$user = $this->execute($request);
$auth->login($user);
Flash::message('Glad to have you as a new Larabook member!');
return redirect()->route('home');
}
示例10: store
public function store(Request $request)
{
$input = $request->all();
$this->dispatch(new StoreUserLessonResultCommand(Auth::id(), $input['lesson_id'], $input['quiz_result']));
Flash::success('Results Saved');
return redirect()->back();
}
示例11: store
public function store(Request $request)
{
$competitor = new Competitor($request->all());
$competitor->save();
Flash::success('Competitor ' . $competitor->name . ' se ha registrado correctamente');
return view('register.competitor.create');
}
示例12: saveProfile
public function saveProfile(Request $request)
{
$user = Auth::user();
$user->update($request->all());
Flash::success('Profil frissítve!');
return redirect()->to('profile');
}
示例13: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$roleId = $this->user->getRoleId($this->auth->user()->id);
$permitted_pages = $this->permitted_page->permittedPages($roleId);
$is_page = false;
foreach ($permitted_pages as $k => $page) {
if (is_numeric($k)) {
if ($request->is($page)) {
$is_page = true;
}
}
}
if (!$is_page) {
if ($permitted_pages['access']) {
return view('backend::_layouts.not_allowed');
} else {
if ($permitted_pages['process']) {
if ($request->method() != "GET") {
Flash::warning('Sayfa Erişim Seviyeniz Bu İşlemi Gerçekleştirmenizi Engelliyor');
return redirect()->back();
}
}
}
}
return $next($request);
}
示例14: handle
/**
* Check if user belongs to the specified role.
*
* @param Request $request
* @param Closure $next
* @param string|array $roles
*
* @return \Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next, $roles)
{
$accessDenied = true;
if (!($user = $this->auth->getActiveUser())) {
Flash::error(trans('dashboard::dashboard.flash.access_denied'));
return redirect()->route('auth.login');
}
if (!is_array($roles)) {
$roles = [$roles];
}
foreach ($roles as $role) {
if (!($role = $this->role->getBySlug($role))) {
continue;
}
if ($user->inRole($role)) {
$accessDenied = false;
}
}
if ($accessDenied) {
Flash::error(trans('dashboard::dashboard.flash.access_denied'));
// Redirect back to the previous page where request was made.
return redirect()->back();
}
return $next($request);
}
示例15: postRegistration
/**
* Process Registration
* @param EventRegistrationFormRequest $request [description]
* @return [type] [description]
*/
public function postRegistration(EventRegistrationFormRequest $request)
{
$event_id = $request->input('event_id');
$attendee_email = $request->input('attendee.email');
$event = $this->eventRepo->findById($event_id);
if ($event->private) {
$attendee = $this->guests->findByEmail($attendee_email);
if ($attendee->isEmpty()) {
$msg = "We are sorry, you have not yet been added to the guest list. Please contact the organizer of this event for more info.";
return redirect()->back()->withInput()->withErrors([$msg]);
}
}
$eventRegistrationValidator = new EventRegistrationValidator($this->eventRepo, $this->attendeeRepository);
if ($eventRegistrationValidator->noEventCapacity($event_id)) {
$msg = "We're sorry, the event is now at full capacity.";
return redirect()->back()->withInput()->withErrors([$msg]);
}
$job = new RegisterAttendee($request);
$this->dispatch($job);
$attendee = $this->attendeeRepository->findByEventAndEmail($event_id, $attendee_email);
if (empty($attendee->id)) {
// Something went wrong if we're in here: the attendee should've been registered
// To Do: create unique exception classes for unique handling
throw new Exception("Unable to find Registered Attendee.");
}
Flash::success('Thank you! You have been registered! A confirmation email have been sent.');
return redirect()->route('event.payment', [$event, $attendee]);
}