I got a little problem with my Database.
In my application i am retrieving data from a Excel sheet. I am using the framework Laravel and the library Laravel Excel(maatwebsite).
When i upload a file. In this example there are 7 rows from the sheet being insert into the database.
I retrieve 5 from them with this query:
$documentData = DB::table('documents')
->select(array('weld', 'diameter', 'thicknes', 'steelgrade', 'material', 'weldingdate', 'welderid', 'requestid'))
->where('diameter', '21.3')
->where('thicknes', '2.5')
->where('steelgrade', '—Ú20')
->get();
I select the data based on diameter,thicknes and steelgrade (my unique combination for every excel template(multiple combination possible)).
I place this information into the excel file that matches the combination and save it. That all works fine. But! when i upload another file (same unique combination for excel template), with almost the identical information except one column.
The query will retrieve all the row (10 after 2 uploads). How can i make sure it will only grab the latest upload. I know Laravel offers the created_at, updated_at column but i was wondering if there is something else. Order by/group by? or Latest();
I wonder if anyone has suggestions how i can solve this.
