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
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.
not sure, but are you talking about a "CUSTOM PAGE"? https://filamentphp.com/docs/3.x/panels/resources/custom-pages#using-a-resource-record
This only accepts string from what I saw,

Anyway the public property I declared
public $notification;
Is directly accessible on the view component so there was no need to pass the dataAh! 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
Maybe
->viewData()
ViewData was okay but i remember it gave me error