本文整理汇总了PHP中Laracasts\Flash\Flash::message方法的典型用法代码示例。如果您正苦于以下问题:PHP Flash::message方法的具体用法?PHP Flash::message怎么用?PHP Flash::message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Laracasts\Flash\Flash
的用法示例。
在下文中一共展示了Flash::message方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: seed
/**
* Run the seed command for the given module
* @param SeedModuleRequest $request
* @return mixed
*/
public function seed(SeedModuleRequest $request)
{
$output = new BufferedOutput();
Artisan::call('module:seed', ['module' => $request->module], $output);
Flash::message($output->fetch());
return Redirect::route('admin.workshop.workbench.index');
}
示例3: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(CreateQuizRequest $request)
{
$input = $request->all();
$quiz = Quiz::create($input);
Flash::message('Quiz saved successfully.');
return redirect(route('lessons.edit', [$quiz->lesson_id]))->with('active_tab', 'quiz');
}
示例4: store
/**
* Save a new status
*
* @return Response
*/
public function store()
{
$input = Input::get();
$input['userId'] = Auth::id();
$this->publishStatusForm->validate($input);
$this->execute(PublishStatusCommand::class, $input);
Flash::message('Your status has been updated!');
return Redirect::back();
}
示例5: postSetPrice
public function postSetPrice(SetPriceRequest $request)
{
$order = Order::find($request->id);
$order->price = $request->price;
$order->status = 'quote sent';
$order->save();
Flash::message('Price set!');
return redirect()->back();
}
示例6: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (Auth::user()->is_admin == false) {
Auth::logout();
Flash::message('You are not allowed here!');
return redirect()->to('/auth/log-in');
}
return $next($request);
}
示例7: postLogin
public function postLogin(LoginRequest $request)
{
$credentials = $request->only('email', 'password');
if ($this->auth->attempt($credentials, $request->has('remember'))) {
Flash::message('You are now logged in');
return redirect()->intended('/' . $this->auth->user()->id . '/orders');
}
Flash::error('Incorrect credentials');
return redirect()->back();
}
示例8: store
/**
* @param SignInRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function store(SignInRequest $request)
{
$input = $request->only('email', 'password');
if (!\Auth::attempt($input)) {
Flash::message('Wrong credentials');
return Redirect::back()->withInput();
}
Flash::message('Welcome Back!');
return Redirect::intended('statuses');
}
示例9: store
/**
* Store a newly created resource in storage.
*
* @param Request $request
* @return Response
*/
public function store(AddNewHouseholdMemberRequest $request, $household)
{
// add extra param head id
if (!$request->has('household_id')) {
$request->merge(['household_id' => $household]);
}
$this->dispatchFrom(AddNewHouseholdMemberJob::class, $request);
Flash::message('Successfully added member. However it requires activation on his/her email account.');
return redirect($this->redirectPath);
}
示例10: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(SendEmailRequest $emailRequest)
{
$values = $emailRequest->all();
$values['status'] = 1;
if ($values['birthday'] === '') {
Email::create($values);
Flash::message('Your email has been sent. Thank you!');
}
return redirect('contact');
}
示例11: contact
public function contact(Request $request)
{
$input = $request->all();
Mail::send('emails.contact', $input, function ($message) use($input) {
$message->from($input['email'], $input['firstname'] . ' ' . $input['lastname']);
$message->to('jclyons52@gmail.com', 'Joseph Lyons')->subject($input['subject']);
});
Flash::message('Your message has been sent');
return redirect()->back();
}
示例12: store
public function store(Requests\ProdutoRequest $request)
{
//este metodo recebe os parametros passasdos pelo formulario
//vamos pegar todos os parametros e armarzenar no banco de dados
Produto::create($request->all());
//armazena a mensagem
Flash::message("Produto adicionado com sucesso!");
//e em seguida redirecionar o usuario para a pagina com a lista dos produtos cadastrados
return redirect()->route('produtos.index');
}
示例13: create
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
public function create(array $data)
{
$confirmation_code = str_random(30);
$data = array_add($data, 'conf', $confirmation_code);
Flash::message('Welcome ' . $data["name"] . '. Thanks for registering. We have sent you a validation link in your e-mail address!');
Mail::send('emails.verify', $data, function ($message) use($data) {
$message->to($data['email'], $data['name'])->subject('Verify your email address');
});
return User::create(['name' => $data['name'], 'lastname' => $data['lastname'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'confirmation_code' => $confirmation_code]);
}
示例14: postRemind
/**
* Handle a POST request to remind a user of their password.
*
* @param Request $request
* @return Response
*/
public function postRemind(Request $request)
{
switch ($response = $this->passwords->remind($request->only('email'))) {
case PasswordBroker::INVALID_USER:
Flash::error(trans($response));
return redirect()->back();
case PasswordBroker::REMINDER_SENT:
Flash::message(trans($response));
return redirect()->back();
}
}
示例15: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(CreateLessonRequest $request)
{
$input = $request->all();
$lesson = Lesson::create($input);
$links = $request->input('links');
if ($links) {
$this->sync($lesson, $links);
}
Flash::message('Lesson saved successfully.');
return redirect(route('lessons.edit', [$lesson->id]));
}