Posts

Showing posts from May, 2019

How to redirect back to form with input in Laravel

In your HTML you have to use  value = {{ old('') }} . Without using it, you can't get the value back because what session will store in their cache. Like for a name validation, this will be- <input type = "text" name = "name" value = "{{ old('name') }}" /> Now, you can get the value after submitting it if there is error with redirect. return redirect ()-> back ()-> withInput (); for back only: return back ()-> withInput ();

Sql Exists

sql exists s

Sql Tutorial

  Sql Tutorial

Laravel disable auto login after registration

In your RegisterController, add the following method to override the default behavior: public function register (Request $request) { $this ->validator($request->all())->validate(); event( new Registered($user = $this ->create($request->all()))); // $this->guard()->login($user); return $this ->registered($request, $user) ?: redirect( $this ->redirectPath()); } You need to be sure to add these use statements at the top of your controller file: use Illuminate \ Http \ Request ; use Illuminate \ Auth \ Events \ Registered ;