A
A
Alexey Bolgov2021-02-23 18:40:02
Laravel
Alexey Bolgov, 2021-02-23 18:40:02

How to add an authorized user to a global variable?

Hello. I want to implement api on the server and settled on one problem:
How to make the user id entered into a global variable and then the api makes a selection from the database of this user. If possible through:

protected $cat;
 public function __construct() { 
}
private function sendTest(){
}

Because I have a lot of classes and functions, and this problem stops me. Requests pass between controllers and classes

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question