I am attempting to use Corcel with Laravel and I am following the instructions that are on the Corcel git: https://github.com/jgrossi/corcel But, am having issues.
I am pretty new to Laravel, so I am certain it's something I am doing, but this is a learning experience for me and looking for those who may be able to point me in the right direction.
The problem I am having is when I get to the portion where it says "So, now you can fetch database data:"
$posts = App\Post::all(); // using the 'wordpress' connection
$posts = Corcel\Post::all(); // using the 'default' Laravel connection
I've tried both of those, and get the errors each time.
Class 'myNameSpace\Http\Controllers\App\Post' not found
That is when I use the App\Post version.
Class 'Corcel\Post\Post' not found
That is when I use the Corcel\Post version.
I also have this in my controller and the Post model class:
use Corcel\Post as Corcel;
Is there something that I am missing? Thank you!
use App\Post;,use Corcel;, then call them with$posts = Post::all();and$posts = Corcel\Post::all();