Published: Aug 18, 2023 by C.S. Rhymes Sometimes it’s difficult to know whether to buy a system, use an existing open source system, or even build your own system.
// App\Models\Organization use Illuminate\Database\Eloquent\Relations\HasMany; public function services(): HasMany { return $this->hasMany(Service::class); }
// App\Http\Resources\OrganizationResource public function toArray($request) { return [ 'id' => $this->uuid, 'description' => $this->description, 'logo' => $this->logo ?
Route::get('/services/{service}', [ServiceController::class, 'show']) ->name('services.show'); Then we can create a show method on the Service Controller to return the individual service data.