Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'Yajra\Datatables\Facades\Datatables' not found #294

Closed
fanjavaid opened this issue Dec 8, 2015 · 32 comments
Closed

Class 'Yajra\Datatables\Facades\Datatables' not found #294

fanjavaid opened this issue Dec 8, 2015 · 32 comments

Comments

@fanjavaid
Copy link

Hello, Why i get this error :

Class 'Yajra\Datatables\Facades\Datatables' not found

Cause i never update anything.

My app.php is :

Yajra\Datatables\DatatablesServiceProvider::class,
'Datatables' => Yajra\Datatables\Datatables::class,

How to fix that?

@shafrazlk
Copy link

Change follwoing

Yajra\Datatables\DatatablesServiceProvider::class,
'Datatables' => Yajra\Datatables\Datatables::class,

to this

yajra\Datatables\DatatablesServiceProvider::class,
'Datatables' => yajra\Datatables\Datatables::class,

and try.

@fanjavaid
Copy link
Author

Still get Error,

Server Error
500

At the first time i install this version :

"yajra/laravel-datatables-oracle": "dev-develop"

May be any way to reset configuration??

@shanka12
Copy link

shanka12 commented Dec 8, 2015

try this

'yajra\Datatables\DatatablesServiceProvider',

remove ::class

@fanjavaid
Copy link
Author

Still got error :(
Here is my laravel logs :

[2015-12-08 14:15:36] local.CRITICAL: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'yajra\Datatables\DatatablesServiceProvider' not found' in /Applications/MAMP/htdocs/ulp3/bootstrap/cache/compiled.php:6916
Stack trace:
#0 {main} {"identification":{"id":"8593e01b-5cd9-4b85-9707-1fbaf2d10138"}} 

@shanka12
Copy link

shanka12 commented Dec 8, 2015

I installed "yajra/laravel-datatables-oracle": "~5.0"
its works fine.
dev-develop version not work for me

@yajra
Copy link
Owner

yajra commented Dec 8, 2015

dev-develop uses Yajra\Datatables namespace which will be tagged as v6.0.0. For the facade, please use 'Datatables' => Yajra\Datatables\Datatables::class, atm.

@fanjavaid
Copy link
Author

hmm, I already change to

'Datatables' => Yajra\Datatables\Datatables::class

But it still not work.
And, finally i downgrade to

"yajra/laravel-datatables-oracle": "~5.0" 

It works now.
But I don't know why i get that error suddenly.

Thanks for your support :) 👍

@shairozan
Copy link

I'm actually still having this issue. Had to revert to 5 to get it to work, but I wouldn't say its fixed in 6.

@yajra
Copy link
Owner

yajra commented Jan 12, 2016

@shairozan, the Facade file was removed on v6.0 and an alias was automatically registered in the service provider. You need to replace this use Yajra\Datatables\Facades\Datatables to just use Datatables or use Yajra\Datatables\Datatables instead for better IDE support.

@2kodes
Copy link

2kodes commented Feb 4, 2016

This problem still seems to exist . On a Laravel 5.1.29 install i had to change Yajra\Datatables\DatatablesServiceProvider::class to yajra\Datatables\DatatablesServiceProvider::class in the providers array before it worked.

