How to add dynamic dropdown list column on Laravel 5.3 registration?
If I understood you correctly, you need to override showRegistrationForm()
method. So, copy-paste this method from vendor to RegisterController
and work with it there:
public function showRegistrationForm()
{
// Do something here.
return view('auth.register');
}
Also, do not make any changes in vendor
directory.
laravel 5.3 new Auth::routes()
Auth::routes()
is just a helper class that helps you generate all the routes required for user authentication. You can browse the code here https://github.com/laravel/framework/blob/5.3/src/Illuminate/Routing/Router.php instead.
Here are the routes
// Authentication Routes...
$this->get('login', 'Auth\LoginController@showLoginForm')->name('login');
$this->post('login', 'Auth\LoginController@login');
$this->post('logout', 'Auth\LoginController@logout')->name('logout');
// Registration Routes...
$this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
$this->post('register', 'Auth\RegisterController@register');
// Password Reset Routes...
$this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm');
$this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
$this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm');
$this->post('password/reset', 'Auth\ResetPasswordController@reset');
NotFoundHttpException in RouteCollection.php line 161: laravel 5.3
You make mistake on your params. it should {id}
not {$id}
Change
Route::get('/deleteFile/{$id}',
['as'=>'deleteFile','uses'=>'FilesController@deleteFile']);
to
Route::get('/deleteFile/{id}',
['as'=>'deleteFile','uses'=>'FilesController@deleteFile']);
Link: https://laravel.com/docs/5.3/routing#required-parameters
and Laravel 5.3 now support using name
Route::get('/deleteFile/{id}','FilesController@deleteFile')->name('deleteFile');
Link: https://laravel.com/docs/5.3/routing#named-routes
Laravel 5.3 auth check in constructor returning false
docs
you can't access the session or authenticated user in your
controller's constructor because the middleware has not run yet.As an alternative, you may define a Closure based middleware directly
in your controller's constructor. Before using this feature, make sure
that your application is running Laravel 5.3.4 or above:
class ProjectController extends Controller
{
/**
* All of the current user's projects.
*/
protected $projects;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware(function ($request, $next) {
$this->projects = Auth::user()->projects;
return $next($request);
});
}
}
How to set laravel 5.3 logout redirect path?
This is how I did it. In Auth\LoginController you have:
use AuthenticatesUsers;
Change it to:
use AuthenticatesUsers {
logout as performLogout;
}
Then, define a new logout()
method in your LoginController:
public function logout(Request $request)
{
$this->performLogout($request);
return redirect()->route('your_route');
}
Sure, regular logout()
method in that trait has only 3 lines (used to log users out of the system) so you can copy them to your method, but you should always follow the DRY principle (don't repeat yourself) and re-use as much code as you can.
Related Topics
Forget Password Page, Creating a Generated Password to Email to the User
PHP Foreach by Reference Causes Weird Glitch When Going Through Array of Objects
Storing Database Connection in a Session Variable
Errorbag Is Always Empty in Laravel 5.2
Accessing Laravel .Env Variables in Blade
How to Execute Raw Queries with Laravel 5.1
How to Set a Class Attribute to a Symfony2 Form Input
Php:Binary Image Data, Checking the Image Type
Generate Url with Parameters from an Array
Reverse Geocoding with Google Map API and PHP to Get Nearest Location Using Lat,Long Coordinates
Filling Gaps in Dates Returned from Database - Pure SQL Solution Possible
Is PHP's 'Include' a Function or a Statement
PHP Simplexml Attributes Are Missing
PHP Password_Verify() Hash and Pass Won't Match
Mysqli_Real_Connect(): (Hy000/2002): No Such File or Directory