Automatically add controller action URLs to Laravel API resources for frontend routing.
Spatie Laravel Resource Links is a Laravel package that automatically adds URL links to controller actions within API resources. It solves the problem of frontend applications needing to know backend routes without hardcoding them, ensuring route changes in the backend are automatically reflected in the frontend.
Laravel developers building single-page applications (SPAs) or using Inertia.js who need to keep frontend routing synchronized with backend Laravel routes.
It eliminates manual route construction, reduces boilerplate code, and ensures frontend routing stays updated with backend changes automatically, improving development efficiency and reducing errors.
Add links to Laravel API resources
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically creates URLs for controller methods like index, show, create, etc., eliminating manual construction, as shown in the example JSON output in the README.
Adds links to both individual resources and collections via meta data, demonstrated in the UserResource example with links in data and meta sections.
Reduces boilerplate code by inferring routes from Laravel's controller structure, following the package's philosophy of automatic inference.
Keeps frontend routing updated with backend changes automatically, ideal for SPAs and Inertia.js setups as highlighted in the 'Why include links' section.
The package is explicitly marked as abandoned in the README, meaning no further development, bug fixes, or security updates, making it risky for production use.
Relies heavily on convention; deviating from standard controller methods or requiring complex link definitions may necessitate additional configuration or workarounds.
Tightly coupled with Laravel's API resource and controller system, so it's not suitable for projects using other frameworks or non-standard routing architectures.