I've made some change in routes.php
and rest configuration is default. routes.php
is as follows:
//Route::get('/', 'WelcomeController@index');
Route::get('/', 'HomeController@index');
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);
Output of php artisan route:list is
+--------+--------------------------------+-------------------------------------------------------+------+------------------------------------------------------------+------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+--------------------------------+-------------------------------------------------------+------+------------------------------------------------------------+------------+
| | GET|HEAD | / | | App\Http\Controllers\HomeController@index | auth |
| | GET|HEAD | auth/register/{one?}/{two?}/{three?}/{four?}/{five?} | | App\Http\Controllers\Auth\AuthController@getRegister | guest |
| | POST | auth/register/{one?}/{two?}/{three?}/{four?}/{five?} | | App\Http\Controllers\Auth\AuthController@postRegister | guest |
| | GET|HEAD | auth/login/{one?}/{two?}/{three?}/{four?}/{five?} | | App\Http\Controllers\Auth\AuthController@getLogin | guest |
| | POST | auth/login/{one?}/{two?}/{three?}/{four?}/{five?} | | App\Http\Controllers\Auth\AuthController@postLogin | guest |
| | GET|HEAD | auth/logout/{one?}/{two?}/{three?}/{four?}/{five?} | | App\Http\Controllers\Auth\AuthController@getLogout | |
| | GET|HEAD|POST|PUT|PATCH|DELETE | auth/{_missing} | | App\Http\Controllers\Auth\AuthController@missingMethod | guest |
| | GET|HEAD | password/email/{one?}/{two?}/{three?}/{four?}/{five?} | | App\Http\Controllers\Auth\PasswordController@getEmail | guest |
| | POST | password/email/{one?}/{two?}/{three?}/{four?}/{five?} | | App\Http\Controllers\Auth\PasswordController@postEmail | guest |
| | GET|HEAD | password/reset/{one?}/{two?}/{three?}/{four?}/{five?} | | App\Http\Controllers\Auth\PasswordController@getReset | guest |
| | POST | password/reset/{one?}/{two?}/{three?}/{four?}/{five?} | | App\Http\Controllers\Auth\PasswordController@postReset | guest |
| | GET|HEAD|POST|PUT|PATCH|DELETE | password/{_missing} | | App\Http\Controllers\Auth\PasswordController@missingMethod | guest |
+--------+--------------------------------+-------------------------------------------------------+------+------------------------------------------------------------+------------+
When I access the site via http://laravel/
I get
The requested URL /auth/login was not found on this server.
but if I use http://laravel/index.php/auth/login
it works without any error. What is wrong with my routing?
I am using WAMP on windows 7 64-bit.
Your application's authentication configuration file is located at config/auth. php . This file contains several well-documented options for tweaking the behavior of Laravel's authentication services.
The controller creates the user and saves it into the database. Then it redirects the user, who is not yet authenticated, to the login route. The postLogin method gets triggered, but this time with no request data. As a result, Auth::attempt($credentials) fails and you get that nasty Failure on screen.
The attempt method accepts an array of key / value pairs as its first argument. The password value will be hashed. The other values in the array will be used to find the user in your database table. So, in the example above, the user will be retrieved by the value of the email column.
In my project, I had to add the following instruction to Apache configuration:
<Directory /var/www/html/checkin>
AllowOverride All
</Directory>
You need to enable mode_rewrite for apache.I solved this problem following this blog
http://www.kingpabel.com/apache-mod_rewrite/
Apache mod_rewrite
//enable mod rewrite
a2enmod rewrite
//restart apache
service apache2 restart
Without apache, You can test it with php artisan serve
. Before you need to do some changes in .env, change APP_ENV
to local. then browse auth\login,
check the error. In my case the error is : PDO not found.
Hope this might help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With