ViewParameter not beeing parsed in Action::make (Solved: Dev-Error!)
Hey folks - I ain't sure if this is a bug or if I am not seeing something (again).
Given I got the following blade-view:
https://gist.github.com/Husky110/c80783ec21915de92e9f36ff6c017369
(Note - I'm using flowbite)
And given I have the following function on my page:
I should have a top-drawer that echos
$viewToRender
-> instead I'm getting Undefined variable $viewToRender
. Interestingly enough - $documentationHeadline
is beeing parsed just fine and if I remove $viewToRender
from my blade-file, it works just fine. If there is a typo - I don't see it. Can someone please investigate this - if there might be a general problem?Gist
documentation-drawer
documentation-drawer. GitHub Gist: instantly share code, notes, and snippets.
32 Replies
P.S.: When I include the view through another blade-view like
@include('components.my-components.general.documentation-drawer', ['documentationHeadline' => 'MEEPERS', 'viewToRender' => 'PIEP'])
it works fine. That leads me to believe that there might be a bug...
@Dan Harrin - can you take a look at this please? 🙂I copied your code into my app and it worked first try without any modifications
please check you're looking at the correct page, check your view cache, etc
check the domain of the app you're looking at
esp since $documentationHeadline is working for you, there must be something simple wrong
Okay - good news: After clearing the cache the error seems to have gone. Now to the bad news - the page itself does not show any button... in fact: the action itself is not even beeing rendered. (I made sure I'm on the right page.) This is the page-code:
Pretty sure I'm missing a $this->actions or somewhat...
it didnt show any button for me either
so it could just be a problem with your view
you dont need to include actions anywhere, thats what <x-filament::page> does
but that would have thrown an error...
(I guess)
check the html that is being rendered
And I made sure that I'm on the right page, by editing a section-headline which had been changed.
I did already - there should be the data-drawer-target="documentation-drawer" somewhere, but it isn't.
what is in the place of where the actions should be?
Nothing appearently... o.O
remove ->view(), does it render?
Nope
im not sure then. sorry
I am - I'm using
getHeader()
to render a view with a sub-headline.thats the problem
And that seems to overwrite the actions - can I implement them in there somehow?
it replaces the entire header inc actions
figured... is there a $this->actions or somewhat I could call inside the header-view?
<x-filament::pages.actions :actions="$this->getCachedActions()" />
god damned - I took the complete wrong approach... had to use
getSubheading
for what I wanted and now the actions work again. even the component is working now.
Please upgrade the docs for knuckle-heads like me... It would be really great to have some overview of the functions I can call within a page and their effects. Right now that has to be done by "reading code" inside my IDE. And while the current docs are great to get the ropes of filament when you start a new, they are a bit blurry for someone that is transitioning (or trying to upgrade). Like for example the getSubheading
-function. That thing is not even documented (well - at least when you search for it...). I don't wanna know how many of my "help"-threads were viewed like "how daft is this dude?" where in the end I just had no idea where to look for what I needed.here's it fixed for v3 - https://github.com/filamentphp/filament/blob/3.x/packages/panels/docs/04-pages.md#adding-a-page-subheading
GitHub
filament/packages/panels/docs/04-pages.md at 3.x · filamentphp/fila...
Admin panel, form builder and table builder for Laravel. Built with the TALL stack. Designed for humans. - filament/packages/panels/docs/04-pages.md at 3.x · filamentphp/filament
i have done my best to fill the gaps in v3, but theres never gonna be a situation where every single method is documented because there are so many, using your IDE is kinda part of the job with Filament to explore how to customize things
but i do understand
Maybe I can suggest something here! Plain old PHP-Docs! I used something called phpDocumentor (see https://www.phpdoc.org/ ) before. That thing just extracts your PHP-Docs from your code and creates a simple function-based documentation. Maybe adding this as a separate addition to the main-docs would be an idea. 🙂
Home
Documentation Generator for PHP
yeah I think Laravel does that too
personally I dont see the benefit over using your IDE though, as your IDE also shows you your implementation etc?
yes and no. I am using PHPStorm and whilst that is considered to be a great IDE, as soon as your project gets too abstract, it will basically crumble right in front of you with loadingtimes up to 5 Minutes for autocompletion. (loads of lambda- and anonymous-functions have that effect) so my IDE is sort of a friend, but not one that can be counted on.
and while it can be considered that I am running it on a Steam Deck, I ran it on a HP-Omen-Laptop (from 2018) with an Intel i7-8750H with the same effect.
So you will always get that level of issue with standard PC's indexing tens of thousands of files.
I use phpStorm on a mac M1 and an M2 and it never slows down one bit. I usually have 4 projects open and indexed at anyone time.
What drives me nuts is that the issue itself is known to JetBrains but they just can't or won't solve it. But I don't wanna pour crap over them, since in general their products are great.
In general I think that Filament would profit from enhancing the docs on that part.
I don't think it's that they won't they have made massive improvements. But it's a tricky scenario, you are reading tens of thousands of files, and windows is naturally very slow at doing that.
Have you increases your memory allocation?
I'm running on Linux and yes. 🙂
Ohh I never really got slow downs there, how stange!
And tens of thousand files... Well... 😅 More like houndreds of thousands... (almost 270k in my case) 😅 - What dies down mostly is the code-completion, since it seems to try to run up the path to the source and indexing seems to help not much there.
I was being reserved haha.... yeah, maybe submit another bug report. But I doubt they have a big team on the linux side.
shouldn't be a problem, since we're talking about java...