I got error when I change .php file to .blade.php. Before I changed it got this error.
Route::get('hello','HelloController@index');
HelloController
public function index()
{
$data = array(
'name' => 'Rakesh',
'email' => '[email protected]');
return View::make('hello.index')->with('data', $data);
}
/public/hello/index.blade.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Laravel 5.3 - Home page</title>
</head>
<body>
<h1>Welcome Hello index </h1>
<h1>{!!$data!!}</h1>
<h1>{!!$data['email']!!}</h1>
</body>
</html>
Error
The requested resource /hello was not found on this server.
That error occurs when you create a folder in the public folder with the same name as your route so please change the name of the folder you have put in the public folder so that it has a different name from your route this will probably solve your error
The view should be inside resources/views
folder instead of public
folder
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