Level 2
@ligonsker I would rather do a
if (Auth::check()) {
DB::table('table')->where('id', Auth::id())->value('colum');
}
1 like
Summer Sale! All accounts are 50% off this week.
I want to query some table but also make sure the user is authenticated
is it possible to use both Auth and DB::table? Or do something that would be equivalent to that?
because I want to create an accessor for the User which gets data from another table:
DB::table('table')->where('id', some_id)->value('colum');
I was thinking about:
DB::table('table')->where('id', Auth::user()->id)->value('colum');
Will that be equivalent?
Thanks
@ligonsker I would rather do a
if (Auth::check()) {
DB::table('table')->where('id', Auth::id())->value('colum');
}
Please or to participate in this conversation.