title: How to use laravel model inside a simple php file?
body: <p>I want to make a function that I can call inside controllers so I tought about creating a .php file in App folder and use it inside the controller, but how do I write inside that file like in a controller.</p>
  
  <p>Example contents of the file:</p>
  
  <pre><code>&lt;?php
  
  function sendNotification(icon, text, userID)
  {
  
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>Do I just write like this:?</p>
  
  <pre><code>&lt;?php
  
      function sendNotification(icon, text, userID)
      {
        $var = new Notifications;
        $var-&gt;notificationText = "string";
        $var-&gt;save();
  
      }
  
      ?&gt;
  </code></pre>