本文整理汇总了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();
}
示例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');
}
示例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);
}
示例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();
}
示例5: login
/**
*
*/
public function login()
{
$user = $this->provider->user(Input::get('code'));
dd($user);
Auth::login($user);
return Redirect::home();
}
示例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();
}
示例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!');
}
示例8: store
public function store()
{
$task = new Task(Input::all());
if (!$task->save()) {
return Redirect::back()->withInput()->withErrors($task->getErrors());
}
return Redirect::home();
}
示例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();
}
示例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();
}
示例11: showLogin
public function showLogin()
{
if (!Auth::check()) {
return View::make('dev.login');
} else {
return Redirect::home();
}
}
示例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();
}
示例13: store
public function store()
{
$validation = new $this->model(Input::all());
if (!$validation->save()) {
return Redirect::back()->withInput()->withErrors($validation->getErrors());
}
return Redirect::home();
}
示例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();
}
}
示例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');
}
}