spatie/laravel-resource-endpoints
Abandoned package that adds controller-based “links” and collection “meta” links to Laravel API Resources. Automatically generates URLs for actions like index/show/edit/update/delete, so resources can expose REST endpoints without manually building routes.
use HasLinks in JsonResource).spatie/laravel-package-tools) may cause issues.spatie/laravel-honeypot) that achieve the same goal with active support?ResourceController).UserResource, PostResource).route() helper manually.use Illuminate\Support\Facades\Route;
class UserResource extends JsonResource {
public function toArray($request): array {
return [
'links' => [
'self' => route('users.show', $this->id),
'edit' => route('users.edit', $this->id),
// ...
],
];
}
}
spatie/laravel-api-tools or nWidart/laravel-modules).php artisan route:cache).JsonResource methods or traits.RouteServiceProvider.create_function).show, index) first.store, update, destroy) if needed.posts.user links).HasMeta).spatie/laravel-package-tools or Laravel core.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Laravel 10+ incompatibility | Broken API responses | Fork package or use manual route() calls |
| Link generation errors | Incorrect/missing URLs | Add validation in API tests |
| Abandoned package security risks | Unpatched vulnerabilities | Audit dependencies manually |
| Over-reliance on package | Technical debt if package dies | Document fallback strategies |
HasLinks trait and basic usage.How can I help you explore Laravel packages today?