-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get post category name #612
Comments
Hi there! From a collection of categoriesWell you can return a collection with all categories with the Taxonomy::where('taxonomy', 'category')->get() The collection contains all categories as models. You can call Taxonomy::where('taxonomy', 'category')->get()->first()->name From a postIf you have a post and you need the category name then you will need to call Post::published()->type('post')->slug($slug)->with('attachment')->firstOrFail()->category_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi guys. How I can get post category name? I tried to find a way but I failed.
The text was updated successfully, but these errors were encountered: