What is the best way to generate a token using session ID in Laravel

  laravel, php, security, session, token

I need to generate a token that will be used by a browser extension to authenticate against a Laravel webapp. The token needs to be included in the head of every page and must contain the current users session ID so that the browser extension can extract the token and make a request to the webapp to confirm that session referenced in the token is valid and hasn’t expired.

I’m not sure how to go about this, any help would be greatly appreciated.

Source: Ask PHP