morty
Make field read-only but also styled as if it was disabled?
Is this possible?
->readOnly()
is what I want functionally but ->disabled()
is what I want visually. If I use ->disabled()
then the field is not submitted with the form, but if I use ->readOnly()
then the field is still focusable and looks active.6 replies
AttachAction select different relationship?
I have two models with a
BelongsToMany
relationship: Account
and AccountCollection
.
I also have an AccountsRelationManager
on an AccountCollectionResource
.
I have a relationship setup on the Account
model called collections()
rather than the Laravel naming convention of accountCollections()
. When I try to attach an account on the relation manager, I get the following error:
Call to undefined method App\Models\Crm\Account::accountCollections()It seems the
AttachAction
is looking for a relationship that doesn't exist. How can I fix this without renaming my relationship? Is there an option on the AttachAction
I can use?3 replies
Storing file size and mime type from uploaded file.
I understand that I should be using the
afterStateUpdated
method, but how can I inject these two properties from the uploaded file into the $data
array? Am I supposed to use a hidden form field or is there a better way?10 replies
Spatie Media Library plugin - How to get it to work inside a ManageRelatedRecords page?
I have the Spatie Media Library plugin installed and working in a normal resource, but if I try to use it in a
ManageRelatedRecords
page, I get SQL errors. Wondering how I can get it to work?
SQLSTATE[23000]: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot insert the value NULL into column 'collection_name', table 'prism_test.dbo.media'; column does not allow nulls. INSERT fails. (Connection: sqlsrv, SQL: insert into [media] ([model_id], [model_type], [uuid], [order_column], [updated_at], [created_at]) values (1026, App\Models\Crm\Account, 16cbffaf-e484-46f2-9f56-41d4b00a9910, 1, 2024-08-21 17:48:24.995, 2024-08-21 17:48:24.995))
30 replies
Is there a more succinct way of retrieving a count of a resource inside a `ManageRelatedRecords`?
I'm trying to add a navigation badge to a record sub navigation item. Inside my
ManageRelatedRecords
page, I'm doing the following:
I'm wondering if there is a way to get the parent record without doing the request()->route()->parameter('record')
search?9 replies
Infolist table repeater or key-value from a relationship?
Hi,
Is there a way to display a list of key-values from a has many relationship in an infolist? If not, is there a way to display a table of this relationship?
For example, If my infolist was about an
Author
model, is there an infolist entry I can use to display a list of all the author's books from a related Book
model?4 replies
SelectFilter unique/distinct relationship value
I have a table of tickets that belong to a location. Some locations are in the same city. How can I use a SelectFilter to get a unique list of cities from the locations table to filter the tickets? This is my code so far:
But this gives me a list of duplicated cities. I tried something like the following but unsuccessfully:
Not sure how to achieve this?
7 replies
Struggling on the simplest thing :( - How do I make a table row clickable to a modal view page?
I have a resource with a modal view page. That works fine. However, I can't seem to figure out how to make the clickable table row open this modal instead of the edit page. Can someone help please?
8 replies
Regression in v3.2.67 - `foreach() argument must be of type array|object, null given`
I really don't want to create a reproduction repo for a GitHub issue. Is anyone else experiencing this when attaching a related record inside a relation manager using a
belongsToMany
relationship?5 replies