jeudi 31 décembre 2020

Bad Method Call Exception Laravel

Following is my route code

Route::get( 'generate_pdf', 'Admin\UserController@generateproviderlist' )->name('provider.pdf') ;

and Controller

<?php

 namespace App\Http\Controllers\Admin;

 use Illuminate\Http\Request;
 use Intervention\Image\ImageManagerStatic as Image;
 use App\Http\Controllers\Controller;

 // For Uploading image, we need to include these libraries
 use Illuminate\Support\Facades\Input;
 use Illuminate\Support\Facades\File;
 use Illuminate\Support\Facades\URL;

 use Illuminate\Support\Facades\Hash;

 use App\User;
 use App\Profile;
 use App\ProfileAddress;
 use App\Service;
 use App\Category;
 use App\ProviderService;
 use App\ProviderCategory;

 class UserController extends Controller
 {
      public function generateproviderlist( Request $request )
     {
         $user_list = User::join('profiles', 'profiles.user_id', '=', 'users.id')
                            ->where('users.is_deleted', 0)
                            ->where( 'users.user_type', 2 )
                            ->select('users.id', 'users.is_enable', 'users.email', 'users.phone',      'profiles.company_name', 'profiles.reg_number')
                            ->get() ;

         $mpdf = new \Mpdf\Mpdf();
         $html = view('admin.provider.provider_pdf', ['provider_list' => $user_list])->render();
         $mpdf->WriteHTML($html);
         $mpdf->Output('done_list.pdf', 'D');

        return false;
     }
 }

When I visit the url I get an exception

Method App\Http\Controllers\Admin\UserController::generateproviderlist does not exist.

Following is the telescope url for the exception. https://do-net.com/telescope/requests/925fbd80-c2a8-4ed5-981d-cc0a21bb9c29

I have tried Clearing the cache and changed the function name but it isn't working. the other routes are working perfectly fine. The route is working fine on my localhost but it is giving 500 error on the live server



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3rHqnwN
via IFTTT

Aucun commentaire:

Enregistrer un commentaire