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 validation a dot means a nested
Tag: laravel
How to find the desired element in the array and check whether it has a value or not?
I have a big array like this: In this array, I need to find all all *_link keys and check if the value is set, then add all the keys where there is a value to another array Answer I would like to recommend you to read the following docs: https://laravel.com/docs/8.x/collections#available-methods, this may help you to find a multiple ways
Laravel 9 email verification Invalid Signature
I’ve read all available solutions, but no chance. It always redirects to the 403 page with message (Invalid Signature). Here is my route : My env file : But the provided link in log file is always invalid. I’m using built in artisan sever php artisan serve Update : This is the link in laravel.log file. I have tried php
php Keeping only 1 date occurence in multi-dimensional array
I have this array with certain brand_ids, within these brands I have an array of dates in which a sale occured but these are based on the products in sale so they may appear multiple times on the same brand_id; This is my array: The code to generate this : $saleDays is a 2D array of every sunday untill a
update only single element while sharing same class
I have below jquery which shows an image preview from file input. The above code is working well, but the problem is it updates all img elements using the same class screenshot blade ANy suggestion to update only specific img element while using same class ? Answer Just update your readURL function like this: I solved it for you on
Do all API responses need to explicitly be returned with a json function?
I’m getting into api controllers and am wondering if this index function: inside my api controller has to be returned with response()->json() or if it is OK to just return the variable: Both seem to work. Are there reasons to use the former one? Answer the return $data will just convert the $data into a json response. no header will
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
Get empty result api firebase [FCM]
I’ve saved some of my mobile registration_codes that are connected with my development environment of Firebase. Once I send a manual notification by the api I receive empty feedback from Firebase himself. After debugging I found that the notification has not been send. What’s wrong with my call, because the call I make is the same in the examples and
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 “read_more_section”? Answer You could
Laravel Auth successfully logged in but keep redirecting to login page and not showing failed error flash message
I’m trying to authenticate user login with username and password in Laravel 8 (manual auth). I can’t go to next page after logged in and it kept stuck on login page. This is the auth function: My table is users, with the PK is UserId, and then it has Username and Password columns. I have tried to override username() function