F
Filament2mo ago
Carlo

How do you disable $table->recordUrl(null) globally in all tables?

I'm trying to disable row click for all of my tables as default, but it seems to not work. Can please anyone correct me. Thanks!
Table::configureUsing(
fn (Table $component) => $component->recordUrl(null)
);
Table::configureUsing(
fn (Table $component) => $component->recordUrl(null)
);
Solution:
I don’t think that configureUsing will work at this point because the ListRecords class sets the recordUrl parameter after configureUsing https://github.com/filamentphp/filament/blob/3.x/packages/panels/src/Resources/Pages/ListRecords.php check makeTable method...
GitHub
filament/packages/panels/src/Resources/Pages/ListRecords.php at 3.x...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
Jump to solution
14 Replies
awcodes
awcodes2mo ago
Try ->recordUrl(false)
Carlo
Carlo2mo ago
Hi @awcodes, still not working for global
awcodes
awcodes2mo ago
Maybe also add ->recordAction(false|null) On my phone at the moment so can’t do a true source dive.
Carlo
Carlo2mo ago
No worries, appreciate your reply 🙂 however, still not working 🥹
awcodes
awcodes2mo ago
RecordUrl(false) should disable. There must be something else causing a conflict in your code base.
Carlo
Carlo2mo ago
It's working for individual tables where I added ->recordUrl(null), but I'm trying to make it as default for all tables to not repeating it in every table. For now I added it in all tables haha 😅
awcodes
awcodes2mo ago
I would expect it to work with configureUsing() too though.
Carlo
Carlo2mo ago
Same here, other setup I made is working, only this recordUrl is not working as expected. I also tried removing other configuration I made for the table to see if it's a conflict, but still no luck.
awcodes
awcodes2mo ago
Can you share the specific table schema that isn’t working?
Carlo
Carlo2mo ago
Sorry, I don't understand, but this is what i added in my AppServiceProvider boot method
<?php

namespace App\Providers;

use Filament\Tables\Table;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
Table::configureUsing(fn (Table $table) => $table->recordUrl(null));
}
}
<?php

namespace App\Providers;

use Filament\Tables\Table;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
Table::configureUsing(fn (Table $table) => $table->recordUrl(null));
}
}
I'm expecting it to disable all table components' row click view / edit
awcodes
awcodes2mo ago
Right, but global configs can be over written at the table level for the resource, that’s why I’m asking for the code of the particular resource table that isn’t working.
Carlo
Carlo2mo ago
Oh sorry, It's not working in all of my resource
Solution
LeandroFerreira
LeandroFerreira2mo ago
I don’t think that configureUsing will work at this point because the ListRecords class sets the recordUrl parameter after configureUsing https://github.com/filamentphp/filament/blob/3.x/packages/panels/src/Resources/Pages/ListRecords.php check makeTable method
GitHub
filament/packages/panels/src/Resources/Pages/ListRecords.php at 3.x...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
Carlo
Carlo2mo ago
I see, make sense. Thank you for pointing this out
Want results from more Discord servers?
Add your server