You can't directly access it like that , it's not a facades property or method.
It's a just a field in your table and in form.
You can do something like this to get the administrator value once user is logged in .
$adm = Auth::user()->administrator;
And show me your controller method where you are writing this .
Oct 1, 2024
3
Level 1
Add Field to Laravel Breeze Authentication
Hi,
I have added a field called "administrator" in DB of users table of Laravel Breeze. I have added the field in table and in user model
protected $fillable = [
'name',
'email',
'password',
'administrator'
];
Now I need to retrieve the value of that field in a controller, but the command:
$ammCheck = Auth::administrator();
return this error:
Method Illuminate\Auth\SessionGuard::administrator does not exist.
I have inclueded the Illuminate\Support\Facades\Auth in the controller.
Why that dosn't work?
Thanks and best regards...
Please or to participate in this conversation.