mardi 5 janvier 2016

Make user class in laravel without a database

I am using Laravel 5.1 to retrieve data from an api and display it in a website.

The api returns the auth user every time I send any request with a JWT token in the header.

When the user has signed in once, I send the token in every request.

I want a way in which I can check auth user and its details in every view.

1) How do I set the response to the User class so that I can use it later in the views as a Facade?

2) How do I retrieve the auth user?

3) How do check if there is a auth user or not?

A response is in Json

  "feed": {...}
  "auth": {
    "id": 1,
    "name": "Hetu Nandu",
    "title": "Student",
    "kp": 43,

  }



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

Aucun commentaire:

Enregistrer un commentaire