title: Using user data to calculate formulas in laravel
body: <p>I am currently trying to find a way to use the data that is already on the users table to calculate the BMI of the user.</p>
  <p>Many of the tutorials I see, they have a form, and a post, but what do I do if I already have the weight and height of the user?</p>
  <p>I have tried building a controller like this:</p>
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  
  
  class IMCController extends Controller
  {
      public function calculate(){
  
  
          $weight = Auth::user()-&gt;weight;
          $height = Auth::user()-&gt;height;
  
          $imc = $weight / ($height^2);
  
  
          return $imc;
  
      }
   
  }
  </code></pre>
  <p>But when I call it on the view it says the class doesn't exist.</p>