2
Index Controller:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use View;
use App\Indexes;
use Illuminate\Support\Facades\DB;
class IndexController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public $restful = true;
public function index()
{
return view::make('index')
->with('name', 'teste')
->with('index', Indexes::all());
}
Model:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Indexes extends Model
{
protected $table = 'index';
protected $filliable = [
'name'
];
}
Meu Index.blade:
@foreach($indexes as $index)
<td> {{$index->name}} </td>
@endforeach
Undefined Variable Indexes appears in Blade.php
– Rafael Caldeira
Welcome to Sopt. Click [Edit] and explain the problem better.
– user28595
Lucky I got the problem rsrs how to close the topic
– Rafael Caldeira
Post the solution as the answer and click on the "V" right next to the answer.
– user28595