Route::morph() for commentable / likeable packages #36130
Replies: 1 comment 2 replies
-
Route::morphs([
'commentable' => [
\App\User::class => 'CommentController@index',
\App\Post::class => 'CommentController@postList',
],
'likable' => [
\App\User::class => 'CommentController@index',
\App\Comment::class => 'CommentController@commentList',
],
]); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Produces
/users/1/comments
/user.comments.index
Useful to store morphable models in a package's config
"like" package users/{user}/likes
"comment" package users/{user}/comments
Beta Was this translation helpful? Give feedback.
All reactions