Send data to a partial theme view

Laraship QuestionsCategory: TechnicalSend data to a partial theme view
ATMA asked 3 years ago
How can I send a data to a partial theme view? I create a new column in User table call "first_time_login" (boolean). So I have this code below:
$first_time_login = false;
if (Auth::user()->first_time_login) {
$first_time_login = true;
Auth::user()->first_time_login = 1;
return view('corals-elite-admin::partials.header', ['first_time_login' => $first_time_login]);
  I want put this code in some Controller (that I don´t know what) for then to call or send the $first_time_login variable to run in partial.heder view. I'm using a custom module "Quiz::"
1 Answers
laraship Staff answered 3 years ago
Hello, We dont see a new to pass this variable as its a field for user entity where it will be available anywhere in the views, you just need to use user()->first_time_login to return the value anywhere.