What I want is, to achieve this method on my own like what i'm usually doing in laravel when accessing session.
I created interface which has a method of set and get just like what laravel does when accessing session. Then instantiate it in main class then access the get function like
// This is my code
$session = new Session();
$session->get('session_name')
I also tried it by using static function method like
// This is also my code
$session::get('session_name')
Looks cool
behind in the session class
class session implements sessionOperation()
{
public function set($string)
{
// code
}
public function get($string)
{
//code
}
}
But what I want to achieve is laravel like call
// This is laravel code
Session()->get('session_name')
It does'nt use a variable to call session. How to do that?
I know no matter how you write it still provides the same output. But I just wanna learn how to do it in my future reference too. Could someone help me?