Laravel view not working

I am trying to learn laravel. I ran into a view issue. while I run the following code:

Route::get('/', function(){ return 'welcome'; }); 

It works great. But while I tried to use the view

 Route::get('/', function(){ return view('welcome'); }); 

I get only a blank page. (welcome.balde.php page exists in the resources / views directory)

I also get problems during routing. such a code

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

I can not access the local host / laravel / public / home directory, it gives me an error that there is no directory or file that was not found. Instead, localhost / laravel / public / index.php / home works. I don’t know what the problem is. I am using php 5.4 and mysql 5.5

+5
source share
2 answers

I use Linux OS, so I have a resolution problem. After granting the correct permission (Apache server) in my project folder, the viewing problem was fixed.

+2
source
Function

view () probably does not exist. Try it,

 Route::get('/', function(){ return View::make('welcome'); }); 

If this does not help (check your log saved in application / repository / logs)

Is your application in debug mode? You can check this in the file / app / config / app.php.

+1
source

Source: https://habr.com/ru/post/1213341/


All Articles