Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel5 make:auth不';行不通_Php_Laravel - Fatal编程技术网

Php Laravel5 make:auth不';行不通

Php Laravel5 make:auth不';行不通,php,laravel,Php,Laravel,我使用了make:auth命令,它显示: Created View: /var/www/myblog/resources/views/auth/login.blade.php Created View: /var/www/myblog/resources/views/auth/register.blade.php Created View: /var/www/myblog/resources/views/auth/passwords/email.blade.php Created View: /

我使用了make:auth命令,它显示:

Created View: /var/www/myblog/resources/views/auth/login.blade.php
Created View: /var/www/myblog/resources/views/auth/register.blade.php
Created View: /var/www/myblog/resources/views/auth/passwords/email.blade.php
Created View: /var/www/myblog/resources/views/auth/passwords/reset.blade.php
Created View: /var/www/myblog/resources/views/auth/emails/password.blade.php
Created View: /var/www/myblog/resources/views/layouts/app.blade.php
Created View: /var/www/myblog/resources/views/home.blade.php
Created View: /var/www/myblog/resources/views/welcome.blade.php
Installed HomeController.
Updated Routes File.
Authentication scaffolding generated successfully!
看起来很棒,我的主页显示正确。

但当我试图访问登录和注册页面时,出现了一些问题。 它给了我一些错误,比如:

Not Found

The requested URL /login was not found on this server.

Apache/2.4.7 (Ubuntu) Server at ...
我在终端中输入了php artisan route:list我得到了:

+--------+-----------+-------------------------+-----------------+-----------------------------------------------------------------+------------+
| Domain | Method    | URI                     | Name            | Action                                                          | Middleware |
+--------+-----------+-------------------------+-----------------+-----------------------------------------------------------------+------------+
|        | GET|HEAD  | /                       |                 | Closure                                                         |            |
|        | GET|HEAD  | article                 | article.index   | App\Http\Controllers\ArticleController@index                    |            |
|        | POST      | article                 | article.store   | App\Http\Controllers\ArticleController@store                    |            |
|        | GET|HEAD  | article/create          | article.create  | App\Http\Controllers\ArticleController@create                   |            |
|        | DELETE    | article/{article}       | article.destroy | App\Http\Controllers\ArticleController@destroy                  |            |
|        | PUT|PATCH | article/{article}       | article.update  | App\Http\Controllers\ArticleController@update                   |            |
|        | GET|HEAD  | article/{article}       | article.show    | App\Http\Controllers\ArticleController@show                     |            |
|        | GET|HEAD  | article/{article}/edit  | article.edit    | App\Http\Controllers\ArticleController@edit                     |            |
|        | GET|HEAD  | home                    |                 | App\Http\Controllers\HomeController@index                       | web,auth   |
|        | GET|HEAD  | login                   |                 | App\Http\Controllers\Auth\AuthController@showLoginForm          | web,guest  |
|        | POST      | login                   |                 | App\Http\Controllers\Auth\AuthController@login                  | web,guest  |
|        | GET|HEAD  | logout                  |                 | App\Http\Controllers\Auth\AuthController@logout                 | web        |
|        | POST      | password/email          |                 | App\Http\Controllers\Auth\PasswordController@sendResetLinkEmail | web,guest  |
|        | POST      | password/reset          |                 | App\Http\Controllers\Auth\PasswordController@reset              | web,guest  |
|        | GET|HEAD  | password/reset/{token?} |                 | App\Http\Controllers\Auth\PasswordController@showResetForm      | web,guest  |
|        | GET|HEAD  | register                |                 | App\Http\Controllers\Auth\AuthController@showRegistrationForm   | web,guest  |
|        | POST      | register                |                 | App\Http\Controllers\Auth\AuthController@register               | web,guest  |
+--------+-----------+-------------------------+-----------------+-----------------------------------------------------------------+------------+
这和我期望的有点不同。因为从我在laracast.com上学到的,路由列表应该像“Auth\login”一样,而不仅仅是“login”。。。Idk这里出了什么问题,是因为我在使用apache吗?或者其他配置我没有正确设置。。。寻求帮助

还有一个问题: 当我访问www.mydomain.com时,我希望默认的欢迎页面而不是auth的主页,但实际上它给了我auth的主页。但是,当我试图访问www.mydomain.com/home时,我希望再次看到该主页,但我收到了404个not found错误,这让我很困惑。这是我的routes.php:

<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::resource('article', 'ArticleController');

Route::group(['middleware' => 'web'], function () {
    Route::auth();

    Route::get('/home', 'HomeController@index');
});

大家好,我刚刚解决了这个问题

这个问题肯定与laravel无关,完全是由Apache2设置引起的

我所做的只是 sudoa2enmod重写 然后重新启动服务