If you use Eloquent API Resources to return data, they will be automatically wrapped in 'data'.
If you want to remove it, add JsonResource::withoutWrapping();
in app/Providers/AppServiceProvider.php.
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
JsonResource::withoutWrapping();
}
}
Top comments (2)
Still in Laravel 8
YES