display create button by condition
hello i want to display create button of header by condition how should i do that?
i tried to customize the function in the image but i got error, i don't know the proper way for saying this.
any help will be usefull
7 Replies
You should use Laravel Policies really once youn have the policy we inherit it naturally.
you are doing $this->id but that's always going to be false isn't it...
What are you trying to do? What condition should create button be shown.
how to say the condition in this function?
i want to show the button when the table is empty and there is no record in it
Is this a relationship manager?
no it's a simple resource. i want user can create new record just when he never create any record
Solution
I would simply just add a query?
oh man how could i miss such a simple thing?!! thanks a lot for your time
No problem.