Skip to content

Tag: php

Query string keeps appending but it shouldn’t

So my problem is when i send an email with a link to reset the password the query string gets appended each time. For example: 99cb65f44c7acf7f80610e92358ca7ce006b852fb9d7be716154c0fe5a954867b87a4b281a7b42f5208dbbbac0a6d3de7444575b41b6a307a2fdd00e3b6d2cae <= First query string as i want to have it Then whe…

Remove characters from beginning and end string

I want to ouput only MYID from URL. What I did so far: output: https://whatever.expamle.com/display/MYID ouput: MYID?out=1234567890?Browser=0?OS=1 How can I combine this? Thanks. Answer When the string is always a Uniform Resource Locator (URL), like you present it in your question, given the following string…

How can I get date day by day?

I’m beginner in PHP and I’m trying to learn. I want to get the date of the next four days in Laravel. I tried like this but it returns the date four days later. I want to take all the next four days. How can I show all the next four days in the blade? Answer I hope this will

How can I prevent double checks in this function?

Here is a code to search and return the existing files from the given directories: So you can pass an array of file addresses and directories and get what ever files inside those directories, Note if you pass a file address instead of a directory address the function checks if there is such a file and if ther…

Redirect to default locale if not given and fortify routes

I made a middleware to change the language of my website but now I am facing two problems, so I would like your help to solve them: when the user types for instance http://mywebiste/en/operations the site is displayed in English, but if I omit the locale on the URL a 404 page is thrown. My intention is to aut…

WordPress: Add directory to post slug with function

I want to add a /news/ before every post slug. Like this: example.com /news/ post-slug/ If I add the /news/ in the permalinks settings, every custom post type is broken after it. I tried to add the following to every register_post_type: But that doesn’t help. I also tried the code from here: Unfortunate…

Custom service provider for Lumen

I’m new to Lumen, and have a fresh install (v8.2.4) and have followed the docs, trying to write my own service, but I keep getting error Like I said, its a fresh install according to the Lumen docs. in /bootstrap/app.php in /app/Providers/BatmanServiceProvider.php My controller: app/Http/Controllers/Mai…