php - Session or Database lookup? -
i'm running php app laravel. should utilize sql lookup user info everytime or should store in session/cache after looking 1 time , pull there? info not alter unless user changes it, want @ on efficiency viewpoint.
if talking about logged in user info leave laravel. depending on configuration laravel maintain info , allow access info using unified api.
check configuration
the authentication configuration file located @ app/config/auth.php, contains several documented options tweaking behavior of authentication facilities.
by default, laravel includes user model in app/models directory may used default eloquent authentication driver. if application not using eloquent, may utilize database authentication driver uses laravel query builder.
to retrieve user/user info may utilize this:
$user = auth::user(); $useremail = auth::user()->email; laravel utilize session store user id , original info stored in database, don't need worry user data. check documentation , allow laravel it.
php mysql laravel
No comments:
Post a Comment