Artisan Commands โ
PowerGrid registers three artisan commands. Config, translations, and Blade views are published with Laravel's vendor:publish, not powergrid:*.
| Command | What it does |
|---|---|
php artisan powergrid:create | Interactive table generator |
php artisan powergrid:publish | Publish the export job or the model stub |
php artisan powergrid:generate-theme-meta | Write .phpstorm.meta.php for theme() / theme_view() |
vendor:publish tag | What it copies |
|---|---|
livewire-powergrid-config | config/livewire-powergrid.php |
livewire-powergrid-lang | Language files |
livewire-powergrid-views | Blade views |
Create Table โ
php artisan powergrid:createPass a custom stub with --template (path relative to the project root):
php artisan powergrid:create --template=stubs/custom-component.stubThe interactive flow, datasource types, and fillable vs table-schema import are in Create a PowerGrid Table. For subdirectories, stubs, and namespace, see Create PowerGrid Tables.
TIP
To change where components are generated or which model directories are scanned, see Application Structure.
Publish Config File โ
php artisan vendor:publish --tag=livewire-powergrid-configPublish Language Files โ
Copies translations into your app so you can override labels. See Internationalization.
php artisan vendor:publish --tag=livewire-powergrid-langPublish Stubs โ
powergrid:publish defaults to --type=job. Use --type=stub for the Eloquent model stub:
php artisan powergrid:publish --type=stubThis copies table.model.stub to stubs/table.model.stub. Duplicate it and pass the copy with --template on Create Table. To overwrite an existing file, pass --force=1 (the option takes a value; a bare --force does not overwrite).
Publish Export Job โ
php artisan powergrid:publish --type=jobWrites app/Jobs/ExportJob.php from the package export job (namespace rewritten to App\Jobs). This is the command default when --type is omitted.
Publish Views โ
php artisan vendor:publish --tag=livewire-powergrid-viewsCopied views live under resources/views/vendor/livewire-powergrid and are not updated when you upgrade PowerGrid.
DANGER
Publishing Blade views may cause breaking changes. Proceed only if you understand the risks and are prepared to maintain the customized views in future updates.
Generate PhpStorm meta โ
theme() and theme_view() take string keys. This command writes .phpstorm.meta.php in the project root so PhpStorm can autocomplete token names and view aliases.
php artisan powergrid:generate-theme-metaRegenerate it after you change theme tokens.
