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.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2CZ5uJ2
via IFTTT

Aucun commentaire:

Enregistrer un commentaire