سلام
چند چیز رومتوجه نمیشم
در ابتدا میگه کلاس mailmessage دوم آیا باید use بشه
سوم ما که اصلا فایل meilmessage نداریم
و اینmailmessage به چه چیزی اشاره دارد.ممنون میشم اگر عملکرد کد رو توضیح بدید
(تریز)
و در آخر علت این خطا
web.php
<?php
use App\Models\User;
use App\Models\Video;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\IndexController;
use App\Http\Controllers\VideoController;
use App\Http\Controllers\CategoryVideoController;
use App\Mail\VerifyEmail;
use Illuminate\Support\Facades\Mail;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', [IndexController::class, 'index'])->name('index');
Route::get('/videos/create', [VideoController::class, 'create'])->name('videos.create');
Route::post('/videos', [VideoController::class, 'store'])->name('videos.store');
Route::get('/videos/{video}', [VideoController::class, 'show'])->name('videos.show');
Route::get('/videos/{video}/edit', [VideoController::class, 'edit'])->name('videos.edit');
Route::post('/videos/{video}', [VideoController::class, 'update'])->name('videos.update');
Route::get('/categories/{category:slug}/videos', [CategoryVideoController::class, 'index'])->name('categories.videos.index');
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth'])->name('dashboard');
require __DIR__ . '/auth.php';
Route::get('/email' ,function() {
$user = User::first();
return new VerifyEmail($user);
});
VerifyEmail.php
<?php
namespace App\Mail;
use App\Mail\MailMessage;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class VerifyEmail extends Mailable
{
use Queueable, SerializesModels;
private $user;
/**
* Create a new message instance.
*/
public function __construct(User $user)
{
$this->user = $user;
}
/**
* Build the message.
*/
public function build()
{
return $this->html((string)(new MailMessage)
->greeting("this is test")
->line("line one")
->action('test','http://google.com')
->render()
);
}
}