I’m writing an app that allows to rank (vote) among several options. If an user from the Internet (not signed into the app) votes, I just store it with a user_id = NULL, but if some authenticated user votes, I ...
databaseanswers.net Latest Questions
I need to write query in sql Or Laravel. my matches table user_id and to_user_id match with user table. My Matches Table id user_id to_user_id 1 101 110 2 101
How should I convert the below SQL query to Laravel’s Eloquent query builder? select count(x.payment) from ( select * from transactions group by payment having count(payment) = 1 ) x where x.updated_at ...
Currently trying to seed the database with a lot of data. It’s very possible that I will get the same record twice so I thought to use firstOrCreate to make sure I don’t try to save it again with the ...
I am working with a booking appointment system. I want to find out how many time slots are available and how many time slots are already booked. time slot count will be change base on the appointment. I used laravel ...
I am stuck on doing reverse relationship using laravel mongodb while using my primary key as foreign key but nothing is wrong when i use non primary key as foreign key here’s the code public function location(){ return $this->belongsTo('App\Models\AssetLocations', ...
Stack: Laravel v8, MySQL. I working on a payroll system with Laravel. I want the value of some columns to update if another column it depends on changes. For example, if the Number of working days changes on the payrolls table, then the ...
In my local laravel environment I don’t have any problems connecting. But in production I’m getting this: return "SQLSTATE[08006] [7] timeout expired (SQL: select * from "document")" in all routes that queries the bank.. DB_CONNECTION=pgsql DB_HOST=**.**.**.** DB_PORT=5432 DB_DATABASE=*********** DB_USERNAME=************ DB_PASSWORD=***************
[LARAVEL ] como eu faço para remover alguma coluna da tabela PersonalAccessToken sem ter nenhum problema TENHO ESSE RETORNO Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘abilities’ in ‘field list’ (SQL: insert into personal_access_tokens (name, token, abilities, expires_at, tokenable_id, ...
$star = $request->input('start_date'). ' ' . '19:00:00'; $end = $request->input('end_date'). ' ' . '07:00:00'; $employee_qty_in_shift2 = PatrolGateSurveillanceTransaction::where('type', 1) ->where('client_location_id', $request->client_location_id) ->where('created_at', '>=', $star) ...