0

I'm using Setting package (https://packagist.org/packages/anlutro/l4-settings) in laravel 10 project and there is a feature to use custom settings for each individual user using this method:

<?php
Setting::setExtraColumns(array(
    'user_id' => Auth::user()->id
));

I can do it every time when I need to access or save settings but it's not ideal. How can I set up this feature globally if I need currently authenticated user id?

I tried to set this up inside AppServiceProvider->boot() method, but Auth::user() object is not defined yet in this place.

Vadim Podlevsky
  • 181
  • 1
  • 9

0 Answers0