Skip to content

Adding day/incrementing with a carbon formatted date

I’m using carbon to get today’s date and format it in a laravel blade template, which is not a problem at all, but when it comes to incrementing I’m having an issue I’m currently testing with just adding a single day, but I want to actually create table headers for today and the next 7…

How to call PHP script from Mulesoft?

I am in process creating resource/api in Mulesoft and this need to run some PHP script. If I use engine as “php” am getting below error – “Scripting engine ‘php’ not found. Available engines are: Oracle Nashorn” So, how to enable php engine? Answer PHP is not a valid …

While loop on multi-dimensional array

So I have a function that currently has a foreach and it works amazing, but I’m being forced to change it to a while loop: PLEASE NOTE: The developers at my company don’t want to use the foreach and they think that a while loop would be more efficient, but I’m not understanding how that woul…

How to get class from a constant array?

I have about twenty different classes that are segregated in an assoc array similar to this: But now I want to do the array constant. I can make it using const VAL = array(); just fine. The problem lies in making new objects using those classes fails with Parse error: syntax error, unexpected ‘[‘,…

Laravel 8.53 – Routing doesnt work on any of pages

Solution The solution was found thanks to @Gert B. Simply add to your Laravel application any virtual host (I added for mine) laravel1.test How to add Virtual host: Go to C:WindowsSystem32driversetchosts add line: 127.0.0.1 laravel1.test (or your virtual host name) And add this to your vhosts(in case of using…

Laravel find rows by nested relationship column

I have 2 tables reserves and chats, chats belongTo reserves and I want to get all chats where chat.reserve.user_id = Auth::id(). How can I do that in laravel. Answer I don`t know your models name (need more code in question), but try use where ‘reserves’ your relationship and have field user_id. M…