form-field

I have a column in Loans table called loan_agreement_file_path which stores the path of a file. Now what I want is to show the file link of this file in a table list such that when a user clicks on it he/she can download the file.
This is what I have a tried but its not working:
 public static function table(Table $table): Table
    {
        return $table
            ->columns([
 Tables\Columns\TextColumn::make('loan_agreement_file_path')
                    ->formatStateUsing(function (string $state): string {
                        return url("<a href=\"" . asset($state) . "\">Loan Agreement Form</a>");
                    })
                    ->sortable(),

....................................  

Any Ideas?
Was this page helpful?