سلام در این جلسه
در فیلمها برای تولید token از str_random استفاده میکنید
اما در حال حاظر phpstorm این متود منسوخ کرده است
در laravel.com سرچ کردم
use Illuminate\Support\Str;
Str::random(50);
، از این کلاس استفاده کرده
بنده هم استفاده کردم
token
در جدول ایجادنمی شود و از طرفی هم این ارور را میدهد
<?php
namespace App\Services\Auth\Traits;
use App\loginToken;
use Illuminate\Support\Str;
trait magicallyAuthenticable
{
public function magicToken()
{
return $this->hasOne(loginToken::class);
}
public function createToken()
{
$this->magicToken()->delete();
return $token= $this->magicToken()->create([
'token'=>Str::random(50)
]);
// dd($token);
}
}
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'notification.login_tokens' doesn't exist (SQL: delete from `login_tokens` where `login_tokens`.`user_id` = 14 and `login_tokens`.`user_id` is not null)