lundi 24 août 2020

Variable undefined in Laravel [duplicate]

I am getting undefined variable error in Laravel for the code section: (this is index.blade.php file)

 @foreach($faqs as $faq) 

  <tr>
  <td></td>
  <td></td>
  <td></td>
  </tr>

though I send the variable in this file via Controller:

public function index(Request $request)
{

    $faqs = Faq::all();
    return view('admin.faq.index')->with('faqs', $faqs);
}

The Faq Model is :

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Faq extends Model
{
    //
}

the error message I am getting is enter image description here

How can I solve this? TIA.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire