Asked Jul 10th, 2020 3:20 a.m.• 145 1 1
  • 145 1 1
+1

Thêm mô tả cho route trong laravel

Share
  • 145 1 1

Em có một route:

\Route::put('suggests/{id}/approval', 'suggestcontroller@suggestapproval')->name('suggest.approval);

Bây giờ em muốn thêm mô tả cho route này, ví dụ như "Duyệt đề xuất" để lúc Route::getCurrentRoute() e có thể lấy được mô tả của route thì làm cách nào ạ

1 ANSWERS


Answered Jul 10th, 2020 3:36 a.m.
Accepted
+3

thêm 1 thuộc tính vào

\Route::put('suggests/{id}/approval', ['comment' => 'Duyệt đề xuất', 'uses' => 'suggestcontroller@suggestapproval'])->name('suggest.approval);

Lấy thì lấy thế này Route::getCurrentRoute()->getAction('comment')

Share
Avatar Dương Siêu @duongdosieu224
•
Jul 10th, 2020 3:42 a.m.

tks a ❤️

0
| Reply
Share
Viblo
Let's register a Viblo Account to get more interesting posts.