أنشئ أوامر Artisan مخصصة:
إنشاء أمر
php artisan make:command SendEmailsهيكل الأمر
class SendEmails extends Command
{
protected $signature = 'emails:send {user} {--queue}';
protected $description = 'إرسال البريد للمستخدم';
public function handle()
{
$userId = $this->argument('user');
$queue = $this->option('queue');
$this->info('جاري إرسال البريد...');
}
}إدخال تفاعلي
$name = $this->ask('ما اسمك؟');
$confirmed = $this->confirm('متابعة؟');