<?php
namespace App\Actions\Filament\Forms;
use App\Models\Property;
use Filament\Forms\Components\Actions\Action;
use Illuminate\Contracts\View\View;
class ViewPropertyAction extends Action
{
protected function setUp(): void
{
$this
->label('View')
->modalContent(fn (Property $record): View => view(
'forms.property',
['record' => $record],
))
->extraModalFooterActions([
\Filament\Tables\Actions\Action::make('edit')
->label('Edit Property')
->url(function ($record) {
//return route('properties.edit', $this->modalRecord ? $this->modalRecord->id : $record->id);
return route('properties.edit', $record->id);
})
->color('primary')
->button(),
]);
}
}
<?php
namespace App\Actions\Filament\Forms;
use App\Models\Property;
use Filament\Forms\Components\Actions\Action;
use Illuminate\Contracts\View\View;
class ViewPropertyAction extends Action
{
protected function setUp(): void
{
$this
->label('View')
->modalContent(fn (Property $record): View => view(
'forms.property',
['record' => $record],
))
->extraModalFooterActions([
\Filament\Tables\Actions\Action::make('edit')
->label('Edit Property')
->url(function ($record) {
//return route('properties.edit', $this->modalRecord ? $this->modalRecord->id : $record->id);
return route('properties.edit', $record->id);
})
->color('primary')
->button(),
]);
}
}