Skip to main content

All Questions

Tagged with
0 votes
1 answer
44 views

How to get monthly reports from multiple records?

I have a table name ‘attlog’ that contain multiple records from machine scan. Each person have more than one record depend on their scan. I would like to get monthly reports person from that table ...
ronvireak's user avatar
0 votes
2 answers
63 views

Laravel data to show with specific value, and specific value have specific date?

I have data in table like this id name status created_at 1 ABC 1 2022-01-01 2 ABC 2 2022-01-01 3 XXD 3 2022-01-01 5 ABC 3 2022-01-01 6 JON 5 2022-01-01 7 WER 5 2022-06-01 8 ABC 5 2022-06-01 And I want ...
ezles88's user avatar
  • 179
0 votes
2 answers
420 views

SQLSTATE[22007]: Invalid datetime forma

I try to save some data that it brings me from my view, which is a table, but I don't know why it throws me that error with the insert. result of insert this is my view: table of view this is my ...
UndecoDE's user avatar
5 votes
2 answers
1k views

Remove bracket and quotations in JSON_AGG (Aggregate Functions)

public function fetchdrug(Request $search_drug){ $filter_drug = $search_drug->input('search_drug'); $all_drugs = HmsBbrKnowledgebaseDrug::selectRaw('DISTINCT ON (drug_code) ...
user avatar
1 vote
1 answer
629 views

Laravel: selectRaw with GROUP_CONCAT and DISTINCT ON

I am trying to use DISTINCT ON to show only one drug_code and to CONCAT the drug_dosage onto that one distinct drug_code. Here is the output without CONCAT: $all_drugs = HmsBbrKnowledgebaseDrug::...
user avatar
0 votes
0 answers
128 views

Laravel Controller: translating an SQL SELECT DISTINCT statement inside a function

Table List: Here is the SQL as mentioned in the title: SELECT DISTINCT ON (hbg.group_id) hbg.group_id, hbg.id AS id, hbg.group_name, hbg.group_description, hbg.group_type_id, ...
user avatar
1 vote
0 answers
111 views

Laravel/Ajax: selecting a row with a different id but same group_id shows a different value

To explain my title, this is my table, it has multiple rows with the same group_id but different id Here are those same rows in my output: (I added their id beside the names to show the value) My ...
user avatar
0 votes
2 answers
580 views

Laravel Controller/Modal order by in all()

Trying to sort my table. The numbers are category_id and they are not sorted by number (1 and 2 are at the bottom of the table), I want to order them. Controller: public function fetchcategory(){ ...
user avatar
0 votes
1 answer
54 views

Column not found: 1054 Unknown column '2' in 'on clause' - InnerJoin query not working properly

I am trying to execute the following code, the error applies to the $waitingToBeShipped... section of the code. As you can see I am using an innerJoin. I want to retrieve all of the rows that have ...
Sander Plomp's user avatar
1 vote
0 answers
34 views

Laravel ajax my column id is not being shown by console.log

Demonstration on how my catagory_id is being read (console.log each time I press the edit button) $(document).on('click','.edit_category',function (e) { e.preventDefault(); ...
user avatar
1 vote
2 answers
199 views

Laravel show array in console from table even with null values

This is my table: hms_bbr_category_2. It's just a test table, ignore the gibberish. I need to get a console.log working so that just in case values there will be any null data when I add new rows Here ...
user avatar
2 votes
1 answer
485 views

Laravel controller insert two id columns at save()

I am trying to add two columns: id and category_id and I need both to be the same value $category = new HmsBbrCategory; $category->id = increments(); $category->...
user avatar
1 vote
1 answer
318 views

How does a Laravel model get a "required" data? New column, adding another column's data

Still new to laravel, learning how the $request interacts with create. here is my form for two of my variables for context: <form method="POST" id="postForm"> ...
user avatar
0 votes
2 answers
112 views

Query some parent data and its child data in Laravel 8

I have a personnel table which is connected to other tables. One of its child table is BMI. A personnel has many BMI record. At the moment I have this query. $personnel = Personnel::join('...
Hope's user avatar
  • 644
0 votes
1 answer
113 views

How Can I do Query Builder in my Laravel controller?

I'm trying to create a dynamic chart and I want to do some query. In My PhpMyAdmin I find the right syntax of my query: SELECT count(*) FROM organigrammes WHERE direction = 'CPLE' AND statut = 'CDI';...
Saliou MBALO's user avatar

15 30 50 per page