Skip to content

Artisan & publishing

Terminal window
php artisan notify:make OrderOrdered
php artisan notify:make Shop/OrderOrdered

Creates a BaseNotify subclass in App\Notifications (subdirectories via /). Notify is appended to the class name when missing; {{ notifyKey }} in the stub becomes the name without the suffix. The generated class is final, implements ShouldQueue, uses Queueable, takes string $roleKey in the constructor, and has empty prepareText() and typeDefinition() scaffolding.

The command has no options; it refuses to overwrite an existing class.

A stubs/notify.stub file in the project root replaces the package stub.

TagPublishes
notify-templates-configconfig/notify-templates.php
notify-templates-migrationsThe migrations not yet present in database/migrations: create_notifytemplates_tables, create_notify_logs_table, add_content_to_notify_logs_table
notify-templates-langlang/vendor/notify-templates/{en,uk}/log.php
Terminal window
php artisan vendor:publish --tag=notify-templates-migrations

Each migration gets a timestamp one second later than the previous one, so they run in the listed order.

Not a package command — Laravel’s model:prune, scheduled by you:

Schedule::command('model:prune', ['--model' => [\Fomvasss\NotifyTemplates\Models\NotifyLog::class]])->daily();