Skip to content

Tag: laravel

How can I run php artisan serve using .env.production?

I have a Laravel Web Application, and it works just fine locally, using a local .env file that references the local database. I have the same Laravel Web Application deployed in production, where I find a .env, which is different from the one that I use locally. Both the scenarios work perfectly, but when I w…

How can I write this query with Eloquent

Let’s say I have a method like this: My question is, how can I rewrite this query with Eloquent for my Laravel project? Answer From what I understood I think this is what you are looking for, try it and tell me: You can get more information from the laravel Database documentation Query Builder here: htt…

How to create redirect links with my own url?

I am creating a website with Laravel. I will promote some products via affiliation. I have some affiliates links like http://wwww.example.com/aff.php?id=123 I would like to have links like http://www.example.com/go/nameofproduct that redirect to affiliate links Affiliates links are in a table in my database. …