Category : queue

I am using laravel queue to get laters record of users If two users use the same functaion at same time , the values get replicated this is my code on controller ……. SendInvitation::dispatch($email,$name,$nhs_number,$appInfo,$userInfo)->onQueue(‘high’); …….. SendInvitation on quaue code public function handle() { try { $user = User::orderBy(‘created_at’,’DESC’)->first(); if($user != null){ $enu_id = $user->invitation_id; }else{ ..

Read more

I am a beginner at Laravel. I want to upload files using a queue in Laravel. I have created a simple example in laravel to upload file, but I don’t know how to use queue with upload file. index.blade.php <h2>Upload file</h2> <form action="{{ route(‘file.store’) }}" method="post" enctype="multipart/form-data"> {{{– csrf_field(): This function can be used to ..

Read more

I have the following mailable: <?php namespace AppMail; use IlluminateBusQueueable; use IlluminateMailMailable; use IlluminateQueueSerializesModels; class UserLoginDetailsMail extends Mailable { use Queueable, SerializesModels; protected String $username; protected String $email; protected String $password; /** * Create a new message instance. * * @param String $username * @param String $email * @param String $password */ public function __construct(String ..

Read more

I am mailing to the users using the queue job. sent mail in background. but when I am sent mail direct to the user {{route(”)}} work properly, but not with queue job. Code in My Email Blade File: {{ route(‘trainer.check_status’) }} Normal Mail: http://mydomail.test/trainer/check_status With Queue Job http://localhost/trainer/check_status please help me to out this issue. ..

Read more

I am using sqlite to process the laravel queues and my case did not work due to the sqlite is in different Dyno. The documentation has this information https://devcenter.heroku.com/articles/sqlite3#disk-backed-storage. If you have another alternative using sqllite, I am grateful. The configuration I made is in accordance with this response from the configuration with database: Laravel ..

Read more

How to pass priorities (high, medium, low) in AWS SQS in Lumen PHP. Packages "php": "^7.3|^8.0", "aws/aws-sdk-php": "^3.158", "laravel/lumen-framework": "^8.0" queqe.php <?php return [ ‘default’ => env(‘QUEUE_CONNECTION’, ‘sqs’), ‘connections’ => [ ‘sqs’ => [ ‘driver’ => ‘sqs’, ‘key’ => ‘key’, ‘secret’ => ‘secret’, ‘prefix’ => ‘https://sqs.us-east-1.amazonaws.com/1234567891452’, ‘queue’ => ”, ‘suffix’ => ‘dev-test-app’, ‘region’ => ‘us-east-1’, ..

Read more

I encountered a strange issue within my laravel system. I was using queue to handle a time consuming task. I noticed that even though I’m running in local, queue did not need queue:work or listen command to work. Also, whatever changes I make in queue is not reflected when executing. I have tried restarting queue ..

Read more

I’m using Laravel Notifications and trying to send an email via the toMail method. .env file QUEUE_CONNECTION=database Below is the class. <?php namespace AppNotifications; use CarbonCarbon; use IlluminateBusQueueable; use IlluminateContractsQueueShouldQueue; use IlluminateNotificationsMessagesMailMessage; use IlluminateNotificationsNotification; class PlanPurchasedNotification extends Notification implements ShouldQueue { use Queueable; protected $transaction; /** * Create a new notification instance. * * @return ..

Read more

Works well when I want to use Laravel’s default email verifier But when I put the same method that sends the email in a queue, the url sent to the user is wrong http://localhost/email/verify/65/36a5c019a9dc059333f38c329f3694d6ba646e36?expires=1614871373&signature=52f2f377d559a6bdd913b6fc210106b352ed1c60ff64cf1166d2b0ec562f086d The above url is incorrect instead of localhost:8000 has only the localhost value User Model public function sendEmailVerificationNotification() { sendEmailVerify::dispatch($this); } ..

Read more

I use Redis as a queue driver and dispatch a job that sends notifications to users. The problem is that users get the same notification multiple times. Laravel 8.0, standard Redis configuration. Supervisor config: [program:laravel-worker] process_name=%(program_name)s_%(process_num)02d command=php /var/www/vhosts/website.com/httpdocs/artisan queue:work –sleep=0 –tries=3 –max-time=3600 autostart=true autorestart=true stopasgroup=true killasgroup=true numprocs=10 redirect_stderr=true stdout_logfile=/var/www/vhosts/website.com/httpdocs/storage/logs/worker.log stopwaitsecs=3600 Job: class NotifySubscribersOfReply implements ShouldQueue, ..

Read more

When i run queue in production i get this error in laravel log files. I run php artisan queue:work command in server automatically with crontab every minute. [2021-02-18 16:56:02] production.ERROR: Trying to access array offset on value of type null {"exception":"[object] (ErrorException(code: 0): Trying to access array offset on value of type nul$ [stacktrace] #0 ..

Read more

I know the jobs are supposed to run asynchronously and they do not suppose to return a value. Still, I’m looking for a solution to somehow pass "up" information obtained in the job. It doesn’t have to be by a return statement, it can be by some other $this->variable in the service or any other ..

Read more