dimanche 22 mars 2020

Class 'Illuminate\Http\Resources\Json\Resource' not found

I'm working with Laravel resource api, and I want to use the Resource::withOutWrappint() method. in the AppServiceProvider.php file, my code is

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Http\Resources\Json\Resource;

class AppServiceProvider extends ServiceProvider
{
    public function register()
    {
        //
    }

    public function boot()
    {
        Resource::withoutWrapping();
    }
}

But it gives me an error saying: Class 'Illuminate\Http\Resources\Json\Resource' not found.



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

Aucun commentaire:

Enregistrer un commentaire