本文整理汇总了PHP中redirect::route方法的典型用法代码示例。如果您正苦于以下问题:PHP redirect::route方法的具体用法?PHP redirect::route怎么用?PHP redirect::route使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类redirect
的用法示例。
在下文中一共展示了redirect::route方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
public function handle($request, Clousure $next)
{
if (userAuth::check()) {
return redirect::route('wap.home');
}
return $next($request);
}
示例2: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index(Request $request)
{
$data = array();
$settings = Sitesetting::find(1);
if ($request->isMethod('post')) {
$validator = Validator::make($request->all(), ['site_name' => 'required', 'default_page_title' => 'required', 'default_meta_keywords' => 'required', 'default_meta_description' => 'required', 'contact_email' => 'required']);
if ($validator->fails()) {
return redirect::route('site_settings')->withErrors($validator);
} else {
$site_name = $request->site_name;
$default_page_title = $request->default_page_title;
$default_meta_keywords = $request->default_meta_keywords;
$default_meta_description = $request->default_meta_description;
$contact_email = $request->contact_email;
$settings->site_name = $site_name;
$settings->default_page_title = $default_page_title;
$settings->default_meta_keywords = $default_meta_keywords;
$settings->default_meta_description = $default_meta_description;
$settings->contact_email = $contact_email;
$settings->save();
return redirect::route('site_settings')->with('success', 'Settings updated successfully.');
}
}
$settings = Sitesetting::all()->first();
$data['settings'] = $settings;
return view('admin/sitesettings', $data);
}
示例3: handle
public function handle($request, Clousure $next)
{
$wapIsOpen = app::get('sysconf')->getConf('sysconf_setting.wap_isopen');
if (base_mobiledetect::isMobile() && $_COOKIE['browse'] != 'pc' && $wapIsOpen) {
return redirect::route('topm');
}
return $next($request);
}
示例4: index
public function index($owner, $project, $commitishPath)
{
$repository = $project->getRepository();
list($branch, $file) = $this->extractReference($repository, $commitishPath, $project->slug);
$blob = $repository->getBlob("{$branch}:\"{$file}\"");
$breadcrumbs = app('git_util')->getBreadcrumbs($file);
$fileType = app('git_util')->getFileType($file);
if ($fileType !== 'image' && app('git_util')->isBinary($file)) {
return redirect::route('blob_raw', ['owner' => $owner, 'project' => $project, 'commitishPath' => $commitishPath]);
}
return View::make('projects/file')->withOwner($owner)->withProject($project)->withFile($file)->withFileType($fileType)->withBlob($blob->output())->withBranch($branch)->withBreadcrumbs($breadcrumbs)->withBranches($repository->getBranches())->withTags($repository->getTags());
}
示例5: sendFile
public function sendFile(Request $request)
{
if ($request->hasFile('inputFile')) {
$pathUplad = 'uploads';
$fileExtension = $request->file('inputFile')->getClientOriginalExtension();
$fileName = str_random(15) . '.' . $fileExtension;
$request->file('inputFile')->move($pathUplad, $fileName);
$this->savePurchases($this->parseFile($pathUplad, $fileName));
return redirect::route('home')->with('alert', 'Dados salvos com sucesso!');
} else {
return redirect::route('home')->with('error', 'Nenhum dado foi enviado!');
}
}
示例6: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create(Request $request)
{
if ($request->isMethod('post')) {
$validator = Validator::make($request->all(), ['first_name' => 'required', 'last_name' => 'required', 'email' => 'required|email|unique:suppliers', 'password' => 'required']);
if ($validator->fails()) {
return redirect::route('add_supplier')->with('errmsg', [$validator->messages()->all()]);
} else {
$first_name = $request->first_name;
$last_name = $request->last_name;
$phone = $request->phone;
$password = $request->password;
$email = $request->email;
$password = $request->password;
$insert_arr = array('first_name' => $first_name, 'last_name' => $last_name, 'phone' => $phone, 'email' => $email, 'password' => Hash::make($password));
Supplier::insert($insert_arr);
return redirect::route('add_supplier')->with('successmsg', 'Supplier is added successfully');
}
}
return view('supplier/create_supplier');
}
示例7: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index(CookieJar $cookieJar, Request $request)
{
if (Session::has('ADMIN_ACCESS_ID')) {
return redirect('admin/dashboard');
}
if ($request->isMethod('post')) {
$admin_email = $request->get('admin_email');
$admin_password = $request->get('admin_password');
$checkAgentExists = Admin::where("email", "=", $admin_email);
$checkAgentExists = $checkAgentExists->get();
if ($request->get('remember_login')) {
$cookieJar->queue(Cookie::make('admin_email', $admin_email, 60));
$cookieJar->queue(Cookie::make('admin_password', $admin_password, 60));
} else {
$cookieJar->queue(Cookie::forget('admin_email'));
$cookieJar->queue(Cookie::forget('admin_password'));
}
if (count($checkAgentExists) > 0) {
if (Hash::check($admin_password, $checkAgentExists[0]->password)) {
Session::put('ADMIN_ACCESS_ID', $checkAgentExists[0]->id);
Session::put('ADMIN_ACCESS_FNAME', $checkAgentExists[0]->first_name);
Session::put('ADMIN_ACCESS_LNAME', $checkAgentExists[0]->last_name);
return redirect::route('dashboard');
} else {
return redirect::route('admin')->with('errorMessage', 'Invalid password provided.');
}
} else {
return redirect::route('admin')->with('errorMessage', 'Invalid email address or/and password provided.');
}
}
$data = array();
$data['admin_email'] = '';
$data['admin_password'] = '';
$admin_email = Cookie::get('admin_email');
$admin_password = Cookie::get('admin_password');
if ($admin_email && $admin_password) {
$data['admin_email'] = $admin_email;
$data['admin_password'] = $admin_password;
}
return view('admin/login', $data);
}
示例8: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index(Request $request)
{
$agent_id = Session::get('AGENT_ACCESS_ID');
$data = array();
$data['record'] = Agent::find($agent_id);
if ($request->isMethod('post')) {
$first_name = $request->first_name;
$last_name = $request->last_name;
$phone = $request->phone;
$password = $request->password;
$update_arr = array('first_name' => $first_name, 'last_name' => $last_name, 'phone' => $phone);
if ($password != '') {
$update_arr['password'] = md5($password . Config::get('constants.SITENAME'));
}
Agent::where('id', '=', $agent_id)->update($update_arr);
Session::put('ADMIN_ACCESS_FNAME', $first_name);
Session::put('ADMIN_ACCESS_LNAME', $last_name);
return redirect::route('agent_profile')->with('successmsg', 'Profile is updated successfully');
}
return view('agent/profile', $data);
}
示例9: directory
public function directory()
{
$app_id = input::get('app_id');
$content_path = input::get('content_path');
$open_path = trim(input::get('open_path'));
if (!$this->check($app_id, $content_path)) {
return redirect::route('shopadmin', array('app' => 'site', 'ctl' => 'admin_explorer_app', 'act' => 'index'));
}
$fileObj = kernel::single('site_explorer_file');
$dir = realpath(APP_DIR . '/' . $app_id . '/' . str_replace('-', '/', $content_path) . '/' . str_replace(array('-', '.'), array('/', '/'), $open_path));
//open_pathapp::get('site')->_(不允许有)'./'&'../'
$filter = array('id' => $app_id, 'dir' => $dir, 'show_bak' => false, 'type' => 'all');
$file = $fileObj->file_list($filter);
$file = $fileObj->parse_filter($file);
$pagedata['file'] = array_reverse($file);
$pagedata['url'] = sprintf('?app=%s&ctl=%s&act=%s&app_id=%s&content_path=%s', input::get('app'), input::get('ctl'), input::get('act'), input::get('app_id'), input::get('content_path'));
$pagedata['app_id'] = $app_id;
$pagedata['content_path'] = $content_path;
$pagedata['open_path'] = $open_path;
$pagedata['last_path'] = strrpos($open_path, '-') ? substr($open_path, 0, strrpos($open_path, '-')) : ($open_path ? ' ' : '');
return $this->page('site/admin/explorer/app/directory.html', $pagedata);
}
示例10: change_password
public function change_password(Request $request)
{
$admin_id = Session::get('ADMIN_ACCESS_ID');
$data = array();
$settings = Admin::find($admin_id);
if ($request->isMethod('post')) {
$validator = Validator::make($request->all(), ['current_password' => 'required', 'new_password' => 'required|confirmed', 'new_password_confirmation' => 'required']);
if ($validator->fails()) {
return redirect::route('change_password')->withErrors($validator);
} else {
$current_password = $request->current_password;
$new_password = $request->new_password;
$new_password_confirmation = $request->new_password_confirmation;
if (\Hash::check($current_password, $settings->password)) {
$settings->password = $new_password;
$settings->save();
return redirect::route('change_password')->with('success', 'Password updated successfully.');
} else {
return redirect::route('change_password')->with('error', 'Invalid current password provided.');
}
}
}
return view('admin/change_password', $data);
}
示例11: update
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
* @return Response
*/
public function update(Request $request, $id)
{
$validator = Validator::make($request->all(), ['first_name' => 'required', 'last_name' => 'required']);
if ($validator->fails()) {
$messages = $validator->messages();
return redirect::route('agent_edit', $id)->withErrors($validator)->withInput();
} else {
$agent = Agent::find($id);
$first_name = $request->input('first_name');
$last_name = $request->input('last_name');
$password = $request->input('password');
$phone = $request->input('phone');
$agent->first_name = $first_name;
$agent->last_name = $last_name;
if ($phone) {
$agent->phone = $phone;
}
if ($password != '') {
$agent->password = $password;
}
if ($request->file('user_image')) {
$file = Input::file('user_image');
$imagename = time() . '.' . $file->getClientOriginalExtension();
if (file_exists(public_path('upload/agentprofile/' . $agent->image)) && $agent->image != '') {
$image_path = public_path('upload/agentprofile/' . $agent->image);
$image_thumb_path = public_path('upload/agentprofile/thumb/' . $agent->image);
\File::Delete($image_path);
\File::Delete($image_thumb_path);
}
$path = public_path('upload/agentprofile/' . $imagename);
$image = \Image::make($file->getRealPath())->save($path);
$th_path = public_path('upload/agentprofile/thumb/' . $imagename);
$image = \Image::make($file->getRealPath())->resize(128, 128)->save($th_path);
$agent->image = $imagename;
}
$agent->save();
return redirect::route('agent_management')->with('success', 'Agent updated successfully.');
}
}
示例12: delRenOsusume
public function delRenOsusume($id)
{
DB::table('rental_product')->where('id', '=', $id)->update(array('is_deleted' => DELETED));
Session::flash('success', 'The rental product deleted successfully.');
return redirect::route('admin.rental.osusume');
}
示例13: switchToPc
public function switchToPc()
{
setcookie('browse', 'pc');
return redirect::route('topc');
}
示例14: store
/**
* Store a newly created resource in storage.
*
* @param Request $request
* @return Response
*/
public function store(CookieJar $cookieJar, Request $request)
{
if ($request->isMethod('post')) {
$agent_email = $request->get('agent_email');
$agent_password = $request->get('agent_password');
$checkAgentExists = Agent::where("email", "=", $agent_email);
//$checkAgentExists = $checkAgentExists->where("password", "=", md5($agent_password.\Config::get('constants.SITENAME')));
$checkAgentExists = $checkAgentExists->get();
if ($request->get('remember_login')) {
$cookieJar->queue(Cookie::make('agent_email', $admin_email, 60));
$cookieJar->queue(Cookie::make('agent_password', $admin_password, 60));
} else {
$cookieJar->queue(Cookie::forget('agent_email'));
$cookieJar->queue(Cookie::forget('agent_password'));
}
if (count($checkAgentExists) > 0) {
if (Hash::check($agent_password, $checkAgentExists[0]->password)) {
Session::put('AGENT_ACCESS_ID', $checkAgentExists[0]->id);
Session::put('ADMIN_ACCESS_FNAME', $checkAgentExists[0]->first_name);
Session::put('ADMIN_ACCESS_LNAME', $checkAgentExists[0]->last_name);
return redirect::to('agent/dashboard');
} else {
return redirect::route('agent')->with('errorMessage', 'Invalid password provided.');
}
} else {
return redirect::route('agent')->with('errorMessage', 'Invalid email address or/and password provided.');
}
//if(count($checkAgentExists) > 0){
// Session::put('AGENT_ACCESS_ID', $checkAgentExists[0]->id);
// Session::put('ADMIN_ACCESS_FNAME', $checkAgentExists[0]->first_name);
// Session::put('ADMIN_ACCESS_LNAME', $checkAgentExists[0]->last_name);
// return redirect('agent/dashboard');
//}else{
// return redirect('agent')->with('message', 'Invalid email address or/and password.');
//}
}
}
示例15: logout
public function logout()
{
setLogout();
return redirect::route('clubs');
//return redirect::route('home');
}