Venky
Venky
FFilament
Created by Venky on 10/26/2024 in #❓┊help
Table reload in custom livewire tab by updating in another tab table record.
@Jakub Let me try and give you the full code earliest. Thank you for your prompt response
12 replies
FFilament
Created by Venky on 10/26/2024 in #❓┊help
Table reload in custom livewire tab by updating in another tab table record.
Thank in advance for your help
12 replies
FFilament
Created by Venky on 10/26/2024 in #❓┊help
Table reload in custom livewire tab by updating in another tab table record.
@Jakub I took this logic from your post only. Can you please help me in this. I just wants to reload the table in one tab by update record in another tab table.
12 replies
FFilament
Created by Venky on 10/26/2024 in #❓┊help
Table reload in custom livewire tab by updating in another tab table record.
Active Listing Table:
<?php

namespace App\Livewire;


class ActiveListingTable extends Component implements HasForms, HasTable
{
use InteractsWithForms;
use InteractsWithTable;

protected $listeners = ['refreshActiveTable' => '$refresh'];

public static function table(Table $table): Table
{
return $table
->recordUrl(
fn (Model $record): string => route('listings.view', ['record' => $record]),
)
->query(Listing::query()->where('published', 1)->where('user_id', request()->user()->id))
->columns([
ImageColumn::make('image_column')
->disk(config('filesystems.default', 'local'))
->default(function ($record) {
$result = 'DOMUS-LOGO.png';
$media = $record->medias->first();
if (! is_null($media)) {
$result = $media->path;
}

return $result;
})
->width(100)
->height('auto'),
...
])
->recordUrl(fn (Listing $record): string => ListingViewResource::getUrl('view', ['record' => $record->hashid]))
->filters([
// Tables\Filters\TrashedFilter::make(),
SelectFilter::make('published')->options([0 => 'Draft', 1 => 'Published']),
])
->actions([
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([

]),
]);
}

public function render()
{
return view('livewire.active-listing-table');
}
}
<?php

namespace App\Livewire;


