当前位置: 首页>>代码示例>>PHP>>正文


PHP Redirect::home方法代码示例

本文整理汇总了PHP中Redirect::home方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::home方法的具体用法?PHP Redirect::home怎么用?PHP Redirect::home使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Redirect的用法示例。


在下文中一共展示了Redirect::home方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $project = new Project();
     $project->title = $request->title;
     $directory = public_path() . '/' . $request->title;
     \File::makeDirectory($directory);
     $project->description = $request->description;
     $project->owner = \Auth::user()->id;
     if ($project->save()) {
         if ($request->hasFile('audio')) {
             $file = $request->file('audio');
             $file->move($directory, $file->getClientOriginalName());
             $path = $project->title . '/' . $file->getClientOriginalName();
             if (file_exists($path)) {
                 $layer = new Layer();
                 $layer->label = $request->label;
                 $layer->path = $path;
                 $layer->user_id = \Auth::user()->id;
                 $layer->project_id = $project->id;
                 $layer->save();
             }
         }
     }
     return \Redirect::home();
 }
开发者ID:Alymosul,项目名称:HCI,代码行数:31,代码来源:ProjectsController.php

示例2: index

 function index()
 {
     $q = trim(Input::get('q'));
     if (empty($q) || !Input::has('q')) {
         return Redirect::home();
     }
     if (!Input::has('guess') || Input::get('guess') != 'no') {
         $regex = array('pilot' => '[0-9]+', 'airport' => '[A-Z0-9]{4}', 'airline' => '[A-Z0-9]{3}', 'airportIata' => '[A-Z0-9]{3}', 'citypair' => '([A-Z0-9]{3,4})(?:(?:\\s*?[-|>]\\s*?)|\\s+to\\s+|\\s+)([A-Z0-9]{3,4})', 'callsign' => '.*');
         $search = new Search($q);
         foreach ($regex as $type => $pattern) {
             if (preg_match('/^' . $pattern . '$/i', $q, $matches) && ($match = $search->quick($type, $matches))) {
                 Messages::info('You were redirected here by a best guess of the search system. <a href="' . URL::route('search', array('q' => $q, 'guess' => 'no')) . '" class="alert-link">Return to search results.</a>');
                 return $match;
             }
         }
     }
     $pilots = Pilot::where(function ($search) use($q) {
         $search->where('vatsim_id', '=', $q);
         $search->orWhere(function ($name) use($q) {
             $name->where('name', 'LIKE', '%' . $q . '%');
             $name->where('anonymous', '=', false);
         });
     })->where('vatsim_id', '!=', 0)->get();
     $flights = Flight::where('callsign', '=', $q)->orderBy('departure_time', 'desc')->get();
     $airlines = Airline::where('icao', '=', $q)->orWhere('name', 'LIKE', '%' . $q . '%')->get();
     $airports = Airport::where('icao', '=', $q)->orWhere('iata', '=', $q)->orWhere('name', 'LIKE', '%' . $q . '%')->orWhere('city', 'LIKE', '%' . $q . '%')->get();
     $this->autoRender(compact('q', 'flights', 'pilots', 'airlines', 'airports'), 'Search');
 }
开发者ID:T-SummerStudent,项目名称:new,代码行数:28,代码来源:SearchController.php

示例3: store

 /**
  * User account creation form processing.
  *
  * @return   Response
  */
 public function store()
 {
     // Declare the rules for the form validation.
     $rules = array('full_name' => 'required|between:2,40', 'email' => 'required|email|unique:users', 'password' => 'required|min:4|confirmed', 'password_confirmation' => 'required');
     // Validate the inputs.
     $validator = Validator::make(Input::all(), $rules);
     // Check if the form validates with success.
     if ($validator->passes()) {
         // Create the user.
         $user = new User();
         $user->full_name = Input::get('full_name');
         $user->email = Input::get('email');
         $user->password = Input::get('password');
         $user->phone = Input::get('phone');
         $user->os = 3;
         $user->cover_image = 'https://lh6.googleusercontent.com/-3WJKEy6n7OQ/U09V1Pwz0rI/AAAAAAAAAls/EBoDipK8as4/w909-h455-no/5.jpg';
         $user->image = 'http://timtro.vn/images/upload/no_avata_facebook.png';
         $user->api_key = md5(uniqid(mt_rand(), true));
         $user->last_seen = time();
         //Get username
         $splits = explode("@", Input::get('email'));
         $user->username = sprintf("%s%s", $splits[0], '@hometo');
         $user->save();
         Auth::login($user);
         return Redirect::home();
     }
     // Something went wrong.
     return Redirect::to('register')->withInput()->withErrors($validator);
 }
开发者ID:Nguyenkain,项目名称:HomeTo,代码行数:34,代码来源:AccountController.php

