0

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 Answers 2

0

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

Sign up to request clarification or add additional context in comments.

1 Comment

I am expecting url like admin/post/store to go store method ..and likewise is my route code wrong ?
0

enter image description here

This is what i am expecting with current code should work

1 Comment

url not work because it is GET request in your browser, not POST

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.