Hi i'm currently developing a website, and trying to add this feature called booking for others.
If the user want to order 5 tour package, user have to input 4 emails of that user friends, to notify them that they got the tour package by this user. The idea i had is to store the emails in array. When i tried to create the front-end i got error count(): Argument #1 ($value) must be of type Countable|array, null given. How can i store the array value??
where $numbers come from? You need to use wire:model or something else to update variable dynamically. Otherwise send the form first with number input only and display second form with email input based on user entered number.
@AungHtetPaing__ The $numbers actually a collumn in the table, because in the controller there's $email->numbers, so i think by doing the $numbers i think it should work, this is my first time of using array method in laravel
count(): Argument #1 ($value) must be of type Countable|array, null given
You are getting that error because $numbers is null. You didn't send $numbers from controller. Am I right? And you should make email input array. No need to save numbers to table if you loop and save email one by one(5 rows for 5 emails).
@AungHtetPaing__ Yess i didn't put the $numbers in the controller, in the controller i put $email->numbers = $request->numbers because i want it to get the number value first, then it show how many email input it need like in this case