Let's say you have a
delete methods and an
UserResource. Wouldn't it be nice if you had the URL's to these methods immediately in your
UserResource without having to construct them from scratch?
This package will add these links to your resource based upon a controller or actions you define. Let's look at an example of a resource.
class UserResource extends JsonResource
public function toArray($request): array
'id' => $this->id,
'name' => $this->name,
'links' => $this->links(UsersController::class),
public static function meta()
'links' => self::collectionLinks(UsersController::class),
Now when creating an
UserResource collection, you will have all the links from the
"name": "Ruben Van Assche",
Why include links in your resources?