mardi 12 juin 2018

How to get most recent data from table? Laravel 5.5, MySQL

I have this simple function to get the token of a user.

However, if a user has just been added, I'd need to refresh data in MySQL Workbench before the code can pull it via code which would be a problem on production.

public function getToken($user_id) {
    $token = \DB::table('social_providers')->where('user_id', $user_id)->value('token');
    return $token;
}



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

Aucun commentaire:

Enregistrer un commentaire