alaouy / YouTube

🔥 Laravel PHP Facade/Wrapper for the Youtube Data API
MIT License
782 stars 204 forks source link

trying to get property of non-object #109

Closed imsidz closed 5 years ago

imsidz commented 6 years ago

i am trying to search result with paginate like this

$params = [
        'q'             => $request,
        'type'          => 'video',
        'part'          => 'id, snippet',
        'maxResults'    => 20
    ];

    // $search = Youtube::searchAdvanced($params, true);

    $search = Youtube::paginateResults($params, null);

    $info = $search['info'];

    $nextpagetoken = $info['nextPageToken'];

    return view('search.index', compact('search'));

and my view

@foreach($search as $result)
  @foreach($result as $video)
  {{ dd($video->snippet->title) }}
   @endforeach
@endforeach

Results

but problem is when i use {{ $video->snippet->title }} getting error

alaouy commented 6 years ago

@imsidz Sorry for the late reply, did you manage to find a solution ?

imsidz commented 6 years ago

@alaouy i found the sollution thanks for the reply sorry for the later reply with your package i made this

https://youtube.majestic-x.com/

site