I have the following Laravel Eloquent Mutator When calling $object->used_working_time i get the value stored in the database as expected. When using Variable variables $object->{‘used_’.$name} with $name = ‘working_time’ the $db value is null. Is there a way to get the database a…
Tag: php
How to string two variables together in php
I am new to php. And string concatenation is difficult for me. I want to concatenate the following string: But the string I want: Thanks. Answer Try this(Added single quote to the string): Another solution(Wrap the single quotes in double quotes to branch variable): OUTPUT:
Laravel how to properly pass data to href
sorry if the question is kind of newbie. I am new to php and laravel, still trying to learn through tutorial. I am trying to pass the ‘No’ in my database to the url, so that the url when I clicked on Daftar, it will show http://127.0.0.1:8000/search/{No} Webpage designed I did try to put it this w…
Laravel: getting blade components syntax error, unexpected ‘endif’ (T_ENDIF), expecting end of file
I am learning laravel on Laracast however I am having some issues I have this code on file components/layout.blade.php And this on main.blade.php which is the page the view redirects to For some reason Laravel is returning this error: Answer I found what was causing the problem, I had a space between content …
“php bin/console server:run” immediately followed by “composer require symfony/mailer” whenever it is run
I’m working on a Symfony project and would like to know why whenever I run the following command in terminal php bin/console server:run it would be immediately followed by this one composer require symfony/mailer. This is a screenshot of terminal: Moreover, this is what I get as an output on http://127.…
Display out of stock products on specific category – Woocommerce
I use the woocommerce / inventory menu settings to hide all of the “out of stock” products from category listings. But there are some products them i want to display in certain categorys even is the stock is 0. Is there a function that can override the upper “main switch” in certain ca…
Laravel Views – Possible caching issue
I’m trying to test a laravel upgrade on our production server. I created a new vhost and copied the entire directory over of the original laravel app to the new vhost root. So I have app.mydomain.com with the original (laravel 5.8 app) and l6.mydomain.com with the copied version. My issue is that if I m…
Disable some warnings in Eclipse
I just installed Eclipse (Eclipse IDE for PHP Developers) and I’m currently testing it. Seems great on many aspects, BUT… … I get some warnings I’d like to get rid of, because they have no incidence and just tend to “hide” more useful warning hints. Some variables/class ins…
Image Blob not adding to the mySQL Database
So I tried so many times and tried changing things and still not working, It still add and throw null here’s the code of the HTML, PHP and also JS (just incase needed). I already tried to do some of the methods on github and stack overflow and still doesn’t work. I hope someone can help me with th…
avoid same numbers and zero in array
I have a form with that table: jsfiddle In this form i need to enable to edit the number fields. After submit i collect the data and write to mysql. Before mysql insert i want to check that the $number array does not contain the same numbers and zero (like: 0,1,1,101,150). If yes give an error to the user tha…