Hello i'm having a lot of problems, this is what i have at the moment, can anyone guide me?
- in my kernel file i got this:
protected function schedule(Schedule $schedule)
{
//$schedule->command('inspire')->everyMinute();
$schedule->call(function () {
//send email every month to users
$plans_user = servHosting::whereMonth('plan', '=', Carbon::now()->addMonth()->month)->get();
foreach ($plans_user as $recipient) {
$emails = $recipient->domain;
Mail::to($emails)->send(new OrderShipped ($plans_user));
}
})->everyMinute();
}
- in my orderShipped file i got this:
namespace App\Mail;
use App\Models\servHosting;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class OrderShipped extends Mailable
{
use Queueable, SerializesModels;
public $plans_user;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct(servHosting $plans_user)
{
$this->plans_user = $plans_user;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->markdown('emails.orders.shipped')
->with([
'domain' => $this->plans_user->domain
])
->subject('Plan de hosting proximo a vencer');
}
}
- in my shipped email message file i got this:
@component('mail::message')
# Plan de Hosting
Contenido del email desde el servidor {{ $plans_user->domain }}
@component('mail::button', ['url' => 'https://getweb.com.co'])
Visita nuestro sitio web
@endcomponent
Gracias equipo,<br>
{{ config('app.name') }}
@endcomponent
What im doing wrong?