Askancy
Filter in the table but with different model
On a page referencing a table in the "Giochi" model, I would need to insert a filter but referencing the "InfoGiochi" table, which would be a pivot table.
The "Giochi" table contains the name of the game, while "InfoGiochi" contains other data such as the date. I would need to get the contents where the "data" column is empty.
I have tried unsuccessfully with:
But I don't understand how to connect to a model other than Games...
4 replies
Options for the RichEditor
How can I make the RichEditor menu scroll along with the page when the editor gets too big?
How do I determine a max size of the Rich Editor?
I could not find anything in the documentation that would allow these values to be changed....
4 replies
How can I manipulate the response of a post create
Currently my slug system is generated via:
so if the item name is:
Filamentphp is a package
the slug becomes: filamentphp-is-a-package
What I would like though, is that in the output it sends to the database, he would add the article id and the extension .html so I would like to become: 1574-filamentphp-is-a-package.html
How can I manipulate the response of a post create?8 replies
Admin pages don't appear
I put my project online with Filamentphp, however the resource pages in Admin do not appear,even though I have the files loaded correctly in \App\Filament\Resources, Am I forgetting something?
Only installed plugins appear in the menu.
2 replies
error after HasName statement
I need to indicate a different hasname, I followed the guide and in my User.php model I have:
But I get the error:
Class App\Models\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Filament\Models\Contracts\FilamentUser::canAccessPanel)
I get the error even if I only put FilamentUser, if I use HasName alone, I don't get the error
3 replies
Create select with pivot relationship
I need to insert a Select with single selta in my project.
The main model of the project is "Game", The select takes data from the Franchise_pivot table in which it has:
-franchise_id
-gioco_id
And where it parses franchise_id (to return the name) in Franchise which is structured:
-id
-name
How can I implement this select?
Currently I have done:
Model "Game"
But the result is that I have the game id in the select, and not the franchise name
23 replies
Using custom function in a form
I have a page where I have a form textarea, in the textarea I have all the ids divided by comma example: qIcTM8WXFjk,8X2kIfS6fb8
These ids are processed through a function of mine:
How can I tell Filamentphp to use this function to post data? Also, how do I add a button next to "New Video" in the header? In the documentation I find only references to how to add buttons in tables
9 replies
Repeater::simple does not exist
I am using a repeater with the simple method, but I get this error:
>Method Filament\Forms\Components\Repeater::simple does not exist.
I also take this opportunity to ask, I currently have data within a saved sql column, each element is separated by |:
How should I convert it to fit filamentphp? I need to create an example pivot column:
could it work? In the case, how do I "populate" the textinputs?
8 replies
Get image from S3 without full path in sql column
I am adapting a pre-existing custom admin to filamentphp, now I have images on an S3 structured like this:
cdn.blabla.ext/namesite/gallery/{{$game_id}}/{{$image}}
With the old admin I used:
To visualize it I would simply use:
But how does it work with filament?
In the documentation I read:
>The column in the database must contain the path to the image, relative to the root directory of its storage disk.
Currently in the database I saved ONLY the name of the image, if I understand correctly I in the database should save:
image = namesite/gallery/123/nameimage.png
can I bypass this?
5 replies
Multiple Select with BelongsToMany relationship
I'm just recently using Filamentphp and need to get into the mindset of how it works.
I have two sql tables:
Article
Article_pivot_games
In article_pivot_games I have the columns:
- id
-article_id
-games_id
now I need a multiple select, where he fills in the select with the names of the games that have the article_id equal to the id of the article I am editing.
in the model Article.php
However, how do I tell the select to use that function? Also am I using the right method?
Before filamentphp I used a custom admin of my own, in which I had a column in Article with the id_games column containing "1,6,123,532," and I used this:
9 replies
Set text on the badge according to the value
I have this badge that takes from id_topic the topic number on the forum where comments are open.
If id_topic is 0 then comments are closed, if it contains an id above 0 then comments are open.
I have tried this, but inside the badge it always returns me the id of id_topic and not the words "open" or "close"
10 replies