One possible solution is to use the Laravel Backpack package, which provides a CRUD generator for Laravel models. It also includes a user authentication system and allows for customization of the generated views. Here's an example of how to use it:
- Install the package via Composer:
composer require backpack/crud
- Publish the configuration file and assets:
php artisan vendor:publish --provider="Backpack\CRUD\BackpackServiceProvider"
- Generate a CRUD for your model:
php artisan backpack:crud Company
-
Customize the generated views and fields in the
resources/views/vendor/backpack/cruddirectory. -
Add authentication to your application using Laravel's built-in authentication system or a package like Laravel Sanctum.
-
Use Backpack's built-in user management system to restrict access to the CRUD based on user roles and permissions.
Note that this solution does use InertiaJS for some of its views, but it's not required for the CRUD generator itself.