Use value of another column in the same row in a custom table

I'm having difficulty having 2 tables, the first is supposed to retrieve whether the column "exit_date" has value or not, I can't use "exit_date" twice, it's one or the other The second I'm supposed to substract two dates (exit_date and enter_date) and obtain the remaining result.
return $table
->columns([
Tables\Columns\TextColumn::make('memo_number')->label("Numero de Memo"),
Tables\Columns\TextColumn::make('department.NombreDepartamento')->label("Departamento"),
Tables\Columns\TextColumn::make('address')->label("Dirección"),
Tables\Columns\TextColumn::make('sector')->label("Sector"),
Tables\Columns\TextColumn::make('enter_date')->label("Fecha de Inicio"),
Tables\Columns\TextColumn::make('exit_date')->label("Fecha de Fin"),


/* Tables\Columns\TextColumn::make('is_complete')->label("Completado")->description(function (request $record) {
return $record["exit_date"];
}),*/
Tables\Columns\TextColumn::make('is_complete')->label("Completado"),
Tables\Columns\TextColumn::make('reply_time')->label("Tiempo de respuesta"),




])
return $table
->columns([
Tables\Columns\TextColumn::make('memo_number')->label("Numero de Memo"),
Tables\Columns\TextColumn::make('department.NombreDepartamento')->label("Departamento"),
Tables\Columns\TextColumn::make('address')->label("Dirección"),
Tables\Columns\TextColumn::make('sector')->label("Sector"),
Tables\Columns\TextColumn::make('enter_date')->label("Fecha de Inicio"),
Tables\Columns\TextColumn::make('exit_date')->label("Fecha de Fin"),


/* Tables\Columns\TextColumn::make('is_complete')->label("Completado")->description(function (request $record) {
return $record["exit_date"];
}),*/
Tables\Columns\TextColumn::make('is_complete')->label("Completado"),
Tables\Columns\TextColumn::make('reply_time')->label("Tiempo de respuesta"),




])
3 Replies
Want results from more Discord servers?
Add your server