我的灯丝申请表里有PostResource
个.
后情态图式
Posts
- id
- title
- slug
- description
- created_by
- status
现在,每当我创建一个新的帖子,它会重定向到编辑页面和URL访问,就像http://127.0.0.1"8000/posts/1/edit
.
但我们可以在URL中添加一个弹头吗?
例外URL:http://127.0.0.1"8000/posts/<SLUG>/edit
在我的PostResource
条路由中
public static function getPages(): array
{
return [
'index' => Pages\ListPosts::route('/'),
'create' => Pages\CreatePost::route('/create'),
// here, it binding route model, I want to change with slug
'edit' => Pages\EditPost::route('/{record}/edit'),
];
}