Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

admin-make-module

/admin-make-module

Tworzy nowy moduł admin w projekcie admin-core, np. ekran CRUD lub listę rekordów, i dokańcza to, co zapisało polecenie generujące.

Licencja
MIT
Ostatnia zmiana repozytorium
08.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 08.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Tworzy nowy moduł admin w projekcie admin-core, np. ekran CRUD lub listę rekordów, i dokańcza to, co zapisało polecenie generujące.

Oryginalny opis (EN)

Use when creating a new admin module (a new feature, CRUD screen, master data or list of records) in a yuanmaharsyah/admin-core project. Runs php artisan make:module and finishes what it wrote.

Jak działa

  1. 1. Generate
  2. 2. Finish
  3. What the generator wrote (for later changes)
Sekcje z nagłówków SKILL.md, w oryginale · 41 linii, 460 słów
Podgląd SKILL.md
---
name: admin-make-module
description: "Use when creating a new admin module (a new feature, CRUD screen, master data or list of records) in a yuanmaharsyah/admin-core project. Runs php artisan make:module and finishes what it wrote."
---

# Create a module

Never write a module by hand: `make:module` writes the whole contract (model, policy, Data in / out, controller, routes, migration, factory, seeder, export, pages, form, dictionaries and tests) in the canonical style.

## 1. Generate

```bash
php artisan make:module Kendaraan \
  --fields="plat_nomor:string,merk:string,tahun:year,tanggal_pajak:date?,status:enum(aktif,dijual),catatan:text?,scan_stnk:file(single,required,pdf|jpg,2048)" \
  --actions=view,create,edit,delete,download \
  --group=master --icon=car
```

- `Name` is singular PascalCase; the slug defaults to its plural kebab form (`--slug`, `--label` override).
- Field types: `string, text, integer, year, decimal, currency, boolean, date, datetime, enum(a,b), foreign(table), file(...)`; `year` is a year (1900–2100, shown without a thousands mark, real years in the factory); a trailing `?` makes a field nullable. Name fields in Indonesian snake_case: labels come from the names (`tanggal_mulai` → "Tanggal mulai"). The first `string` field is the record's label (list, title, audit label).
- `file(single|multiple, required, pdf|jpg, 2048)`: an attachment slot (skill `admin-attachments`), options in any order.
- `foreign(table)` needs a module whose model uses that table and has a `lookup` route (skill `admin-relation-field`); otherwise the generator stops and says so.
- `--actions`: only the five standard actions; custom ones afterwards (skill `admin-custom-action`). `--superadmin-only`: no permissions, only Super Admin.
- `--group` is a key of `admin-core.menu.groups` (see `config/admin-core.php` (if the project has none yet: `php artisan vendor:publish --tag=admin-core-config`)); `--icon` a lucide icon name.
- Bad input writes nothing. An existing folder is refused; `--force` regenerates only a folder `make:module` wrote with no uncommitted changes.

It then runs Pint and Prettier, `php artisan permissions:sync`, `php artisan typescript:transform` and `php artisan wayfinder:generate --with-form`. It never migrates. A field that looks like personal data and isn't in `admin-core.audit.masked_fields` gets a warning: add it (skill `admin-audit`).

## 2. Finish

1. Review the migration in `modules/{Name}/Database/Migrations` (indexes on filter / sort columns, `onDelete` on foreign keys), then `php artisan migrate`.
2. Adjust validation in `Data/Store{Name}Data.php` and `Data/Update{Name}Data.php` (`rules()`, Indonesian names in `attributes()`).
3. Adjust the list columns in `resources/js/pages/Index.tsx` and, if needed, `dataTableSearch()` / `dataTableSorts()` / `dataTableFilters()` on the model (index every sort and filter column).
4. Check that `auditLabel()` on the model returns something a person recognises (a number or name).
5. Strings: the module's `resources/js/lang/id.ts` and `en.ts` (skill `admin-translate`).
6. Optionally add a Beranda widget (skill `admin-dashboard-widget`).
7. `composer check` green. Then a Super Admin grants access: Levels → Hak Akses.

## What the generator wrote (for later changes)

- List: the model `implements DataTableModel` with `HasDataTable` and `HasVisibilityScope`; `index()` returns `PaginatedData::fromPaginator()` of `{Name}::query()->visibleTo($request->user())->dataTable($request)` plus `'table' => {Name}::dataTableState($request)`; the page renders `<DataTable>`.
- An "own unit only" rule goes in `applyVisibility()` on the model.
- Delete: `Trash::delete()` (one transaction, one audit batch, undo for Super Admin); `TrashController::routes()` before any `{model}` route.
- Create / edit / show: `useAdminForm`, `<FormFooter>`, `<UnsavedChangesGuard>`, `<StaleUpdateDialog>` on edit; `updateUnlessStale()` with `lock_version`; the Show page has a Riwayat tab from `ActivityHistory::prop()`.

Wersje

W bazie nie ma innych skilli o nazwie admin-make-module.

Migawka bazy z 13.11.2026 · wersja paczki e715116f8892 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100react-admin
    Prowadzi budowę i debugowanie aplikacji admin w react-admin: zasoby, listy, formularze, logowanie, relacje między encjami i własne strony.
  • 90fa-crud-page-generator
    Generuje moduł CRUD dla panelu Fantastic-admin: listę, formularze, stronę szczegółów, API, dane próbne i trasę.
  • 86admin-test-module
    Pisze lub naprawia testy modułu admina: uprawnienia, walidację, audyt, usuwanie logiczne i zakres widoczności.
  • 100add-module
    Tworzy nowy moduł w rozwiązaniu: projekt, schemat bazy, rejestrację, migracje i projekt testów.
  • 100cwp-admin-module
    Buduje bezpieczny moduł administracyjny dla panelu CWP: stronę, AJAX, ochronę CSRF, wywołania przez listę dozwolonych poleceń i instalator.
  • 100curd
    Generuje kompletny moduł CRUD z definicji tabeli bazy danych, koordynując dziewięć podskilli.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.