So typically if you have access to the id of a user in laravel you can run User::find($id), however say you don\'t have access to the user\'s id and only their username. Is
It depends. If a user is logged in you can have any information you want by:
$field = Auth::user()->field;
But if they are not logged in and you just want their user_id you can use:
$user_id = User::select('id')->where('username', $username)->first();