This question may like a duplicate question but I’m giving it back because I couldn’t perfect a solution. Sorry for that. Now I’m working on a drug search engine. The user cannot always enter the exact drug name. Depending on the characters entered by the user, I need to get a better result for them. But now it is not.
Tag: laravel
Laravel 5.6.9 – database count gives different outputs
Does anyone know why these two ways to count numbers of users in my table give different answers when i run them in tinker? AppModelsUser::count() => 92269 $count = DB::table(‘users’)->count() => 92829 Running a SQL query in Sequel Pro gives 92829. Answer If you have the SoftDelete trait on your User model then when you query via the Model it
How to get sum of specific status or id and joining 3 table in laravel
my table this is the result I want to display john — total paid shoes and bag dave <– total of bag,’shoes is unpaid so 1000 is not added to total’ this is my controller it gives me an error the total is same in all name Answer You could look to join sub queries, that certainly would be one
User with multiple companies (different type)
I built an application in Laravel that is a simple CRUD app. Now im struggling with migrations a bit. User belongs to Company. Company can have many users. Company type can be Supplier, Customer or …
which is better for user activity in laravel database or log file [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question hi im thinking about user activity in laravel application .. and i thought is it better to keep user activity in
Booking Time slot, with Equipment Stock query, in Laravel
Here’s an interesting one for you all. I’ve found myself in a implementation conundrum. I’m developing a booking app in Laravel that allows people to book rooms and equipment for spaces at specific times. The amount of equipment available is limited, so the amount of stock has to be queried in tandem with the time slots associated with the booking.
(Laravel) Multiple counts, group by on same table with one query
I have two tables. I would like to get the values of the counts of these two rows (attacker, victim) from the first table and their respective userid from the second table, if possible. Table1: Table2: So far I only managed to get the values of the counts of rows attacker and victim but I achieved it using two separate
Get a value from two tables
I am trying to get the value of the colum “name” from the clubs table. First table:(Clubs) id* name (what i need!!!) email password Second table:(club_posts) id club_id* zip_id kategory type stadt plz Controller: This is my query: The result is an array with ten values, but need only one. Answer Create a relation club in you ClubPost Model so
Multiple LIKE clauses in Laravel Eloquent
I currently have this code in my controller: The above code works, but what I want is to get “Accounting” and “Web Design” from an array, and just loop through that array so that the query is dynamic instead of hard coded on the controller Answer Try this :
how to find the position of string search in a json array column in laravel
i have a query which returns boolean value from a json array column about whether the string i am searching exists or not the column is something liek this —— [“a”,”b”,”c”] and the query is below but i want to get the position where the string was found… lets say for this it should return 1. please help. Answer It