lundi 27 mars 2017

How to use session in custom class laravel 5?

here is my code:

<?php 
use Illuminate\Support\Facades\Session;
namespace App\CustomLibrary

{
    class myFunctions {
        public function is_login() {
            if(Session::get('id') != null){

                return TRUE;
            }
        }
    }
}
?>

I'm new in laravel 5, i just added a new custom function. And inside that function i wanna check a session ('id)? But i've got an error like this

FatalErrorException in myFunctions.php line 8: Class 'App\CustomLibrary\Session' not found

I need to know how to use session properly.



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

Aucun commentaire:

Enregistrer un commentaire