Skip to content

Commit 719bc20

Browse files
add slug as route key name in post model
1 parent f815205 commit 719bc20

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/Models/Post.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,9 @@ public function scopeDraft(Builder $query): Builder
6262
return $query->where('status', PostStatus::DRAFT)
6363
->whereNull('deleted_at');
6464
}
65+
66+
public function getRouteKeyName(): string
67+
{
68+
return 'slug';
69+
}
6570
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy