I am having a problem with a controller action in a laravel project and I have no idea why, since everything seems fine.
Heres my route concerning the error part:
Route::get('/reminds','RemindController@index');
Route::get('/reminds','RemindController@create');
Heres the create and index method that are defined in the RemindController.php file:
public function index()
{
$reminds = Remind::all();
return View::make('remind.index', compact('reminds'));
}
public function create()
{
try {
$listyears = RemindController::generate_list(date('Y')-100, 101);
$listmonths = RemindController::generate_list(1, 12);
$listdays = RemindController::generate_list(1, 31);
return View::make('remind.create', compact('listyears', 'listmonths', 'listdays'));
} catch (Exception $e){
App:abort(404);
}
}
In create.blade.php(of remind view) I have this that calls the problematic index:
<div class="panel-heading">
<h2>create reminder</h2>
</div>
<div class="panel-body">
{!! Form::open(['action'=> 'RemindController@index', 'class' => 'form']) !!}
The problem is that each time I try to access the page that calls the reminder creation form I get error:
ErrorException (E_ERROR)
Action App\Http\Controllers\RemindController@index not defined. (View: C:\Users\myusername\Desktop\project\prototypeesources\viewsemind\create.blade.php)
However I clearly defined it. I dont understand. Thank you