JC
Explore posts from servers$livewire->form->fill() doesn't work when using slideOver()
I've been following Kevin McKee's excellent "Rapid Laravel Apps with Filament" Laracast but run into an issue when trying to use a factory to fill a form (for testing purposes).
When my resource ("Campaign") has a dedicated CreateCampaign route/page, I'm able to add an action to the form as follows:
and this works great. However, I'd prefer to use the slideOver() so I comment out
'create' => Pages\CreateCampaign::route('/create'),
in the getPages()
function of the campaign resource and add ->slideOver()
to the getHeaderActions
of the ListCampaigns
file (no other changes made).
I then get the following error:
Filament\Resources\Pages\ListRecords::form(): Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given, called in /Users/joe/Projects/test_system/vendor/filament/infolists/src/Concerns/InteractsWithInfolists.php on line 56It looks like, when using a slideOver, $livewire is the ListCampaign component rather than the CreateCampaign page so the form is not accessible through $livewire->form. I'm sure there is an easy workaround but I'm pretty new to all this. Thanks 🙂
42 replies
:class not reactive when using SSR
This is my first SSR app so apologies for naivety.
I'm using middleware to trigger an authentication check, which sets a value (
currentUser
) if a user is authenticated and uses this to set a class. I'm able to access this in the template:
If I dump the value out into the template, I can see that after a few milliseconds the value is the-header--logged-in
, as expected. However, there is no class on the header component.
The same thing happens if I try the class binding format:
<header class="the-header" :class="{ 'the-header--logged-in': currentUser }">
It's as if the act of binding it as a class is causing it to lose reactivity. Can anyone offer any advice please?3 replies
Trying to deploy to CF pages and getting ` [nuxt] instance unavailable`
As above. The app is non-trivial but it doesn't give any logs as to what is generating the error. I thought that having:
nitro: {
preset: 'cloudflare_pages',
},
and then running
npx wrangler pages dev dist
would cause it to run identically to how it is on Cloudflare, but it doesn't seem to be the case as it works locally. Have removed all instances of useRuntimeConfig (but made no difference) but a bit stumped as to what to try next as, without any logging, it feels like a needle in a haystack!1 replies