Skip to content

Commit

Permalink
allow to customize the user attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Feb 5, 2024
1 parent bfd646c commit bb27534
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"pest_2.33.4","defects":[],"times":{"P\\Tests\\ArchTest::__pest_evaluable_it_will_not_use_debugging_functions":0.212,"P\\Tests\\FormsTest::__pest_evaluable_it_can_list_Form":0.029,"P\\Tests\\FormsTest::__pest_evaluable_it_can_render_Form_List":0.181,"P\\Tests\\FormsTest::__pest_evaluable_it_can_not_edit":0.062,"P\\Tests\\FormsTest::__pest_evaluable_it_can_render_create_form_page":0.112,"P\\Tests\\FormsTest::__pest_evaluable_it_can_create":0.009,"P\\Tests\\FormsTest::__pest_evaluable_it_see_form_when_not_require_login":0.012,"P\\Tests\\FormsTest::__pest_evaluable_it_see_form_when_not_require_login_for_guest":0.01,"P\\Tests\\FormsTest::__pest_evaluable_it_see_form_require_login_for_guest_user":0.011,"P\\Tests\\FormsTest::__pest_evaluable_it_can_retrieve_data":0.059,"P\\Tests\\FormsTest::__pest_evaluable_it_can_render_list_Forms":0.012,"P\\Tests\\FormsTest::__pest_evaluable_it_the_form_can_be_rendered":0.009,"P\\Tests\\FormsTest::__pest_evaluable_it_can_render_show_Form":0.012,"P\\Tests\\FormsTest::__pest_evaluable_it_see_form_require_login_for_logged_in_user":0.009,"P\\Tests\\FormsTest::__pest_evaluable_it_can_save":1.177,"P\\Tests\\FormsTest::__pest_evaluable_it_see_form_date_is_valid":0.014,"P\\Tests\\FormsTest::__pest_evaluable_it_see_ended_form_date":0.01,"P\\Tests\\ResourcesTest::__pest_evaluable_it_can_render_Form_List":0.049,"P\\Tests\\ResourcesTest::__pest_evaluable_it_can_render_Category_List":0.072,"P\\Tests\\ResourcesTest::__pest_evaluable_it_can_render_Collection_List":0.029,"P\\Tests\\ResourcesTest::__pest_evaluable_it_can_test":0.006}}
{"version":"pest_2.33.4","defects":[],"times":{"P\\Tests\\ArchTest::__pest_evaluable_it_will_not_use_debugging_functions":0.187,"P\\Tests\\FormsTest::__pest_evaluable_it_can_list_Form":0.006,"P\\Tests\\FormsTest::__pest_evaluable_it_can_render_Form_List":0.045,"P\\Tests\\FormsTest::__pest_evaluable_it_can_not_edit":0.032,"P\\Tests\\FormsTest::__pest_evaluable_it_can_render_create_form_page":0.085,"P\\Tests\\FormsTest::__pest_evaluable_it_can_create":0.007,"P\\Tests\\FormsTest::__pest_evaluable_it_see_form_when_not_require_login":0.008,"P\\Tests\\FormsTest::__pest_evaluable_it_see_form_when_not_require_login_for_guest":0.008,"P\\Tests\\FormsTest::__pest_evaluable_it_see_form_require_login_for_guest_user":0.009,"P\\Tests\\FormsTest::__pest_evaluable_it_can_retrieve_data":0.049,"P\\Tests\\FormsTest::__pest_evaluable_it_can_render_list_Forms":0.008,"P\\Tests\\FormsTest::__pest_evaluable_it_the_form_can_be_rendered":0.008,"P\\Tests\\FormsTest::__pest_evaluable_it_can_render_show_Form":0.013,"P\\Tests\\FormsTest::__pest_evaluable_it_see_form_require_login_for_logged_in_user":0.008,"P\\Tests\\FormsTest::__pest_evaluable_it_can_save":1.199,"P\\Tests\\FormsTest::__pest_evaluable_it_see_form_date_is_valid":0.01,"P\\Tests\\FormsTest::__pest_evaluable_it_see_ended_form_date":0.027,"P\\Tests\\ResourcesTest::__pest_evaluable_it_can_render_Form_List":0.049,"P\\Tests\\ResourcesTest::__pest_evaluable_it_can_render_Category_List":0.126,"P\\Tests\\ResourcesTest::__pest_evaluable_it_can_render_Collection_List":0.027,"P\\Tests\\ResourcesTest::__pest_evaluable_it_can_test":0.004}}
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
class="rounded-full"
size="lg"
:src="$getRecord->user->avatar"
:alt="($getRecord->user->name) ?? ''"
:alt="($getRecord->user->{config('auth.providers.users.model')::getUserFullNameAttribute()}) ?? ''"
/>
<p class="flex flex-col gap-1">
<span>{{ ($getRecord->user->name) ?? '' }}</span>
<span>{{ ($getRecord->user->{config('auth.providers.users.model')::getUserFullNameAttribute()}) ?? '' }}</span>
<span>{{ ($getRecord->user->email) ?? '' }}</span>
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
class="rounded-full"
size="lg"
:src="$response->user->avatar"
:alt="($response->user->name) ?? ''"
:alt="($response->user->{config('auth.providers.users.model')::getUserFullNameAttribute()}) ?? ''"
/>
<p class="flex flex-col gap-1">
<span>{{ ($response->user->name) ?? '' }}</span>
<span>{{ ($response->user->{config('auth.providers.users.model')::getUserFullNameAttribute()}) ?? '' }}</span>
<span>{{ ($response->user->email) ?? '' }}</span>
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ class ManageResponses extends ManageRelatedRecords

public function table(Table $table): Table
{
$getUserModel = config('auth.providers.users.model')::getUserFullNameAttribute();

$mainColumns = [
ImageColumn::make('user.avatar')
->label(__('Avatar'))
->circular()
->toggleable(),

TextColumn::make('user.name')
TextColumn::make('user.' . $getUserModel)
->label(__('Name'))
->toggleable()
->sortable()
Expand Down

0 comments on commit bb27534

Please sign in to comment.