title: How to set the global variable on Laravel Controller?
body: <p>Everyone.</p>
  <p>Every function on a controller, I am using the same variables.</p>
  <pre><code>public function store(Request $request) 
  {
     $user = auth()-&gt;user();
     $user_name = $user-&gt;name;
     $user_id = $user-&gt;id;
     $init_pdf = url('/') . '/images/' . 'upload/' . $user_name . '/' . $name;
     ...
  }
  
  public function signedPdf(request $request) 
  {
     $user = auth()-&gt;user();
     $user_name = $user-&gt;name;
     $user_id = $user-&gt;id;
     $name = $user_name . $user_id . '.' . $file-&gt;extension();
     ...
  }
  
  </code></pre>
  <p>I want to set the global variable for the common variables.</p>
  <p>How can I set it?</p>
  <p>thanks</p>