Skip to content

Tag: laravel

Redirect routes to separate controllers for same url pattern?

In my routes file “web.php”, I’m having below routes. I’m trying to access pages with domainname.in/{slug} and dashboard with domainname.in/dashboard pattern but dashboard prefix routes are redirecting to PageController instead of dashboard controller. I tried where clause as below but…

UTF8 Encoded messages broken charecter on php smpp sms sending

Hi am using php smpp sms sending package to work on socket sms sending. I am sending with $encodedMessage = GsmEncoder::utf8_to_gsm0338($message); UPDATE But the sms is receiving with broken character.I am sending in myn language and also tried as suggested But now half broken half proper message is sending. …

how to run to foreach loops for single select tag laravel?

I want to show previously selected options as selected, I have two data sets. blocks that are JSON encoded in a column with country codes. countries list from the country table I want to compare both and want to show countries selected that are present in users blocked colmn JSON encoded Answer Thanks to @ger…

Laravel Redirect from Helper Class

I’m trying to redirect to an external URL from a helper class. Here’s my controller: Here’s my helper class used in the controller: Why is the redirect() not working inside my_function()? Do I need to include some Laravel classes using the PHP “use” statement? Answer You can add …

Convert an int to time()

I want to send a reminder email “x” days after an initial email was send. The admin can choose after how many days they want to send a reminder (after the date of the initial mail). This amount is stored in this function and returns an integer (for example 14) The date/time of that the initial email was send …