FbF / Laravel-Youtube

A Laravel package to upload videos to a YouTube channel
MIT License
93 stars 31 forks source link

Undefined property: Illuminate\Database\Query\Builder::$access_token #4

Closed renege closed 10 years ago

renege commented 10 years ago

The following function of your package does not work:

public function getLatestAccessTokenFromDB()
    {
        $latest = \DB::table(\Config::get('laravel-youtube::table_name'));
        if(\Config::get('laravel-youtube::auth') == true){
            $latest->where('user_id', \Auth::user()->id);
        }
        $latest->orderBy('created_at', 'desc')
                ->first();
        // if ($latest)
        // {
        //  return $latest->access_token;
        // }
        return null;
    }

It only works when I disable above.