mercredi 15 juillet 2020

laravel mail queue give ErrorException

i am trying to make the laravel queue work in my laravel application.

in my controller i use: use App\Mail\Request;

Mail::to($user->email)->send(new Request($result));

to send a mail (this worked fine!)

Then now converted it to: Mail::to($user->email)->queue(new Request($result)); as laravel docs mentioned. But when i try to queue:work my queue, then it get failed.

Stacktrace:

ErrorException: Undefined property: App\Mail\Request::$content in /Applications/MAMP/htdocs/MyLaravelApp/app/Mail/Request.php:39
Stack trace:
#0 /Applications/MAMP/htdocs/MyLaravelApp/app/Mail/Request.php(39): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined prope...', '/Applications/M...', 39, Array)
#1 [internal function]: App\Mail\Request->build()
#2 /Applications/MAMP/htdocs/MyLaravelApp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#3 /Applications/MAMP/htdocs/MyLaravelApp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#4 /Applications/MAMP/htdocs/MyLaravelApp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#5 /Applications/MAMP/htdocs/MyLaravelApp/vendor/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#6 /Applications/MAMP/htdocs/MyLaravelApp/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(117): Illuminate\Container\Container->call(Array)
#7 /Applications/MAMP/htdocs/MyLaravelApp/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php(52): Illuminate\Mail\Mailable->send(Object(Illuminate\Mail\Mailer))
#8 [internal function]: Illuminate\Mail\SendQueuedMailable->handle(Object(Illuminate\Mail\Mailer))
#9 /Applications/MAMP/htdocs/MyLaravelApp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#10 /Applications/MAMP/htdocs/MyLaravelApp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#11 /Applications/MAMP/htdocs/MyLaravelApp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#12 /Applications/MAMP/htdocs/MyLaravelApp/vendor/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)

Who can help me with this issue?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire