title: fetch data from database and display the values in database in laravel
body: <p>I want to fetch values from database and display it in the view, but I didn't get a correct result.</p>
  
  <p>This is my <strong>controller</strong>:</p>
  
  <pre class="lang-php prettyprint-override"><code>class HrRequestController extends Controller
  {
      /**
       * Create a new controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('auth');
      }
  
      /**
       * Display a listing of the resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function index()
      {
  
          $hr_request = HrRequest::all();
  
          return array(
              'status' =&gt; 'success',
              'pages' =&gt; $hr_request-&gt;toArray());
      }
  }
  </code></pre>
  
  <p>and this is my <strong>Model</strong>:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class HrRequest extends Model
  {
  
      /**
       * The table associated with the model.
       *
       * @var string
       */
      protected $table = 'hr_request';
  
      public $timestamps = false;
      /**
       * Fields.
       *
       * @var array
       */
      protected $fillable = [
          'profile_role_id', 'hr_id', 'vacancy', 'experience', 'job_description', 'status', 'viewed',
      ];
  }
  
  view name:view-requests.blade.php
  </code></pre>
  
  <p>I have no idea n how to do this in view. Can anyone help me?</p>