-
routes/web.php
Open in GitHubuse Illuminate\Support\Facades\Route; Route::get('/configurations', function () { return ConfigurationResource::collection(Configuration::all()); });
-
app/Http/Resources/ConfigurationResource.php
Open in GitHubuse 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, ]; } }