Skip to content

Tag: laravel

How validate an array with a dot in key name ? (Laravel)

How can I validate this array in laravel validation: I tried to use this, but it does’t working: How can I solve? I want to note that: I have no choice to change the name “price.value”. Answer As you cannot change the name price.value you have to escape the dot since in Laravel array validat…

Get model with N child items grouped by field

Table looks like this: How to get 3 or less items for each item_id with most likes? So for my example output should looks like this: Answer Since MySQL 8.0 you can use window function row_number Test Mysql window functions Laravel DB query

Store multiple fields in JSON column (Nova CMS)

I have a posts table that has a json column “read_more_section”. And I want to store on that column the information regarding some fields on the NOVA CMS (title, description, label and link). Do you know how to properly do that in Nova? To store what is entered in these 4 fields in the json column…