链接和路由不起作用

时间:2017-07-13 07:50:55

标签: laravel

我正面临路线问题我正在使用laravel 5.4和xampp。     我使用这个地址' localhost / project / laravel / public'去主页。     当我点击导航区域中的任何链接时,我找不到对象。     点击后,地址显示http://localhost/about

I edit home.blade.php as
href = "./" and "./about" By adding period
 problem solved to some extent
but when I am on another page
e.g  login page address is http://localhost/project/laravel/public/users/login
and if I want to go to contact page, again object not found message received
This time address is http://localhost/project/laravel/public/users/contact
I also tried href="{{ url('/contact')}}" in home.blade.php
The problem remains same.
    and
php artisan serve 
localhost:8000    gives 'unable to connect'
Please guide, thanks.

1 个答案:

答案 0 :(得分:0)

您正在做的事情是错误的,您不能通过浏览器网址导航到项目的公共文件夹...您只需要转到laravel项目文件夹并运行命令提示符并键入" php artisan serve "。它会为你生成一个网址。在您的浏览器上输入该URL将正确加载您的项目,这样所有链接都将起作用。