Answer the question
In order to leave comments, you need to log in
Why is router not working in laravel 5?
I created a site view with the file name index.blade.php
I also created a controller for it:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class HomeController extends Controller
{
public function index()
{
return view('index');
}
}
<?php
Route::get('/', ['uses' => '[email protected]', 'as' => 'home']);
?>
Answer the question
In order to leave comments, you need to log in
The problem is clearly not in Laravel - your web server is crookedly configured. Most likely, the DocumentRoot does not look in the public folder of the site, but one level higher.
Most likely you don't have a .htaccess file in the root of your project. You need to specify a redirect to the /public folder. There you have the starting index.php file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question