How to Create a Custom Page with a Modal in Filament 3 for Laravel 10?

I am migrating the back office of a project developed using classic Laravel 10 to Filament 3.

I have understood the CRUD system in Filament 3, and the documentation is quite clear. However, I have a page in my back office with a complex table that calls multiple models. This table is supposed to display the menus of an establishment over 7 days. For each day, there are 3 meals, and for each meal, there are several recipes/dishes with the number of servings.

It doesn’t seem possible to use the standard Filament functions because it’s not really a classic CRUD. Therefore, I decided to create a custom page, which seems to be the best solution since the page needs to call multiple models and has a very specific design with various manipulations (moving a menu from one day to another by drag-and-drop, moving a menu item similarly, adding guests, etc.).

My current problem is that I cannot create a modal that displays the content of a specific model. Here, it’s about $recettemenu.

Another question: Is this the right direction to create a complex page?

Here’s my setup:

I created my page, and I have the app/Filament/Pages/Menu.php file with the following content:

namespace AppFilamentPages;

use CarbonCarbon;
use CarbonCarbonPeriod;
use AppModelsRecette;
use AppModelsRecettesMenu;
use FilamentActionsAction;
use FilamentFormsComponentsTextInput;
use FilamentPagesPage;
use IlluminateHttpRequest;

class Menu extends Page
{
    protected static ?string $navigationIcon = 'heroicon-o-document-text';
    protected static string $view = 'filament.pages.menu';

    public $debutsemaine;
    public $finsemaine;
    public $dates = [];
    public $recettes = [];
    public $matinmidisoir;
    public $entreeplatdessert;
    public $allrecette = [];
    public $recette;

    public function mount(Request $request)
    {
        $next = $request->input('next');
        $last = $request->input('last');
        $datedebut = $request->input('datedebut');

        if (isset($next)) {
            $this->debutsemaine = Carbon::parse($next)->nextWeekday()->format('d-M-y');
            $this->finsemaine = Carbon::parse($this->debutsemaine)->nextWeekday()->endOfWeek()->format('d-M-y');
        } elseif (isset($last)) {
            $this->debutsemaine = Carbon::parse($last)->previous(Carbon::MONDAY)->format('d-M-y');
            $this->finsemaine = Carbon::parse($this->debutsemaine)->endOfWeek()->format('d-M-y');
        } elseif (isset($datedebut)) {
            $this->debutsemaine = Carbon::parse($datedebut)->format('d-M-y');
            $this->finsemaine = Carbon::parse($this->debutsemaine)->endOfWeek()->format('d-M-y');
        } else {
            $this->debutsemaine = Carbon::now()->startOfWeek()->format('d-M-y');
            $this->finsemaine = Carbon::now()->endOfWeek()->format('d-M-y');
        }

        $period = new CarbonPeriod(Carbon::parse($this->debutsemaine), 7);
        foreach ($period as $date) {
            $this->dates[] = $date->format('Y-m-d');
        }

        $this->recettes = Recette::all()->pluck('nomrecette', 'id')->prepend(trans('global.pleaseSelect'), '')->toArray();
        $this->matinmidisoir = ['Midi', 'Gouter', 'Soir'];
        $this->entreeplatdessert = ['Entree' => 'Entree', 'Plat' => 'Plat', 'Dessert' => 'Dessert'];

        $this->allrecette = RecettesMenu::with('recette')
            ->whereDate('date', '>=', Carbon::parse($this->debutsemaine))
            ->whereDate('date', '<=', Carbon::parse($this->finsemaine))
            ->get()
            ->toArray();
    }

    public function showmenuAction($recetteId = null): Action
    {
        return Action::make('showmenu')
            ->label('Voir le menu')
            ->modalHeading('Détails du Menu')
            ->modalContent(function () use ($recetteId) {
                $this->recette = Recette::where('id', $recetteId)->first();
                $recette = $this->recette; // Ensure the variable is defined correctly
                return view('filament.pages.modal-menu', compact('recette'));
            })
            ->form([
                TextInput::make('recetteId')
                    ->label('ID de la recette')
                    ->default($recetteId)
                    ->hidden(),
            ]);
    }
}

And on the other side, I have my Blade file in resources/views/filament/pages/menu.blade.php where I have a loop like this:

@foreach ($allrecette as $recettemenu)
    @if ($recettemenu['perioderepas'] == $period && $recettemenu['entreeplatdessert'] == $entreeplatdessertd2 && CarbonCarbon::parse($recettemenu['date'])->isSameDay(CarbonCarbon::parse($date)))
        <div class="">
            <a href="#" class="text-blue-600 hover:underline">
                {{ $recettemenu['recette']['nomrecette'] }}
            </a>
            {{ ($this->showmenuAction)(['recetteId' => '46']) }}

            <span id="prixrecette_{{ $recettemenu['id'] }}" class="{{ $period }}_{{ CarbonCarbon::parse($date)->format('d-m-Y') }}">{{ $recettemenu['prixrecette'] }}€</span>
            <input type="text" id="nbpersonnerecette_{{ $recettemenu['id'] }}" name="nbpersonnerepas" class="align-middle border rounded w-1/6 h-3 p-1.5 text-[12px]" value="{{ $recettemenu['nbpersonne'] }}">
        </div>
    @endif
@endforeach

How can I correctly create a modal that displays the content of a specific model (in this case, $recettemenu)?
Is creating a custom page the right approach for building a complex page with various models and specific design requirements?
Any help or guidance would be greatly appreciated! Thank you.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật