Laravel Eloquent Query to 2 Million Rows takes long time

I have to pull data from a table that has 2 million rows. The eloquent query looks like this: $imagesData = Images::whereIn(‘file_id’, $fileIds) ->with(‘image.user’) ->with(‘file’) ->orderBy(‘created_at’, ‘DESC’) ->simplePaginate(12); The $fileIds array used in whereIn can contain 100s or even 1000s of file ids. The above query works fine in small table. But in production site…

Laravel Crud Application Editing a record

I have a problem with my Laravel crud application for Registrations. There are these tables: Registration, ExtraRegistration (with a registration_id, extra_id and extraoptions_id), Extra and ExtraOptions (with the Extra_id). In the RegistrationController when i add a Registration it makes a new record in the ExtraRegistration with the extraoptions_id and the extra_id. the extra_id is the…

Eloquent laravel chinese support in sql database

if I run this Eloquent query where $query is ‘语嫣’ $data = Model::select(‘driver_name’)->where(‘driver_name’, ‘LIKE’, “%{$query}%”)->distinct(‘driver_name’)->get(); Zero result returned by when I use the query below $data=DB::select(“select driver_name from table_name where driver_name like N’%”.$query.”%’ “); Two rows returned Conclusion when append N in front of the string sql server able to read the chinese string. But…

DataTables Laravel 5.2 Can not be loaded

I want to use Datatables in my project (laravel 5.2) especially in my /events-log view, but the result like this This is events-log view 1 This is events-log.blade.php <div class=”table-responsive”> <table class=”table table-bordered table-hover” id=”event-log-table”> <thead class=”bg-light” align=”center”> <tr class=”border-1″> <th class=”border-1″>Time Stamp</th> <th class=”border-1″>Event</th> <th class=”border-1″>Event Type</th> </tr> </thead> </table> </div> And, this is…