Hello,
I've just create my own Facade and I'd like to handle sessions in my method, But when I try to use something like this:
if ( Session::has('login') )
{
// do something
}
Laravel returns a FatalException with this message: Class 'Myfacades\Services\Session' not found The same if I use any Laravel Class (Input, ecc).
Why? Thanks in advance
That's just namespacing basics. Since your facade is in the MyFacades\Services namespace, just trying to call Session looks for it in the same namespace. You'll need a use statement at the top of your file.
Thanks for your reply. But How to use?
I have
namespace Yvoting\Services;
class HelloWorld
{
public function sayHello()
{
$vv = Session::get('sss', 'sssf');
}
}
Solved, thanks thepsion5:
namespace Yvoting\Services;
use Session;
class HelloWorld
{
public function sayHello()
{
$vv = Session::get('sss', 'sssf');
}
}
Or you can do this also:
\Session::get('bla');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community