FilamentF
Filament17mo ago
Pathros

For a custom filament page to edit a specific eloquent model, what is the URL of that page?

I haven't found any explanation how to find out the URL of a custom edit page of an Eloquent model.
Is the URL based on the namespace and class name and panel?

<?php

namespace App\Filament\Investigador\Pages\Proyectos;

use ...

class ConfirmarFechas extends Page implements HasForms
{
    use InteractsWithFormActions;

    protected static string $view = 'filament.investigador.pages.proyectos.confirmar-fechas';
    protected static ?string $title = 'Confirmar fechas';

    /** columns*/
    public ?string $fecha_inicio = null;
    public ?string $fecha_termino = null;

    public function mount(Proyecto $proyecto): void
    {
        $this->form->fill($proyecto->toArray());
    }
    public function form(Form $form): Form
    {
        return $form
            ->schema([
                DatePicker::make('fecha_inicio')->label('Fecha de inicio')
                    ->required()
                    ->closeOnDateSelection()
                    ->reactive()
                ,
                DatePicker::make('fecha_termino')->label('Fecha de término')
                    ->required()
                    ->closeOnDateSelection()
                    //Que la fecha mínima sea la elegida en la fecha de inicio: https://discord.com/channels/883083792112300104/1247978059743756329/1247990543187968142
                    ->minDate(function (Get $get) {
                        return $get('fecha_inicio');
                    })
                ,
            ]);
    }

    public function getFormActions(): array
    {
        return [
            Action::make('save')->action(
                function (): void {
                    $this->update();
                }
            ),
        ];
    }

    public function update()
    {
        dd('update the dates here');
    }
}

this is what I got, but I haven't been able to figure out how to view my page by using the URL. The id of the resource I want to test is 2.

How do I find out the URL?
Was this page helpful?