tehseen's avatar

Cpanel upload view not found.

I just upload my laravel project to cpanel on publich_html dir also i copy all files of public folder and move to root dir (public_html) now the view is not found error comes every time. I have make the changes in index.php file like below

require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';

but still no success still have an error view not found please help.

Regards

0 likes
16 replies
tehseen's avatar

only the home url have issue all other are fine why this happen ?

tehseen's avatar

any one help please on this issue

SinghWithLaravel's avatar

@tehseen If file is located on the same location, from where you are trying to access it. Then it might be a cache issue. Cache might cause the issue. try clearing out the cache.

tehseen's avatar

for the home url it only have the route like below and same view calling.

Route

Route::get('/', 'Front\HomeController@index');

Method

public function index(){

        return view('frontend\pages\home');
    }

Rest of all rout over cpanel works fine only the home url (/) is not working why ?

tehseen's avatar

i just change the name of home view but still same error, Don't understand why

SinghWithLaravel's avatar
Level 2

@tehseen You are returning your view in wrong way. Do it like this.

public function index(){
        return view("frontend.pages.home");
}

Use dot(.) for separating folders. For more go on the link.

If still doesn't work,return an array from index method and check whether it is working or not. Share location of view and laravel version over here, and take care of cache as well.

2 likes
siangboon's avatar

will it be case sensitive issue???

perhaps try to comment out the existing route and write a simple function closure to narrow down the scope of issue...

// Route::get('/', 'Front\HomeController@index');

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

tehseen's avatar

Okay so at this moment i thanks to all of you guys, So i will explain the here.

i am using the below code to return view which is wrong

return view("frontend\pages\home");

the correct way is those both below lines

return view("frontend/pages/home");

and 

return view("frontend.pages.home");

So thankyou so much guys.

siangboon's avatar

really?

it's weird for me as I tested both ".", "/" and "\" also working on my side...

Please or to participate in this conversation.