Learn how to use the powerful CRUD generator to quickly create new modules and manage data within Kitu Kizuri.
CRUD Generator
Learn how to use the powerful CRUD generator to quickly create new modules and manage data within Kitu Kizuri.
CRUD Generator
The CRUD Generator is the fastest way to create a fully functional module in KituKizuri. It guides you through the essential setup steps and produces a working CRUD that you can immediately extend using code.
Step 1 — Generate the Module
Every CRUD in KituKizuri starts with a module. The module defines the unique route identifier, registers permissions, and connects the CRUD to the system's role and company model.
Instead of creating each required piece manually, KituKizuri provides a guided Artisan assistant that handles the entire setup process for you.
Run the generatorphp artisan krud:make --module
- Registers the module with a unique route identifier
- Creates the default permissions (create, read, edit, delete)
- Prepares routing using Laravel resource conventions
- Generates a Controller that extends
Krud - Creates a Model skeleton ready for customization
Once this step is completed, the module exists in the system and can be assigned to roles and companies.
Step 2 — Write the Controller Code
After generating the module, the next natural step is to define how the CRUD behaves. This is done directly inside the generated Controller.
The Controller must extend Krud to access all available CRUD features.
From here, you bind the model and define how fields are displayed and handled.
use App\Models\Product;
use KituKizuri\Krud\Krud;
class ProductController extends Krud
{
public function __construct()
{
$this->setModel(new Product);
$this->setField(['name' => 'Name of field', 'field' => 'name of column in table' ]);
}
}
- The model defines the data source
- Fields control form inputs and table columns
- Configuration replaces repetitive boilerplate code
At this point, the CRUD is already usable and fully integrated with permissions and modules.
Step 3 — Explore Available CRUD Features
KituKizuri provides an extensive set of configuration methods to control validation, visibility, relations, permissions, hooks, and lifecycle behavior.
You do not need to learn all of them to start. Most CRUDs work perfectly with only
setModel() and setField(). Additional features can be added
incrementally as needed.
When you need more control, continue with the full API reference: CRUD Configuration — Available Methods →