I am new to laravel so can anybody explain me that what exactly get() function of eloquent ORM does. I have following query and I need to know on which line the database is queried.
$propertiesQuery = Property::with('country', 'city','bannerInvoicesCount','rejectedBannerInvoicesCount')
->where('is_deleted','=',1);
if(Auth::user()->type == 'po') {
$propertiesQuery->where('user_id', '=', Auth::user()->id);
}
$propertiesQuery->orderBy('created_at', 'DESC');
$properties = $propertiesQuery->get();
Now in above code I have accessed Model once whether that is the point when db is queried or when I have called get() function. I am not been able to comprehend the internal working of this. That exactly on which statement the query is executed.