I have configured the mail of gmail for sending messages, in localhost everything works fine, but when I upload it to the server I can not find the class Correo
(which is the one I'm using).
this is the extract from my controller
<?php
namespace App\Http\Controllers;
use Mail;
use Illuminate\Http\Request;
use App\Reserva;
use App\Mail\Correo;
$data = Reserva::all()->last(); //Reserva es un modelo,
Mail::to($data->correo,$data->nombre)
->send(new Correo($data)); //acá siempre me da el error
the mail Correo
is the following
namespace App\Mail;
use App\Reserva;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class Correo extends Mailable{
use Queueable, SerializesModels;
public $reserva;
public function __construct(Reserva $reserva) {
$this->reserva = $reserva;
}
public function build() {
return $this->view('email.email');
}
}
What I do not understand is that everything works well in the local, the error that always comes to me is
Class 'App\Mail\Correo' not found
Does anyone have any idea what may be happening? in advance many thanks