Skip to content

Artisan Commands โ€‹

PowerGrid registers three artisan commands. Config, translations, and Blade views are published with Laravel's vendor:publish, not powergrid:*.

CommandWhat it does
php artisan powergrid:createInteractive table generator
php artisan powergrid:publishPublish the export job or the model stub
php artisan powergrid:generate-theme-metaWrite .phpstorm.meta.php for theme() / theme_view()
vendor:publish tagWhat it copies
livewire-powergrid-configconfig/livewire-powergrid.php
livewire-powergrid-langLanguage files
livewire-powergrid-viewsBlade views

Create Table โ€‹

bash
php artisan powergrid:create

Pass a custom stub with --template (path relative to the project root):

bash
php artisan powergrid:create --template=stubs/custom-component.stub

The 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 โ€‹

bash
php artisan vendor:publish --tag=livewire-powergrid-config

Publish Language Files โ€‹

Copies translations into your app so you can override labels. See Internationalization.

bash
php artisan vendor:publish --tag=livewire-powergrid-lang

Publish Stubs โ€‹

powergrid:publish defaults to --type=job. Use --type=stub for the Eloquent model stub:

bash
php artisan powergrid:publish --type=stub

This 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 โ€‹

bash
php artisan powergrid:publish --type=job

Writes 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 โ€‹

bash
php artisan vendor:publish --tag=livewire-powergrid-views

Copied 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.

bash
php artisan powergrid:generate-theme-meta

Regenerate it after you change theme tokens.

Created By Luan Freitas and @DanSysAnalyst