return string instead array
hello i have this code want to show student fullName
but i get like this
how to show pnly first_name and last_name value?
thank you
but i get like this
how to show pnly first_name and last_name value?
thank you
[{"first_name":"lskdn","last_name":"laksjd"}]Tables\Columns\TextColumn::make('customer_id')
->label('Customer Name')
->formatStateUsing(function ($record, string $state): string{
switch ($record->customer_type) {
case 'student':
return Student::where('id', $state)->select(['first_name','last_name'])->get();
// dd($data);
breakreturn Student::where('id', $state)->select(['first_name','last_name'])->first()->first_name;