Umer Rasheed
Umer Rasheed

Reputation: 138

Laravel 5.8 View [admin.home] not found on live site

my laravel site is working fine on localhost but not working on live domain after i upload my site on hosting.

I cleared my cache from online, check my routes again but nothing change.

MY ROUTES:

        Route::group(['prefix' => 'admin', 'namespace' => 'Admin'], function ()         {
         Route::get('/', 'HomeController@home')->name('admin.home');
   //    Route::resource('/', 'DashboardController');
         Route::resource('school_account', 'SchoolAccountController');
         Route::get('school_account/{school_account}/update_status', 'SchoolAccountController@update_status')->name('school_account.update_status');
         Route::resource('package', 'PackageController');
         Route::resource('license', 'LicenseController');
         Route::resource('feature', 'FeatureController');
     });

my Controller Class

 <?php

 namespace App\Http\Controllers\Admin;

 use Illuminate\Http\Request;
 use App\Http\Controllers\Controller;

 class HomeController extends Controller
 {
     public function home()
     {
         return view('admin.home');
     }
 }

directory of blades:

Upvotes: 0

Views: 2838

Answers (2)

Vikash Pathak
Vikash Pathak

Reputation: 3562

Make sure your view file exist on server.

<project-root>/resources/views/admin/home.blade.php

And try to clear the view cache.

php artisan view:clear

Upvotes: 0

Jerodev
Jerodev

Reputation: 33186

I suppose you are developing on a Windows machine and host your website on a Linux machine?

On Windows, folders are case insensitive, meaning that Admin and admin are the same folder. However, on Linux, paths are case sensitive and those paths are not the same.

Rename your views/Admin folder to views/admin and all should be fixed.

Upvotes: 3

Related Questions