Using Corcel with Laravel

DerbyHannah

New Member
I am attempting to use Corcel with Laravel and using instructions from Adeva: https://adevait.com/laravel/using-corcel-in-laravel 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:"

Code:
$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.

Code:
Class 'myNameSpace\Http\Controllers\App\Post' not found

That is when I use the App\Post version.

Code:
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:

Code:
use Corcel\Post as Corcel;

Is there something that I am missing? Thank you!
 
Back
Top