Version of yajra/laravel-datatables-oracle
{
"name": "yajra/laravel-datatables-oracle",
"version": "v6.0.0-alpha",
"source": {
"type": "git",
"url": "https://github.com/yajra/laravel-datatables.git",
"reference": "41e62d7febf28f901b10d68b953c4dadbb37b1e3"
},

Error seen when trying to do `php artisan vendor:publish --tag=datatables`

[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Yajra\Datatables\DatatablesServiceProvider' not found

@shanmca
Copy link

shanmca commented Sep 24, 2016

Your requirements could not be resolved to an installable set of packages.

Problem 1
- laraveldaily/quickadmin 2.0.0 requires yajra/laravel-datatables-oracle ^6.18 -> satisfiable by yajra/laravel-datatables-oracle[v6.18.0, v6.18.1, v6.18.2, v6.19.0].
- laraveldaily/quickadmin 2.0.1 requires yajra/laravel-datatables-oracle ^6.18 -> satisfiable by yajra/laravel-datatables-oracle[v6.18.0, v6.18.1, v6.18.2, v6.19.0].
- laraveldaily/quickadmin 2.0.2 requires yajra/laravel-datatables-oracle ^6.18 -> satisfiable by yajra/laravel-datatables-oracle[v6.18.0, v6.18.1, v6.18.2, v6.19.0].
- yajra/laravel-datatables-oracle v6.18.0 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[v0.7.0].
- yajra/laravel-datatables-oracle v6.18.1 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[v0.7.0].
- yajra/laravel-datatables-oracle v6.18.2 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[v0.7.0].
- yajra/laravel-datatables-oracle v6.19.0 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[v0.7.0].
- dompdf/dompdf v0.7.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
- Installation request for laraveldaily/quickadmin ^2.0 -> satisfiable by laraveldaily/quickadmin[2.0.0, 2.0.1, 2.0.2].

To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/15-xml.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
- /etc/php/7.0/cli/conf.d/20-ctype.ini
- /etc/php/7.0/cli/conf.d/20-curl.ini
- /etc/php/7.0/cli/conf.d/20-dom.ini
- /etc/php/7.0/cli/conf.d/20-exif.ini
- /etc/php/7.0/cli/conf.d/20-fileinfo.ini
- /etc/php/7.0/cli/conf.d/20-ftp.ini
- /etc/php/7.0/cli/conf.d/20-gettext.ini
- /etc/php/7.0/cli/conf.d/20-iconv.ini
- /etc/php/7.0/cli/conf.d/20-json.ini
- /etc/php/7.0/cli/conf.d/20-mbstring.ini
- /etc/php/7.0/cli/conf.d/20-mcrypt.ini
- /etc/php/7.0/cli/conf.d/20-mysqli.ini
- /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.0/cli/conf.d/20-phar.ini
- /etc/php/7.0/cli/conf.d/20-posix.ini
- /etc/php/7.0/cli/conf.d/20-readline.ini
- /etc/php/7.0/cli/conf.d/20-shmop.ini
- /etc/php/7.0/cli/conf.d/20-simplexml.ini
- /etc/php/7.0/cli/conf.d/20-sockets.ini
- /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.0/cli/conf.d/20-sysvsem.ini
- /etc/php/7.0/cli/conf.d/20-sysvshm.ini
- /etc/php/7.0/cli/conf.d/20-tokenizer.ini
- /etc/php/7.0/cli/conf.d/20-wddx.ini
- /etc/php/7.0/cli/conf.d/20-xmlreader.ini
- /etc/php/7.0/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.0/cli/conf.d/20-xsl.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.

Installation failed, reverting ./composer.json to its original content.

@Britic
Copy link

Britic commented Nov 29, 2016

I occasionally get this message even when it has been working fine up to that point.

For me, just running composer update fixes the issue.

@RBBarani
Copy link

just delete all files inside a bootstrap->cache folder. And run your project. Bug fixed.

@idmeneo
Copy link

idmeneo commented May 22, 2017

Neither "yajra" nor "Yajra" works. I still have the error with Alaval 5.4 & Datatables v7.
It's been 3 hours I've been struggling with this library, it's exshausting.

@yajra
Copy link
Owner

yajra commented May 23, 2017

@idmeneo sorry for the inconvenience. What are steps have you done so far? Are using a fresh installation or upgrading a project?

Some tips:

  1. Use composer show to double check which version of packages you are using.
  2. Delete all files under bootstrap/cache folder as suggested by @RBBarani.
  3. Delete vendor folder and reinstall all packages using composer install.

-- Edit --
"yajra" and "Yajra" namespace is a bit old issue from v5.x and below and I think is irrelevant on v7. Thanks!

@idmeneo
Copy link

idmeneo commented May 23, 2017

Thx for the answer. I finally got it working by downgrading your module to v6.2 and updating all the other libraries.

@rashhmijain
Copy link

Try removing syntactic sugar operators like tilde and caret sign in composer.json. Because sometimes they do not allow the exact version to install. The same problem happened to me also. Then run,

comoposer update

Solved the issue for me.

@yajra
Copy link
Owner

yajra commented Oct 14, 2017

@wisnuvb Namespace and class name were updated on v8. Use DataTables instead of Datatables. See upgrade guide for ref.

@wisnuvb
Copy link

wisnuvb commented Oct 14, 2017

right, I have not read the upgrade guide. once it's done. thank you

@alihesari
Copy link

On v8, Run composer update and use this namespace use Yajra\DataTables\Facades\DataTables;

@syntaxlexx
Copy link

syntaxlexx commented Jan 8, 2018

Changing from v6.0 to v8.0 forced me to change config/app.php
frro

         'Datatables' => Yajra\Datatables\Facades\Datatables::class,

to

        'Datatables' => Yajra\Datatables\Datatables::class,

and it worked fine afterwards.

Also, if used to automatically un-escape html elements, you'd have to publish the vendor package and change config/datatables.php

       /*
         * List of columns to be escaped. If set to *, all columns are escape.
         * Note: You can set the value to empty array to disable XSS protection.
         */
         'escape' => '*',

to

        'escape' => [],

@yajra
Copy link
Owner

yajra commented Jan 9, 2018

@lexxyungcarter please see upgrade guide for ref.

@victorsteven
Copy link

Namespace and class name were updated on v8. Use DataTables instead of Datatables.

That worked

@vajiraHOA
Copy link

@victorsteven's solution worked on a fresh Laravel 5.6 + Datatables 8.7.0

@AQShah
Copy link

AQShah commented Aug 3, 2018

This is use Yajra\DataTables\Facades\DataTables; working fine from my side thanks

@nyamjantsan
Copy link

nyamjantsan commented Feb 5, 2019

I use composer require yajra/laravel-datatables-oracle command and change below line
yajra\Datatables\DatatablesServiceProvider::class,
'Datatables' => yajra\Datatables\Datatables::class,
It,s working.
Something like this https://appdividend.com/2018/04/16/laravel-datatables-tutorial-with-example/

@nadiyaparaamit
Copy link

Use this:

'Datatables' => Yajra\DataTables\Facades\DataTables::class, // Datatable

D and T should be capital.

@washington-kibichii
Copy link

I got this error when I was trying to remove the package. To clear the error, go to boostrap > cache and clear everything

@Sudarmathi
Copy link

Sudarmathi commented Dec 18, 2019

Yajra\DataTables\DataTablesServiceProvider::class, in providers array
Yajra\DataTables\Facades\DataTables::class, in aliases array

use this one, it solved the issue for me

@laurence702
Copy link

Im facing same issue here. code works perfectly on local, but I take it to server and my entire app fails to bootstrap.
steps taken.

  1. I copied yajra from my vendor to server
  2. Copied also published vendor config/datatables.php to server
  3. copied the composer and composer.lock
  4. cleared all in server bootstrap cache

im really frustrated after 2hrs of trying things im seeing here :(

@laurence702
Copy link

After hrs of trying. I decided to re-upload local code which was working into my shared host server. and it works fine now. Thanks Yajra

@stipsuarez
Copy link

I have the same problem with laravel 7 . I execute: php artisan config:cache
And my problem was result.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests