jeudi 16 février 2017

Getting an empty result for newQuery

I've a problem in getting the value of the query $scholars for $lt = $scholars->lat.The result is empty array for dd($lt);

.Any help would be helpful to my school project.

database of Scholar

id          lat                 lng
1           10.275667       123.8569163
2           10.2572114      123.839243
3           9.9545909       124.1368558
4           10.1208564      124.8495005




        $scholars = (new Scholar)->newQuery()->select('*');

                $lt = $scholars->lat;
                $lg = $scholars->lng;
                $str = $lt.','.$lg;

                $url = 'http://ift.tt/WJEHSa'.trim($lt).','.trim($lg).'&sensor=false';

                $json = @file_get_contents($url);
                $data=json_decode($json);   

                $status = $data->status;
                $data->results[0]->formatted_address;

                dd($lt);
        $scholars = $scholars->get();

dd Result

Undefined property: Illuminate\Database\Eloquent\Builder::$lat



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lRRjbk
via IFTTT

Aucun commentaire:

Enregistrer un commentaire