Anne W.
Anne W.

Reputation: 68

Class 'Codedge\Fpdf\FpdfServiceProvider' not found

I'm trying to get FPDF to work with Laravel 5.5

I'm not sure if something has changed or what is going on. I followed the advice in this thread first:

How to generate fpdf?

And then I followed the advice in this thread:

Laravel 5.3 codedge/laravel-fpdf Class Not found

But I'm still getting the error "Class 'Codedge\Fpdf\FpdfServiceProvider' not found"

Here is the important parts of my code:

From web.php:

Route::get('/workshops/registration/invoice/' function(){
    Fpdf::AddPage();
    Fpdf::SetFont('Arial', 'B', 18);
    Fpdf::Cell(50, 25, 'Hello World!');
    Fpdf::Output();
})->name('invoicePDF');

From my controller:

Redirect::route('invoicePDF');

From my config/app.php:

'providers' => [

     ....

     ....

    /*
     * Application Service Providers...
     */

     ....

     Codedge\Fpdf\FpdfServiceProvider::class,

     ....
],

'aliases' => [

     ....

     ....

    'Fpdf' => Codedge\Fpdf\Facades\Fpdf::class,

     ....

]

I've run

php artisan vendor:publish --provider='Codedge\Fpdf\FpdfServiceProvider' --tag=config"

both before and after adding to config/app.php, I've run both

composer dumpauto 

and

composer dump-autoload

between, but nothing seems to be working. I get the same "Class 'Codedge\Fpdf\FpdfServiceProvider' not found" error no matter what I do.

Am I missing something silly here?

Upvotes: 0

Views: 725

Answers (1)

TytonDon
TytonDon

Reputation: 573

You seem to have everything set up right. You have verified the class exists right? This may be a good time to open a ticket on github with them as things look correct.

Upvotes: 1

Related Questions