Looks like I need some help with the Relationships part.For example, more than one address record of a user is kept in the database. I can’t view the address part, I think I have a problem with eloquent, but I’m not sure. Following my code: user Table adress Table UserModel AdressModel UserControl…
Laravel 7 – Edit and update value of checkbox in form
I want to uncheck / check the checkbox for ‘active’ users based on the value set in the form. In MySQL database, I added an ‘active’ column of type ‘tinyint (1)’ in table ‘users’. I have a form to edit different values of the users, like name, email, etc. When…
how to hide results from database until the seacrh is complete in Laravel?
i am making a search for the website so the user can search for results from database everything is working fine but how can i hide results until the user complete the search? this is the controller: and here is the view: so my problem is the view is showing all the results before the user search and i want
Replace icon button with URL image
I would know how to modify the Whatsapp icon button displayed in all pages for start a chat. In my site I have this code for the function in footer.php: The CSS is this: I wanna change the icon (fa fa-whatsapp fa-3x) with an icon that I have upload on my media library (URL image). Furthermore I would hide the
Getting value of clicked element in PHP
I have a page with element <a> acting like a <button>, in this form the elements works like a service plans, and i want to get a value when one of these buttons has been clicked. Page1.php Page2.php I know that $_POST[‘name’] doesn’t works cuz don’t exist a input, but i don…
Mysterious Error AJAX SyntaxError: Unexpected token < in JSON at position 0
I am getting an parse error when I run the AJAX code for autocomplete. The response looks great. But I don’t why the error occurring. Here is the Script and HTML code Here is the controller with the json response I tried with other functions, none of them are working. This is so mysterious, I don’…
Check if array contains a duplicate value in string with PHP
I want to check if my array contains a duplicate value. I have a form where i pass a Chapter ID with the following method: To update my database i pick this input and do the update w/o any issues: A typical var_dump result looks like: array(3) { [0]=> string(1) “1” [1]=> string(2) “12&…
Laravel. CarbonPeriod. All “unical” months between two dates
How to make a period with all months between two random dates? I tried: but it doesn’t include January. I also tried to use floor(): but it includes February that don’t even need. How to get pure “unical” months between two dates using CarbonPeriod? For example: start_date: 2021-11-17 …
How to set input pattern?
Can anyone please help me to set the correct input pattern for : when input starting digit is 2 then length is 17 digits if starts with 3 then length is 16 digits. For example: when input starts with number 2 then it must be: pattern=”d{4} d{4} d{4} d{4} d{1}” But when input starts with number 3 i…
How to disable edit function when database signed=1 in php
if I want to disable the edit when database signed=1, how to change it? Thank you. Answer You need to add the condition if ($row[‘signed’] !=1){ …. } so that the system can allow editing (or not) Hence Change to