0
votes

I am using laravel rource controller and routes and having problem in view file while using Form::Open method

Following is my code in routes.php

$router->group(['namespace' => 'Admin', 'middleware' => 'auth'],
function (){   resource('admin/post', 'PostController',
['only' =>     ['index', 'create', 'store', 'newe', 'afadfafafa']]);
resource('admin/tag', 'TagController');
get('admin/upload', 'UploadController@index');
});

In view.php

{!! Form::open(array('action' => 'Admin\PostController@store')) !!}

In Controllers/Admin/AdminController.php I do have a method named store.
Still I am getting, form action url renders as "http://localhost/laravel/admin/post" i.e. to index action and not store action.

What is problem in my code.

2

2 Answers

0
votes

i try your code and it works right

Admin\PostController.php

  public function index()
  {
    echo "method index";
  }

  public function store(Request $request)
  {
      echo "method store";
  }

enter image description here

0
votes

enter image description here

This is what i am expecting with current code should work