Basic Usage
If you need to fetch data from an API, you may follow the following instructions (Step 2); otherwise, create your model first.
Suppose you want to make a CRUD for your store settings.
Step: 1
bash
php artisan make:model Store -m
Step: 2
To make Controller
/Repository
/Service
& Route
run the following command
bash
php artisan aim-admin:make
Please check the screenshoot above. It creates several file for the CRUD as we described in Architecture
- Controller
- Repository Interface
- Repository Class
- Service Interface
- Service Class
Finally, Put the route in web.php
as like below
php
Route::group(['prefix' => 'store', 'middleware' => ['web', 'auth']], function () {
Route::get('/', [StoreController::class, 'list'])->name('store.list');
Route::get('/show/{id}', [StoreController::class, 'show'])->name('store.show');
Route::get('/edit/{id}', [StoreController::class, 'edit'])->name('store.edit');
Route::post('/update', [StoreController::class, 'update'])->name('store.update');
Route::post('/delete/{id}', [StoreController::class, 'delete'])->name('store.delete');
Route::get('/create', [StoreController::class, 'create'])->name('store.create');
Route::post('/create', [StoreController::class, 'store'])->name('store.store');
});
If you find everything as described above, it means you are good to go. 😅