I am new to laravel, and getting this error though tried every possible sites and google searches. I even tried previous queries solution from stack overflow, but was unable to solve.
this is my PostController.php:
`public function getData()
{
$post['post']=DB::table('students')->get();
if(count($post)>0){
return view('index',['Post'=>'$post'] );
}
else{
return view('index');
}
}`
this is my controller
This is my index.blade.php:
`@foreach($post as $value)
<tr>
<td>{{$value->id}}</td>
<td>{{$value->name}}</td>
<td>{{$value->address}}</td>
<td>{{$value->number}}</td>
<td><a href="" ><button>Edit</button></a> <a href="" >
<button>Delete</button></a></td>
</tr>`
This is my blade:
Route::get('/index','PostController@getData');
this is my route
please help in this queries, i am having a lots of problem