How to get the published posts in laravel using corcel?
AnsweredI am trying to use corcel to retrieve data from wordpress in laravel. Found some usefl data on this website:
https://adevait.com/laravel/using-corcel-in-laravel
if i use like this, it show the error like this
$posts = \App\Post::published()->get();
return $posts;
BadMethodCallException in Builder.php line 2451: Call to undefined method Illuminate\Database\Query\Builder::published()
But if i use like this
$posts = \App\Post::all();
return $posts;`
it works.Help me out where am i missing to do. Thanks in advance.
-
Hi there, I don't think you're in the right forum, unless this setup is trying to collect data from Box APIs. I would recommend the Wordpress forums.
Please sign in to leave a comment.
Comments
1 comment