Skip to content
Advertisement

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 there is it

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 automatically redirect

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: Unfortunately that doesn’t work either. Is there any

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/MainController.php What am I missing/doing wrong? Answer in /bootstrap/app.php in /app/Providers/BatmanServiceProvider.php create Services folder in your_lumen_project/app,

Logging into a soap API with cURL and Laravel

I’m having some trouble with this. I am trying to login to a Soap API with SSL I have generated the .pem file and can verify it is good by doing the following The following give me HTTP/1.1 202 Accepted Now, when I essentially try to do the same thing within a laravel controller with the following, I get the

Advertisement