dsqdpn31467 2018-08-30 04:52
浏览 74

laravel无法在app / http / controller / productController.php中创建函数

Look at the image. I create changeName function inside the controller but it does not work.

My route :

Route::resource('products','ProductController');

why?

I tried to check all the syntax and it is correct.

enter image description here

enter image description here

  • 写回答

1条回答 默认 最新

  • douzhi4311 2018-08-30 05:24
    关注

    By the first image you posted I suppose you mean it doesn't appear on the routes, is that right? If so, it's because you need to define the route on the the routes/web.php file. For example like that :

    Route::get('/changeName', 'ProductController@changeName');
    
    评论

报告相同问题?