drewjbartlett / wordpress-eloquent

A library that converts converts wordpress tables into Laravel Eloquent Models.
MIT License
148 stars 45 forks source link

Add $post_type functionality #5

Closed terence1990 closed 7 years ago

terence1990 commented 7 years ago

This helps with simplifying type scope so users can do this:

    namespace Theme\Models;

    use WPEloquent\Model\Post;

    class Product extends Post {

        protected $post_type = 'product';

    }
// this will return a product automatically
var_dump(Product::first());
drewjbartlett commented 7 years ago

You're the man. Thanks for all your contributions to this.