Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class 'Yajra\DataTables\DatatablesServiceProvider' not found

I've developed Laravel Project in my local computer. I used Yajra Pakagebox for using bootstrap datatables on it.

Like this : composer require yajra/laravel-datatables-oracle php artisan vendor:publish

Then I pushed them all into Hosting Server but it displays errors like below.

(1/1) FatalThrowableError
Class 'Yajra\DataTables\DatatablesServiceProvider' not found
in ProviderRepository.php (line 208)
at ProviderRepository->createProvider('Yajra\\DataTables\\DatatablesServiceProvider')
in ProviderRepository.php (line 144)
at ProviderRepository->compileManifest(array('Illuminate\\Auth\\AuthServiceProvider', 'Illuminate\\Broadcasting\\BroadcastServiceProvider', 'Illuminate\\Bus\\BusServiceProvider', 'Illuminate\\Cache\\CacheServiceProvider', 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider', 'Illuminate\\Cookie\\CookieServiceProvider', 'Illuminate\\Database\\DatabaseServiceProvider', 'Illuminate\\Encryption\\EncryptionServiceProvider', 'Illuminate\\Filesystem\\FilesystemServiceProvider', 'Illuminate\\Foundation\\Providers\\FoundationServiceProvider', 'Illuminate\\Hashing\\HashServiceProvider', 'Illuminate\\Mail\\MailServiceProvider', 'Illuminate\\Notifications\\NotificationServiceProvider', 'Illuminate\\Pagination\\PaginationServiceProvider', 'Illuminate\\Pipeline\\PipelineServiceProvider', 'Illuminate\\Queue\\QueueServiceProvider', 'Illuminate\\Redis\\RedisServiceProvider', 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider', 'Illuminate\\Session\\SessionServiceProvider', 'Illuminate\\Translation\\TranslationServiceProvider', 'Illuminate\\Validation\\ValidationServiceProvider', 'Illuminate\\View\\ViewServiceProvider', 'Yajra\\DataTables\\DatatablesServiceProvider', 'Laravel\\Tinker\\TinkerServiceProvider', 'App\\Providers\\AppServiceProvider', 'App\\Providers\\AuthServiceProvider', 'App\\Providers\\EventServiceProvider', 'App\\Providers\\RouteServiceProvider'))
in ProviderRepository.php (line 61)

The important thing is I can't execute any command on Hosting Server because it is Shared Hosting Server. I saw many articles for solving this problem but they are all using "artisan" and "composer" command. But I can't use this command at all. I can only upload the source code to server with FTP.

like image 782
Lee Chang Jian Avatar asked Oct 13 '17 08:10

Lee Chang Jian


1 Answers

Depending on what version of DataTables you are using, it may be simple capitalization issue. After version 8 you should use:

Yajra\DataTables\DataTablesServiceProvider

Before version 8 use:

Yajra\Datatables\DatatablesServiceProvider

Upgrade notes reference: https://yajrabox.com/docs/laravel-datatables/master/upgrade#namespace

like image 192
shuadoc Avatar answered Sep 30 '22 08:09

shuadoc