本文整理汇总了PHP中Alert::message方法的典型用法代码示例。如果您正苦于以下问题:PHP Alert::message方法的具体用法?PHP Alert::message怎么用?PHP Alert::message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alert
的用法示例。
在下文中一共展示了Alert::message方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
public function destroy($id)
{
$category = $this->categoriesRepo->findOrFail($id);
$this->categoriesRepo->delete($category);
\Alert::message("CMS::categories.msg_category_deleted");
return redirect()->route('CMS::admin.categories.index');
}
示例2: test_render_new_messages
function test_render_new_messages()
{
// Having
Alert::message('This is a message', 'info');
// Expect
$this->assertTemplate('alerts/alert', Alert::render());
}
示例3: postPassword
public function postPassword(Request $request)
{
$user = $request->user();
if (!Hash::check($request->get('current_password'), $user->password)) {
return redirect()->back()->withErrors(['current_password' => 'La contrasena actual no es valida']);
}
$this->validate($request, ['password' => 'required|confirmed', 'password_confirmation' => 'required']);
$user->password = bcrypt($request->get('password'));
$user->save();
\Alert::message('Su contrasena fue cambiada', 'success');
return redirect('escritorio');
// ->with('alert', 'Su contrasena fue cambiada');
}
示例4: toggleStatus
public function toggleStatus($id)
{
$article = $this->articlesRepo->findOrFail($id);
$data = '';
$message = null;
if ($article->published_at == null) {
$data['published_at'] = Carbon::now();
$message = 'CMS::articles.msg_article_published';
} else {
$data['published_at'] = null;
$message = 'CMS::articles.msg_article_unpublished';
}
$this->articlesRepo->update($article, $data);
\Alert::message($message);
return redirect()->route('CMS::admin.articles.edit', $article->id);
}
示例5: statusToggle
public function statusToggle($id)
{
$user = $this->usersRepo->findOrFail($id);
if ($user->isBlocked()) {
$user->blocked_at = null;
\Alert::message("CMS::users.msg_user_unblocked");
} else {
if ($user->id == $this->current_user->id) {
\Alert::message("CMS::users.msg_you_cant_block_yourself", "danger");
return redirect()->back();
}
$user->blocked_at = Carbon::now();
\Alert::message("CMS::users.msg_user_blocked");
}
$this->usersRepo->save($user);
return redirect()->route('CMS::admin.users.edit', $user->id);
}
示例6: update
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
* @return Response
*/
public function update($id, PostRequest $request)
{
$post = Post::find($id);
$post->tags()->detach();
$post->update($request->all());
$post->tags()->attach($request->input('tags'));
if ($request->hasFile('thumbnail_link')) {
$file = $request->file('thumbnail_link');
$ext = $file->getClientOriginalExtension();
$fileName = $post->slug . '.' . $ext;
$file->move('./assets/images/confs', $fileName);
$post->thumbnail_link = $fileName;
$post->save();
}
return redirect()->to('dashboard.dashboard')->with('message', Alert::message('conférence "' . $post->title . '"
modifiée avec succès', 'info'));
}