Action::make('follow')
->label('Volgen')
->visible(fn(Series $record) => !auth()->user()->series->contains($record))
->color('info')
->icon('heroicon-o-star')
->action(function (Action $action, ListAllSeries $livewire, Series $record, SeriesService $service) {
$service->follow($record);
$action->success();
$livewire->getTableRecords()->fresh();
Notification::make()
->title("{$record->name} gevolgd")
->icon('heroicon-o-star')
->iconColor('success')
->send();
}),
Action::make('unfollow')
->label('Volgend')
->visible(fn(Series $record) => auth()->user()->series->contains($record))
->color('success')
->icon('heroicon-o-star')
->action(function (Action $action, Series $record, SeriesService $service) {
$service->unfollow($record);
Notification::make()
->title("{$record->name} ontvolgd")
->icon('heroicon-o-star')
->iconColor('primary')
->send();
}),
Action::make('follow')
->label('Volgen')
->visible(fn(Series $record) => !auth()->user()->series->contains($record))
->color('info')
->icon('heroicon-o-star')
->action(function (Action $action, ListAllSeries $livewire, Series $record, SeriesService $service) {
$service->follow($record);
$action->success();
$livewire->getTableRecords()->fresh();
Notification::make()
->title("{$record->name} gevolgd")
->icon('heroicon-o-star')
->iconColor('success')
->send();
}),
Action::make('unfollow')
->label('Volgend')
->visible(fn(Series $record) => auth()->user()->series->contains($record))
->color('success')
->icon('heroicon-o-star')
->action(function (Action $action, Series $record, SeriesService $service) {
$service->unfollow($record);
Notification::make()
->title("{$record->name} ontvolgd")
->icon('heroicon-o-star')
->iconColor('primary')
->send();
}),