AutoCRUD is a Laravel library which helps you to create CRUD operation using your Database. It also gives you options for the form design. You can create CRUD for multiple tables. Display the data from multiple tables with the search and pagination options and you can also add dynamic fields in a table. It also manages all the routes itself, and generate code in a separate directory for each controller's view.

Download AutoCRUD


Install AutoCRUD using composer.

Step One

Go to the root directory of your project and run below commond in your console.

composer require hirenmangukiya/autocrud:dev-master

Step Two

Add the below line in your main composer.json file under the autoload -> psr4

"Hiren\\Autocrud\\": "vendor/hirenmangukiya/autocrud/src"

Step Three

Autoload the composer

composer dump-autoload

Step Four

Add the providers in your project under the config -> app.php -> providers


Step Five

Copy all the assets into the public directory of your project

php artisan vendor:publish --tag=public --force

Step Six

The final step, make sure that your project has connected to the database

php artisan migrate


Here you set up all the things and it's ready to build your web app.

Single Table CRUD

Get start

After installed AutoCRUD, your project is ready to save your time from write to the same type of code so, you can focus on other important things.

Home Page

Go to Home page using : Yourproject/route/directory/autoHome

Select single Table from the menu and select Table from select box

1. Next page you get all the fields of that page expect timestamp because it's inserted automatically.

2. Select input field type from the list.

Create form fields

3. On that page, you can see all fields of table expect timestamp because it will insert automatically.

4. You can change the Field name as per your requirements, and that given name will display in Table Heading.

5. Select input type from the select box.

6. Add the optins for radio button, checkbox, select and multiselect following by Enter.

7. Apply Html validation as you like and move to next page.

8. If you got an Error like : Field 'fieldname' doesn't have a default value then, kindly look here.

Create layout

9. Select form layout type which one you like.

10. Adjust form as well page layout and give the name of Controller by clicking onNext button.


complete the process, Your controller has generated in app/Http/Controllers/, views are inside the resources\views\user\your_controller_name and route also have been added to your web.php file.

Multi Table CRUD

Select tables & fields

1. Select the number of tables from given list.

2. Select Tables name one by one make sure that you select primary table first.

3. After selecting the tables you can see all the fields of that table. Now, select fields that you required to insert via form or to display in the table.

Select common fields between tables

4. Next page, give a relation between to tables. In above image table product and payment has relation and payment.product_id so, select fields as per your table relationship.

Sort fields and remove duplicate

5. Drag the field up or down and sort it as you would like to design your form and also remove duplicate fields or fields which added by mistake.

6. Create form fields as you like, select form layout and adjust the design as you like and that's it. (To know more about step 6).

Display Data From Multiple Tables

Select fields and common key

1. Select a number of tables and it's fields those which you would like to shows on a table. On next page give a common key between all the tables.

Add extra fields

2. Add dynamic fields to your table which are not in a database such as - percentage, the sum of fields and check the condition before display data on a table.

3. Give filed name as you like and select table fields type either you need to calculate the data or display it conditionally

Filter on data

4. After that sort and remove duplicate fields, click on filter button where you can add a filter in a query.

5. Give the name of page, and that's it your view will generate inside resource/views/user/your_directory_name.

Other Errors

Remove Strict mode

Go to config/database.php and find strict with your database type and replace its property false with true

AutoCRUD A Laravel library to generate CRUD code for given database

About Me

I am a freelancer PHP - Laravel web developer and I to accept challenges that are meaningful to me. I'm interested in all kinds of visual communication, but my major focus is on web development and web designing. Enjoy to play with HTML, CSS, javascript, jquery, and PHP, learn something new daily and always ready for an unexpected challenge.

Find Me

Hire Me