SeviaFlow Get Started

DevTools: Discovery & Generation

Discovery scans Eloquent models and prints suggestions for SeviaFlow Resources. It does not decide your application's business rules. Use it to get a first draft, then review the generated code and choose which Resource slugs to register.

  1. Install seviaflow/devtools as a development dependency and confirm the database connection works.
  2. Run discovery without generation. This is the default report-only mode and does not write files.
  3. Add --with-schema to inspect database columns and see field, filter, relation, and workflow suggestions.
  4. Limit the scan with --models=Customer,Order if you want to review only selected models.
  5. When the suggestions look useful, add --generate to write the Resource, form, and table starting files.
  6. Copy the printed Resource registration entry into the existing resources map in config/seviaflow.php, then edit and test the generated definitions.
php artisan seviaflow:discover --models=Customer,Order --with-schema
php artisan seviaflow:discover --models=Customer --with-schema --generate

The first command only reports suggestions. The second writes files for the selected model. If a generated file already exists, generation stops unless you pass --force; that option permits overwriting generated files, so review the targets first.

Discovery options

OptionEffect
--models=Customer,OrderIncludes only the named models from the configured scan.
--path=app/Domain/ModelsScans a different model directory for this command run.
--ignored=App\Models\AuditLogAdds model classes to the ignored list for this run.
--with-schemaReads table columns and produces additional field, filter, relation, and workflow suggestions. The database must be reachable and the model table must exist.
--generateWrites Resource, form, and table starter files and prints a registration snippet.
--forceAllows generated files to replace existing files when generation is enabled.
--dry-runPrints a report-only status line. It does not override --generate; omit --generate whenever you want to guarantee that no files are written.

What the suggestions mean

Without --with-schema, discovery can report model metadata such as its table, primary key, fillable/guarded attributes, and casts. With schema inspection enabled, it can suggest input fields, filters, Eloquent relations, and candidate workflow fields. A suggestion is not a policy or a complete domain model: check every field against your application's requirements and remove sensitive or irrelevant data.

Generated resources are written below app/SeviaFlow/Resources in the App\SeviaFlow\Resources namespace by default. A generated Resource is not available in the UI or API until you register its slug in config/seviaflow.php. See Resource Registration for the next step.

Discovery defaults

KeyDefaultMeaning
discovery.enabledtrueEnables model discovery commands.
discovery.model_pathsapp_path('Models')Folders scanned for Eloquent models.
discovery.model_namespacesApp\ModelsNamespaces used for discovered classes.
discovery.ignored_models[]Model classes to skip on every run.

Generation defaults

KeyDefaultMeaning
generation.resources_pathapp_path('SeviaFlow/Resources')Folder where generated Resource files are written.
generation.resources_namespaceApp\SeviaFlow\ResourcesPHP namespace used by generated classes.
generation.stubs_pathbase_path('stubs/seviaflow')Optional host-application stubs used to customize generated output.

For the full command list and option behavior, see DevTools Commands.