2
votes

I am new to Laravel and I have encounter some problems when changing the default page of the project.

I have installed Laravel and try to change the route setting

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

to

Route::get("/", function(){return view("home");})

. I have added a simple php page home.blade.php in Resources/views but it couldn't display "home" page.

I have also tried to use Controller approach by adding a HomeController and there is a function called "showHomePage" which will returns view("home") but still no luck.

Are there any setting / configuration is needed ? Thank you

2
Can you show error? - mydo47
Http 500 error only. No Laravel Error - Trevor. W
Ok, you should chmod 777 folder storage and chmod 775 vendor. And try again - mydo47
Ok, I will try it but the default welcome page works fine. Just the new added page not working. - Trevor. W
Because, when you add new file view, laravel render file view in storage/framework/views. And you should chmod permission folder storage, it will work - mydo47

2 Answers

3
votes

you need to clear the compiled view files after changing the template or any view code. ( no need to use command serve)

php artisan view:clear

or delete all files in storage/framework/views

or you should chmod 777 folder storage and chmod 775 vendor.

0
votes

Thanks for mydo47 suggestion. chmod 777 folder storage and chmod 775 vendor (Apply to all sub-folder recursively) solve the problem.