C
C
Combat72018-08-03 04:03:17
Laravel
Combat7, 2018-08-03 04:03:17

How to pass auth to parent?

Goodnight.
Tell me, controller2 is registered in the routing. Controller 2 inherits controller 1 in which I am trying to get Auth id, but for some reason does not want to give it back. Only in controller 2.
Thanks
again Routing Main controller
Route::get('/home', 'panel\[email protected]');

class HomeController extends MainPanelController
{
function index() {
}
}

Parent
class MainPanelController extends Controller
{
function __construct()
{
echo Auth::id();
}
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-08-03
@Astatroth

When will you people learn to use the search or read the documentation, in fact ... Even on the Toaster, this question has been raised more than once: starting from version 5.3 , the session is not available in the controller constructor.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question