I am developing a Simple CRUD Application, I want to fetch my forms details from my forms table.
my controller look like below,
public function manage_forms()
{
$form_data=Form::all();
return View::make('manage_forms')->with('form_array',$form_data);
}
the routes.php,
Route::get('manage-forms',array('as'=>'manage_forms','uses'=>'Nri@manage_forms'));
the View file,
<title>Registered Form details</title>
<h2>Registered Form details</h2>
<ul>
@foreach($form_array as $form_view)
<li>{{$form_view->name}}</li>
@endforeach
</ul>
My Forms model (Form.php),
<?php
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class Form extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'forms';
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = array('password', 'remember_token');
}
I am getting error like
BadMethodCallException
Method all does not exist.