Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class 'App\Http\Controllers\App' not found in laravel 5.2

I am try to use laravel-snappy for pdf generation.

step 1:

run composer require barryvdh/laravel-snappy

step 2:

add in providers Barryvdh\DomPDF\ServiceProvider::class, and aliases 'PDF' => Barryvdh\DomPDF\Facade::class, in app.php

step 3:

create function

    public function pdfTest() {
    $pdf = App::make('snappy.pdf.wrapper');
    $pdf->loadHTML('<h1>Test</h1>');
    return $pdf->inline();
}

then found error:

Class 'App\Http\Controllers\App' not found

How to resolve it.I appreciate all response. Thanks Ahead.

like image 212
Prashant Shukla Avatar asked Sep 14 '16 17:09

Prashant Shukla


Video Answer


1 Answers

Add a backward slash before this line: \App::make('snappy.pdf.wrapper');

Or add use App; below your namespace.

like image 52
baikho Avatar answered Oct 17 '22 00:10

baikho