Closed abbasmashaddy72 closed 1 month ago
Usage of this:
FilamentAuthenticationLogPlugin::make()->panelName('admin')
However, this is optional
Why I did this?
FilamentAuthenticationLogPlugin
$record->authenticatable->name
This will show the name of the Actual username instead of Class Name, which will be good when seeing all the logs at a time.
Below Code to use in Model if you don't have name column:
public function getNameAttribute(): string { return trim($this->first_name . ' ' . $this->last_name); }
Had N+1 Query Issue when Getting Username, that too fixed by adding Below Query to Resource Table
->modifyQueryUsing(fn (Builder $query) => $query->with('authenticatable'))
Usage of this:
FilamentAuthenticationLogPlugin::make()->panelName('admin')
However, this is optional
Why I did this?
FilamentAuthenticationLogPlugin
will be used only in developer, but user Resource will be available in admin panel only.$record->authenticatable->name
This will show the name of the Actual username instead of Class Name, which will be good when seeing all the logs at a time.
Below Code to use in Model if you don't have name column:
Had N+1 Query Issue when Getting Username, that too fixed by adding Below Query to Resource Table
->modifyQueryUsing(fn (Builder $query) => $query->with('authenticatable'))