You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// clean and simple all posts from a category
$cat = Category::slug('uncategorized')->posts->first();
$cat->posts->each(function($post) {
echo $post->post_title;
});
but there is no model "Catergory" in this package or I can't find it.
I 've tried to change to "Taxonomy" or other classes but some methods were missing.
I tried:
use Corcel\Model\Post as Category;
use Corcel\Model\Taxonomy as Category;
use Corcel\Model\Builder\TaxonomyBuilder as Category;
But nothing works, also my VisualStudio have no advices for me there. So I tried to achieve same results using other way:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, i try to use this example no 3 of:
https://github.com/corcel/corcel#cats
but there is no model "Catergory" in this package or I can't find it.
I 've tried to change to "Taxonomy" or other classes but some methods were missing.
I tried:
But nothing works, also my VisualStudio have no advices for me there. So I tried to achieve same results using other way:
But it gives error:
Property [posts] does not exist on this collection instance.
It's probably my missunderstanding of how eloquent collection works or objects itself...
Or i need to make own model to handle it?
I also have a clue that probably I need to add something in config around:
Help me please.
Beta Was this translation helpful? Give feedback.
All reactions