class ActiveListingTable extends Component implements HasForms, HasTable
{
use InteractsWithForms;
use InteractsWithTable;

protected $listeners = ['refreshActiveTable' => '$refresh'];

public static function table(Table $table): Table
{
return $table
->recordUrl(
fn (Model $record): string => route('listings.view', ['record' => $record]),
)
->query(Listing::query()->where('published', 1)->where('user_id', request()->user()->id))
->columns([
ImageColumn::make('image_column')
->disk(config('filesystems.default', 'local'))
->default(function ($record) {
$result = 'DOMUS-LOGO.png';
$media = $record->medias->first();
if (! is_null($media)) {
$result = $media->path;
}

return $result;
})
->width(100)
->height('auto'),
...
])
->recordUrl(fn (Listing $record): string => ListingViewResource::getUrl('view', ['record' => $record->hashid]))
->filters([
// Tables\Filters\TrashedFilter::make(),
SelectFilter::make('published')->options([0 => 'Draft', 1 => 'Published']),
])
->actions([
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([

]),
]);
}

public function render()
{
return view('livewire.active-listing-table');
}
}
12 replies
FFilament
Created by Venky on 10/26/2024 in #❓┊help
Table reload in custom livewire tab by updating in another tab table record.
DraftListingTable:
class DraftListingTable extends Component implements HasForms, HasTable
{use InteractsWithForms;
use InteractsWithTable;
protected $listeners = ['refreshDraftTable' => '$refresh'];
public static function table(Table $table): Table
{return $table
->query(Listing::query()->where('published', 0)->where('user_id', request()->user()->id))
->columns([ImageColumn::make('image_column')
->disk(config('filesystems.default', 'local'))
->default(function ($record) {
$result = 'DOMUS-LOGO.png';
$media = $record->medias->first();
if (! is_null($media)) {
$result = $media->path;
}
return $result;
}),
...
])
->recordUrl(fn (Listing $record): string => ListingViewResource::getUrl('view', ['record' => $record->hashid]))
->filters([
// Tables\Filters\TrashedFilter::make(),
])
->actions([
Tables\Actions\Action::make('Publish')
->form([
TextInput::make('confirm_text')
->required()
->hint('To confirm, please type \'Publish\' in the box below and click the Confirm Publication button.'),
])
->action(function ($record, $data, $livewire) {
//logic
})
->modalSubmitActionLabel('Confirm Publication'),

])
->headerActions([

CreateAction::make('create')
->url(fn (): string => route('filament.seller.resources.listings.create')),
// Tables\Actions\CreateAction::make()
// ->mutateFormDataUsing(fn (array $data): array => Listing::mutateFormDataBeforeCreate($data))
// ->visible(url()->current() != ListingResource::getUrl('listing')),
])
}

public function render()
{
return view('livewire.draft-listing-table');
}
}
class DraftListingTable extends Component implements HasForms, HasTable
{use InteractsWithForms;
use InteractsWithTable;
protected $listeners = ['refreshDraftTable' => '$refresh'];
public static function table(Table $table): Table
{return $table
->query(Listing::query()->where('published', 0)->where('user_id', request()->user()->id))
->columns([ImageColumn::make('image_column')
->disk(config('filesystems.default', 'local'))
->default(function ($record) {
$result = 'DOMUS-LOGO.png';
$media = $record->medias->first();
if (! is_null($media)) {
$result = $media->path;
}
return $result;
}),
...
])
->recordUrl(fn (Listing $record): string => ListingViewResource::getUrl('view', ['record' => $record->hashid]))
->filters([
// Tables\Filters\TrashedFilter::make(),
])
->actions([
Tables\Actions\Action::make('Publish')
->form([
TextInput::make('confirm_text')
->required()
->hint('To confirm, please type \'Publish\' in the box below and click the Confirm Publication button.'),
])
->action(function ($record, $data, $livewire) {
//logic
})
->modalSubmitActionLabel('Confirm Publication'),

])
->headerActions([

CreateAction::make('create')
->url(fn (): string => route('filament.seller.resources.listings.create')),
// Tables\Actions\CreateAction::make()
// ->mutateFormDataUsing(fn (array $data): array => Listing::mutateFormDataBeforeCreate($data))
// ->visible(url()->current() != ListingResource::getUrl('listing')),
])
}

public function render()
{
return view('livewire.draft-listing-table');
}
}
12 replies
FFilament
Created by Venky on 9/5/2024 in #❓┊help
How to enable search in custom options
It works perfectly. I hope the ->default() will render the same html. Let me try. Please mention here if we have any other approach. Thanks again for your support
7 replies
FFilament
Created by Venky on 9/5/2024 in #❓┊help
How to enable search in custom options
@Dennis Koch Thanks a lot. Let me try
7 replies
FFilament
Created by Venky on 9/5/2024 in #❓┊help
How to enable search in custom options
Yes, I modified it.
7 replies
FFilament
Created by Hemanath on 10/6/2023 in #❓┊help
Select::make using resources
@Vp I am also facing this issue. Assume that we have another few more fields before this country field and I am filling and moving from 1 field to another by 'Tab'. Once, I landed in this field using 'Tab' I am trying to see the option using Alt + down arrow. It is not working properly while accessing it through keyboard. Are we missing anything here? I hope this is happening in filament demo also. Please provide an example of workaround if any.
5 replies
FFilament
Created by Venky on 8/9/2023 in #❓┊help
Converting collection to Builder is not giving data.
Thank you. Let me check.
7 replies
FFilament
Created by Venky on 8/9/2023 in #❓┊help
Converting collection to Builder is not giving data.
@pboivin Thank you for your response. Let me try. It will be great if you can help me by giving sample code or any reference . Thanks again. Actually, I am planning to create one more table (outstanding) to calculate the current outstanding whenever creating invoice record and receipt record. So that I can create 'closing_balance' field in both invoice and receipt table to update the calculated value on each creation. Please suggest me if we have any better idea.
7 replies
FFilament
Created by Venky on 8/9/2023 in #❓┊help
Converting collection to Builder is not giving data.
Hi all, Can anyone guide me here to come out this situation? Thanks in advance.
7 replies
FFilament
Created by Venky on 7/17/2023 in #❓┊help
filament-sidebar-item-active class is not there in custom pages
Thanks for your response
4 replies
FFilament
Created by Venky on 5/30/2023 in #❓┊help
$record is null in selectColumn
This is working now after optimize clear. 🤔
3 replies
FFilament
Created by Venky on 5/30/2023 in #❓┊help
$record is null in selectColumn
Is there any other way to access current record
3 replies
FFilament
Created by Venky on 5/5/2023 in #❓┊help
dule.esm.js:419 Alpine Expression Error: Cannot read properties of null (reading 'includes')
Yes, it works now. Thanks a lot.
10 replies
FFilament
Created by Venky on 5/5/2023 in #❓┊help
dule.esm.js:419 Alpine Expression Error: Cannot read properties of null (reading 'includes')
Oho, Can I revert back?
10 replies
FFilament
Created by Venky on 5/5/2023 in #❓┊help
dule.esm.js:419 Alpine Expression Error: Cannot read properties of null (reading 'includes')
yes
10 replies
FFilament
Created by Venky on 5/5/2023 in #❓┊help
dule.esm.js:419 Alpine Expression Error: Cannot read properties of null (reading 'includes')
I didn't touch any filament resources. Can you mention any specific folder or file?
10 replies
FFilament
Created by Venky on 5/5/2023 in #❓┊help
dule.esm.js:419 Alpine Expression Error: Cannot read properties of null (reading 'includes')
First one is Edge and the second one is Chrome
10 replies