Mark Railton
Make row unique on 2 columns
I have a user_reports table that contains a user_id and report_name. I'm creating a select and I want each user to only have 1 entry for a given report, ie they should not have the same report listed twice for the same user.
I'm using a Relation Manager to achieve this, but when I add
->required()
to the field it won't allow me to create a record for a different user, shows a message saying 'The report has already been taken'.
Hoping this makes sense and someone can help with this.4 replies
DatePicker in widget does not appear to honour ->default();
I'm creating some widgets for a dashboard, the first widget is a pair of DatePickers that I'd like to default the 'from' to the start of the year and the 'to' to the end of the year.
When I try using
DatePicker::make('from')->default(now()->startOfYear())
it doesn't actually set the date. I've used the same code in a filter on a table and it works perfectly, but doesn't appear to work on a widget.2 replies
How to introduce a variable to title of a dashboard?
Hi folks, I'm working on the dashboard for an app and it's mostly a load of stats for current year, I'm trying to see if there is any way I can actually insert the year into the title? I've tried using concatenation and string interpolation for the
$title
static property but that just gives errors.
Hoping someone has an idea on this.5 replies
Link to related record in RelationManager list table
I've a Vehicle Resource and Duty Resource, I've created a VehicleRelationManager to link to the Duty Resource. In the table I'm showing basic information, but would like to be able to link directly to the Duty Resource view page from the table in the Vehicle Relation Manager.
Hopefully this makes sense and someone has an idea as to what I can do on this.
3 replies