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.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire