routes/web.php
use Illuminate\Support\Facades\Route; Route::get('/configurations', function () { return ConfigurationResource::collection(Configuration::all());});
use Illuminate\Support\Facades\Route; Route::get('/configurations', function () { return ConfigurationResource::collection(Configuration::all());});
use Illuminate\Http\Resources\Json\JsonResource; class ConfigurationResource extends JsonResource{ public function toArray($request) { return [ 'code' => $this->code, 'counts' => $this->counts, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, ]; }}