Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
104 views

Search controller logic to search through models and manufacturers

I have the following Laravel controller that searches through two models - Manufacturer and SearchTerm (which contains models of manufacturers, synonyms of models as well as common misspellings) using ...
Hashim Aziz's user avatar
3 votes
1 answer
847 views

Does PDO::quote helps me to protect me against sql injection?

I have to process raw sql user input with Laravel. I've backed them up as follows: ...
Phillipp Schwarz's user avatar
0 votes
1 answer
265 views

PHP - Importing columns from uploaded CSV file to SQL database (Laravel 5.7) [closed]

The goal is to upload the columns from the csv into the SQL Pro database. I am able to select the column names that have been uploaded from the csv file, the columns from the csv file are then ...
Victor Melvin's user avatar
4 votes
2 answers
441 views

Looping through organization records to find relationships

I have two tables in my database, which contains a big list of organisations. They are called orgs_main and orgs_sub. This is ...
oliverbj's user avatar
  • 287
4 votes
2 answers
3k views

Full text search for multiple words using Laravel and MySQL

I'm using Laravel 5.6 and MySQL. I need to search multiple columns for a single word or multiple words (e.g., "camhandle", "cam handle"). The way I was originally doing it was just ...
derrickrozay's user avatar
4 votes
1 answer
185 views

PHP Laravel function to search for ads in MySQL

I am new to the Laravel framework. I have recently written a function which gets called through a route. The function is created for two purposes: Get ads from a particular city based on provided ...
Khawar Raza's user avatar
1 vote
1 answer
532 views

Laravel query to select photo orders related to some competition

I'm using Laravel and I have one monster query that returns exactly what I need, and runs perfectly on my dev machine, but on production runs extremely slow and I get timeout errors. Here's the query:...
Citizen's user avatar
  • 61
5 votes
1 answer
1k views

Eloquent methods to calculate the average rent of apartments

I am working on a Laravel 5.1 website where I am counting the average rent of apartments in a specific area. Besides of that I want to get the average rent by amount of rooms in the apartment. The ...
Jimmie Johansson's user avatar
0 votes
1 answer
4k views

DB Query within foreach

I'd like a general opinion on my piece of code (which does exactly what I want it to do). I feel like I'm using bad practices, like a DB query within a foreach loop,...
user1732521's user avatar