I am retrieving records from a table using the following statement and sending it as json response of an api.
$locations = \\App\\Models\\Location::all();