📙
QuickAdminPanel
  • QuickAdminPanel Docs
  • Quick Start: Creating Panel
    • Creating a Simple CRUD
    • Radio/Checkbox/Select Fields
    • Relationships fields: belongsTo/belongsToMany
    • File/Photo Upload Fields
    • Date/Time Picker Fields
    • Multi-language Projects
    • API Generator
    • Roles and Permissions
    • How to Change Design Template/Theme
  • Using the Generated Code
    • Download Code and Install on Your Web-Server
    • Push Code to Your Github
    • Edit Code and Merge Changes
    • What Files are Inside the CRUD
  • Modules
    • Modules Overview
    • AJAX Datatables
    • System Calendar
    • Audit Changes Logs
    • Dashboard and Reports
    • Multi-Tenancy
    • CSV Import
    • Global Search
    • User Registration
    • Internal Messages
    • Change Notifications
    • Tasks + Calendar
    • Courses LMS
    • CRUD Templates Modules
  • Customizing the Code
    • Datatables Customizations
    • Upgrade Laravel version
    • Dependent Dropdowns: Parent-Child
    • Add Front User Without Admin Permissions
    • How to Add Mass Actions to Datatable
  • Vue.js + Laravel API Version
    • QuickAdminPanel: Vue.js+Laravel Version
    • What Files are Inside Vue.js+Laravel CRUD?
    • Installing Downloaded Vue.js+Laravel Panel
  • Livewire + Tailwind Version
    • QuickAdminPanel: Livewire+Tailwind Version
    • What Files are Inside Livewire+Tailwind CRUD?
    • Installing Downloaded Livewire+Tailwind Panel
Powered by GitBook
On this page
  • Default MVC Files
  • Database Migrations: Important Notice
  • Additional Files - Depending on Parameters
  • Practical Example
  1. Using the Generated Code

What Files are Inside the CRUD

PreviousEdit Code and Merge ChangesNextModules Overview

Last updated 4 years ago

If you prefer a video version:

Sometimes there is a need to create a new CRUD for existing panel, even after a lot of manual code changes. How to add new CRUD's code into existing system? For that, you need to understand its structure.

Default MVC Files

When you create a CRUD, minimum of 14 new files are generated automatically - 10 new files, and 4 old ones re-generated.

There may be more changes, depending on CRUDs fields and modules involved.

For example, if you create CRUD called Transactions with a few simple columns like "amount" and "transaction_date", here's the minimum list of generated files:

[New Model]

  • app/Transaction.php

[New Controller]

  • app/Http/Controllers/Admin/TransactionsController.php

[New Form Requests]

  • app/Http/Requests/MassDestroyTransactionRequest.php

  • app/Http/Requests/StoreTransactionRequest.php

  • app/Http/Requests/UpdateTransactionRequest.php

[New database migration]

  • database/migrations/2019_12_02_000005_create_transactions_table.php

[New Blade views]

  • resources/views/admin/transactions/create.blade.php

  • resources/views/admin/transactions/edit.blade.php

  • resources/views/admin/transactions/index.blade.php

  • resources/views/admin/transactions/show.blade.php

[Changed main menu Blade view]

  • resources/views/partials/menu.blade.php

[Changed main routes]

  • routes/web.php

[Changed Seeds for Permissions]

  • database/seeds/PermissionsTableSeeder.php

[Changed Translation Files for new CRUD]

  • resources/lang/en/cruds.php

Database Migrations: Important Notice

After every new or changed CRUD, we regenerate all migration files to make sure they are in the right order, to avoid creating foreign keys on non-existing tables. Therefore, keep in mind that you need to double-check the migration files manually, so they still work after you merge changes.

Additional Files - Depending on Parameters

A few more files may change with each new CRUD.

For example, if you add a belongsTo relationship column to other CRUD like Users, then additional these files are touched:

  • [Changed] app/User.php

  • [New] database/migrations/2019_12_02_relationships_transactions_table.php

If you ticked the checkbox to generate API, another list of new files:

  • [New] app/Http/Controllers/Api/V1/Admin/TransactionsApiController.php

  • [New] app/Http/Resources/Admin/TransactionResource.php

  • [Changed] routes/api.php

And the list may be bigger, with additional field types or modules. But, in short, these are the minimum files you need to download and copy-paste or merge into your existing project code.

Practical Example

If you want to view content of those files, here is an of changed files for one new CRUD, similar to the above example.

example Github Pull Request