Can we create edit page of resources in a widgets
i wan to create a widgets for a edit resource page in form format but it is not show the form in view
code is
<?php
namespace App\Filament\Resources\CoachingResource\Widgets;
use App\Filament\Resources\CoachingResource;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Widgets\Widget;
use Illuminate\Database\Eloquent\Model;
class CoachingEditForm extends Widget
{
protected static string $view = 'filament.resources.coaching-resource.widgets.coaching-edit-form';
public ?Model $record = null;
protected $form;
protected static string $resource = CoachingResource::class;
protected function getForms() : array
{
$this->form = $this->makeForm()
->context('edit')
->model($this->getRecord());
return [
'form' => $this->form
->schema([
TextInput::make('partnership_name')
->maxLength(255),
Select::make('service_id')
->relationship('services', 'service_name')->label('Partnership Level')->placeholder('Partnership Level'),
Select::make('coach_id')
->relationship('users', 'name')->disabled(),
Select::make('status')
->options(['Paid' => 'Paid', 'Partial Paid' => 'Partial Paid', 'Unpaid' => 'Unpaid', 'Overdue' => 'Overdue', 'Expired' => 'Expired'])->label('Status')->disabled(),
])->extraAttributes([
"class" => "primary-contact-details"
])
->columns(4),
Section::make('Partership Details')
->schema([
Select::make('mfm_contact_id')
->relationship('contacts', 'name')
->multiple()
->columns(2),
0 Replies