I have to access to the session and get some values and share it with all my views I have used following code on my AppServiceProvider.php
, but it returns null when I read my session, Following code I have tried
$errors = json_encode(session()->get('errors'));
View::share('validation_errors', $errors);
Without sharing if I call the same function and assigned it through controller before view been called it works without any problem.