Skip to content

Laravel Relationships with multiple eloquent

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…

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…

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…