php - the use statement with non-compound name 'Auth' has no effect laravel -
i unable use auth in seeder class. need tenant_id variable saas application. here's seeder class.
use illuminate\database\seeder; use app\accounttype; use auth; class accounttypetableseeder extends seeder{ public function run() { $accounttype = new accounttype; $accounttype->name = 'travel agent'; $accounttype->description = 'it description of travel agent, write in detaisl account type.'; $accounttype->tenant_id = auth::user()->tenant_id; $accounttype->save(); } }
and called
$this->call(accounttypetableseeder::class);
in top of file put:
use illuminate\support\facades\auth;
Comments
Post a Comment