How to do where() statement ?
ivanradojevic-web-dev opened this issue · comments
- "jgrossi/corcel": "^5.0",
- "laravel/framework": "^8.0",
- "php": "^8.0",
Description:
$object = \Corcel\Model\Post::where('slug', $slug);
Steps To Reproduce:
//Corcel $object
In WordPress, slug
is stored as post_name
. You can call it like this:
\Corcel\Model\Post::where('post_name', $slug)
Most of the time, I use the helper method:
$post::slug($slug)