أوامر 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('جاري إرسال الإيميلات...');
$this->line('تم!');
}
}إدخال تفاعلي
$name = $this->ask('ما اسمك؟');
$confirmed = $this->confirm('متابعة؟');
$choice = $this->choice('اختر', ['أ', 'ب']);