Using Corcel with Laravel

I am attempting to use Corcel with Laravel and I have found a source: 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 here:

$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!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.