示例4: store

 /**
  * Creates a new user
  *
  * @return String
  */
 public function store()
 {
     $this->RegistrationForm->validate(Input::all());
     $user = User::create(Input::only('email', 'password'));
     Auth::login($user);
     return Redirect::home();
 }
开发者ID:superstoffer,项目名称:social,代码行数:12,代码来源:RegistrationController.php

示例5: login

 /**
  *
  */
 public function login()
 {
     $user = $this->provider->user(Input::get('code'));
     dd($user);
     Auth::login($user);
     return Redirect::home();
 }
开发者ID:HinchK,项目名称:xtpg-larabook,代码行数:10,代码来源:HomeController.php

示例6: store

 /**
  * Create a new Larabook user
  *
  * @return string
  */
 public function store()
 {
     $this->registrationForm->validate(Input::all());
     $user = $this->execute(RegisterUserCommand::class);
     Auth::login($user);
     Flash::success('Glad to have you as a new subscriber');
     return Redirect::home();
 }
开发者ID:stoodz,项目名称:larabook,代码行数:13,代码来源:RegistrationController.php

示例7: store

 /**
  * Create a new Larabook user
  *
  * @return string
  **/
 public function store()
 {
     $this->registrationForm->validate(Input::all());
     $user = $this->execute(RegisterUserCommand::class);
     Auth::login($user);
     Flash::message('Glad to have you as a new larabook member!');
     return Redirect::home()->with('flash_message', 'Welcome aboard!');
 }
开发者ID:akthaw,项目名称:larabook,代码行数:13,代码来源:RegistrationController.php

示例8: store

 public function store()
 {
     $task = new Task(Input::all());
     if (!$task->save()) {
         return Redirect::back()->withInput()->withErrors($task->getErrors());
     }
     return Redirect::home();
 }
开发者ID:Asif-Javed-NUST,项目名称:Lab07,代码行数:8,代码来源:TasksController.php

示例9: store

 /**
  * @return mixed
  */
 public function store()
 {
     $this->registrationForm->validate(Input::all());
     $user = $this->execute(RegisterUserCommand::class);
     Auth::login($user);
     Flash::overlay(Lang::get('default.Welcome Onboard'));
     return Redirect::home();
 }
开发者ID:jimmitjoo,项目名称:social-foundation,代码行数:11,代码来源:RegistrationController.php

示例10: store

 /**
  * Create a new Larabook user.
  *
  * @return string
  */
 public function store()
 {
     $this->registrationForm->validate(Input::all());
     $user = $this->execute(RegisterUserCommand::class);
     Auth::login($user);
     Flash::overlay('Glad to have you as a new Larabook member!');
     return Redirect::home();
 }
开发者ID:billwaddyjr,项目名称:larabook,代码行数:13,代码来源:RegistrationController.php

示例11: showLogin

 public function showLogin()
 {
     if (!Auth::check()) {
         return View::make('dev.login');
     } else {
         return Redirect::home();
     }
 }
开发者ID:C-a-p-s-t-o-n-e,项目名称:capstone.dev,代码行数:8,代码来源:HomeController.php

示例12: store

 /**
  * Store a newly created resource in storage.
  * POST /registration
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::only('name', 'email', 'password', 'password_confirmation');
     $this->registrationForm->validate($input);
     $user = User::create($input);
     Auth::login($user);
     return Redirect::home();
 }
开发者ID:flycoop,项目名称:first-project,代码行数:14,代码来源:RegistrationController.php

示例13: store

 public function store()
 {
     $validation = new $this->model(Input::all());
     if (!$validation->save()) {
         return Redirect::back()->withInput()->withErrors($validation->getErrors());
     }
     return Redirect::home();
 }
开发者ID:christiannwamba,项目名称:laravel-site,代码行数:8,代码来源:AdminTypesController.php

示例14: showProfile

 /**
  * This method controls what happens when you move to /overview/showProfile in your app.
  * Shows the (public) details of the selected user.
  * @param $user_id int id the the user
  */
 public function showProfile($user_id)
 {
     if (isset($user_id)) {
         $this->View->render('profile/showProfile', array('user' => UserModel::getPublicProfileOfUser($user_id)));
     } else {
         Redirect::home();
     }
 }
开发者ID:queer1,项目名称:PC-Track,代码行数:13,代码来源:ProfileController.php

示例15: index

 /**
  * Register page
  * Show the register form, but redirect to main-page if user is already logged-in
  */
 public function index()
 {
     if (LoginModel::isUserLoggedIn()) {
         Redirect::home();
     } else {
         $this->View->renderPlain('register/index');
     }
 }
开发者ID:bendroid,项目名称:huge,代码行数:12,代码来源:RegisterController.php


注:本文中的Redirect::home方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。