F
Filament5mo ago
o.m

Is it possible to pass data to View::make() ?

I have a page that I can render but I need to pass data to be able to dynamically render some fields
7 Replies
Alex-Elivate
Alex-Elivate5mo ago
What am I missing here? return View:make('some.view', ['varName' => $data]); Either I don't understand the question or I'm being pranked. I swear I'm not trying to be rude. could you elaborate? https://laravel.com/docs/12.x/views
Views - Laravel 12.x - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
o.m
o.mOP5mo ago
This only accepts string from what I saw,
No description
o.m
o.mOP5mo ago
Anyway the public property I declared public $notification; Is directly accessible on the view component so there was no need to pass the data
Alex-Elivate
Alex-Elivate5mo ago
Ah! I see where I missunderstood now! I thought you were talking about View::make(), from the title. Section::make you pass in the the data with ->schema(). If you want to transform it, use closures (->formatStateUsing). https://filamentphp.com/docs/3.x/forms/layout/section. Also check this out: https://filamentphp.com/docs/3.x/infolists/advanced#passing-parameters-to-a-livewire-component
Patrick Boivin
Patrick Boivin5mo ago
Maybe ->viewData()
o.m
o.mOP5mo ago
ViewData was okay but i remember it gave me error

Did you find this page helpful?