Skip to content

Tag: php

how to force space to %20 in http_build_query?

I am facing a problem, that the API endpoint expects one of parameters with %20 replacing one of the spaces. Example: If I write ‘scope’ => ‘api offline_access’ the space gets translated to + sign when passing it to http_build_query() function. If I keep it like it is above, the sig…

Call to a member function save() on array laravel

Im doing the update method. When I tried to update the specific data, im getting this error “Call to a member function save() on array”. Why? Is there’s something missing in my codes? I also tried to print_r the $result variable, it has a value.. View Controller Route Answer This way can hel…

Laravel 5.3 – Clear config cache in shared hosting

Currently I’m working on small project that require me to host my laravel app on shared hosting (please ignore the reason why I didn’t use VPS to host my laravel project) and this hosting provider disable escapeshellarg() for security reason so I can’t use php artisan config:cache to clear c…

Get program name for PID using PHP

I am attempting to do something that is a little risky. Its a private script, but i want to add some security so I don’t accidentally enter an invalid PID. Currently if a script hangs it will lock …

Laravel: HTML in notification

I’m using the default notification system (Laravel 5.3) to send an email. I want to add HTML tags in message. This does not work (it displays the strong tags in plain text): I know it’s normal because text is displayed in {{ $text }} in the mail notification template. I tried to use the same syste…

Laravel Carbon Group by Month

Can anyone see what I’m doing wrong? I’m trying to output all the months but group them so they are unique. I’m getting the following back In my database I have five news articles all created_at 05/01/2017 so it’s right that I only get one response but I’m not getting the number …