I am seeing 404 NOT FOUND page after trying the code below,
Here is my blade code,
<a href="{{route('admin.delete.article',$article->id)}}" title="Delete" class="btn btn-sm btn-danger"><i class="fa fa-times"></i></a>
Here is my route, the route has a prefix called admin
Route::get('/deletearticle/{$id}','AppHttpControllersBackArticleController@delete')->name('delete.article');
Here is my controller class, which is initially generated as a resource, however for the purpose of deleting a row from the database, a new function called delete is introduced manually. Therefore I am not using the destroy function. I am not introducing a delete method yet, so that I can see the $id on a new page as a test.
class ArticleController extends Controller
{
public function delete($id)
{
return $id;
}
public function destroy($id)
{
//
}
}
As you can see above, I am not introducing a delete method yet so that I can see the $id on a new page.. Also when I hower the mouse on the delete link object and click on it, it shows me localhost:8000/admin/deletearticle/9 on the browser, which is correct. But the page is 404 NOT FOUND .
I would be greatful to hear from you, if you have an idea about this problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…