diff --git a/composer.json b/composer.json index f6a7ba1..ad6a194 100644 --- a/composer.json +++ b/composer.json @@ -10,18 +10,14 @@ ], "license": "MIT", "require": { - "php": ">=5.3.0", - "illuminate/support": "~4.0|~5.0", - "illuminate/database": "~4.0|~5.0" + "php": ">=5.5", + "illuminate/database": "^4.2|^5.0|^6.0" }, - "suggest": { - "hampel/wordpress-auth-laravel": "WordPress Auth Driver for Laravel" + "require-dev": { + "roave/security-advisories": "dev-master" }, "autoload": { - "classmap": [ - "src/models" - ], - "psr-0": { + "psr-4": { "Zae\\LaraPress\\": "src/" } } diff --git a/src/Models/Comment.php b/src/Models/Comment.php new file mode 100644 index 0000000..655d51c --- /dev/null +++ b/src/Models/Comment.php @@ -0,0 +1,283 @@ +belongsTo(Post::class, 'comment_post_ID', 'ID'); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function user() + { + return $this->belongsTo(User::class, 'user_id', 'ID'); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function commentmeta() + { + return $this->hasMany(CommentMeta::class, 'comment_id', $this->primaryKey); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function meta() + { + return $this->commentmeta(); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function parent() + { + return $this->belongsTo(__CLASS__, 'comment_parent', $this->primaryKey); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function children() + { + return $this->hasMany(__CLASS__, 'comment_parent', $this->primaryKey); + } + + /* + * Accessors & Mutators + */ + + /** + * @param $value + */ + public function setIdAttribute($value) + { + $this->attributes[$this->primaryKey] = $value; + } + + /** + * @return mixed + */ + public function getIdAttribute() + { + return $this->attributes[$this->primaryKey]; + } + + /** + * @param $value + */ + public function setAuthorAttribute($value) + { + $this->attributes['comment_author'] = $value; + } + + /** + * @return mixed + */ + public function getAuthorAttribute() + { + return $this->attributes['comment_author']; + } + + /** + * @param $value + */ + public function setAuthorEmailAttribute($value) + { + $this->attributes['comment_author_email'] = $value; + } + + /** + * @return mixed + */ + public function getAuthorEmailAttribute() + { + return $this->attributes['comment_author_email']; + } + + /** + * @param $value + */ + public function setAuthorUrlAttribute($value) + { + $this->attributes['comment_author_url'] = $value; + } + + /** + * @return mixed + */ + public function getAuthorUrlAttribute() + { + return $this->attributes['comment_author_url']; + } + + /** + * @param $value + */ + public function setAuthorIPAttribute($value) + { + $this->attributes['comment_author_IP'] = $value; + } + + /** + * @return mixed + */ + public function getAuthorIPAttribute() + { + return $this->attributes['comment_author_IP']; + } + + /** + * @param $value + */ + public function setContentAttribute($value) + { + $this->attributes['comment_content'] = $value; + } + + /** + * @return mixed + */ + public function getContentAttribute() + { + return $this->attributes['comment_content']; + } + + /** + * @param $value + */ + public function setKarmaAttribute($value) + { + $this->attributes['comment_karma'] = $value; + } + + /** + * @return mixed + */ + public function getKarmaAttribute() + { + return $this->attributes['comment_karma']; + } + + /** + * @param $value + */ + public function setApprovedAttribute($value) + { + $this->attributes['comment_approved'] = $value; + } + + /** + * @return mixed + */ + public function getApprovedAttribute() + { + return $this->attributes['comment_approved']; + } + + /** + * @param $value + */ + public function setUserAgentAttribute($value) + { + $this->attributes['comment_agent'] = $value; + } + + /** + * @return mixed + */ + public function getUserAgentAttribute() + { + return $this->attributes['comment_agent']; + } + + /** + * @param $value + */ + public function setTypeAttribute($value) + { + $this->attributes['comment_type'] = $value; + } + + /** + * @return mixed + */ + public function getTypeAttribute() + { + return $this->attributes['comment_type']; + } + + /* + * Scopes + */ + + /** + * @param $query + */ + public function scopeApproved($query) + { + $query->where('comment_approved', true); + } + + /** + * @param $query + */ + public function scopeNotApproved($query) + { + $query->where('comment_approved', false); + } +} diff --git a/src/Models/CommentMeta.php b/src/Models/CommentMeta.php new file mode 100644 index 0000000..1eeff66 --- /dev/null +++ b/src/Models/CommentMeta.php @@ -0,0 +1,84 @@ +belongsTo(Comment::class); + } + + /* + * Accessors & Mutators + */ + + /** + * @param $value + */ + public function setIdAttribute($value) + { + $this->attributes[$this->primaryKey] = $value; + } + + /** + * @return mixed + */ + public function getIdAttribute() + { + return $this->attributes[$this->primaryKey]; + } + + /** + * @param $value + */ + public function setKeyAttribute($value) + { + $this->attributes['meta_key'] = $value; + } + + /** + * @return mixed + */ + public function getKeyAttribute() + { + return $this->attributes['meta_key']; + } + + /** + * @param $value + */ + public function setValueAttribute($value) + { + $this->attributes['meta_value'] = $value; + } + + /** + * @return mixed + */ + public function getValueAttribute() + { + return $this->attributes['meta_value']; + } +} diff --git a/src/Models/Link.php b/src/Models/Link.php new file mode 100644 index 0000000..1cfd54c --- /dev/null +++ b/src/Models/Link.php @@ -0,0 +1,39 @@ +where('link_visible', 'Y'); + } + + /** + * @param $query + */ + public function scopeHidden($query) + { + $query->where('link_visible', 'N'); + } +} diff --git a/src/Models/Option.php b/src/Models/Option.php new file mode 100644 index 0000000..76c7c9a --- /dev/null +++ b/src/Models/Option.php @@ -0,0 +1,96 @@ +attributes[$this->primaryKey] = $value; + } + + /** + * @return mixed + */ + public function getIdAttribute() + { + return $this->attributes[$this->primaryKey]; + } + + /** + * @param $value + */ + public function setKeyAttribute($value) + { + $this->attributes['option_name'] = $value; + } + + /** + * @return mixed + */ + public function getKeyAttribute() + { + return $this->attributes['option_name']; + } + + /** + * @param $value + */ + public function setValueAttribute($value) + { + $this->attributes['option_value'] = $value; + } + + /** + * @return mixed + */ + public function getValueAttribute() + { + return $this->attributes['option_value']; + } + + /* + * Scopes + */ + + /** + * @param $query + * + * @return mixed + */ + public function scopeAutoload($query) + { + return $query->where('autoload', 'yes'); + } + + /** + * @param $query + * + * @return mixed + */ + public function scopeNotAutoload($query) + { + return $query->where('autoload', 'no'); + } +} diff --git a/src/Models/Post.php b/src/Models/Post.php new file mode 100644 index 0000000..7458ac8 --- /dev/null +++ b/src/Models/Post.php @@ -0,0 +1,304 @@ +hasMany(PostMeta::class); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function meta() + { + return $this->postmeta(); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function comments() + { + return $this->hasMany(Comment::class, 'comment_post_ID', $this->primaryKey); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function user() + { + return $this->belongsTo(User::class, 'post_author', 'ID'); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function author() + { + return $this->user(); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function parent() + { + return $this->belongsTo(__CLASS__, 'post_parent', $this->primaryKey); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function children() + { + return $this->hasMany(__CLASS__, 'post_parent', $this->primaryKey); + } + + /* + * Accessors & Mutators + */ + + /** + * @param $value + */ + public function setIdAttribute($value) + { + $this->attributes[$this->primaryKey] = $value; + } + + /** + * @return mixed + */ + public function getIdAttribute() + { + return $this->attributes[$this->primaryKey]; + } + + /** + * @param $value + */ + public function setContentAttribute($value) + { + $this->attributes['post_content'] = $value; + } + + /** + * @return mixed + */ + public function getContentAttribute() + { + return $this->attributes['post_content']; + } + + /** + * @param $value + */ + public function setTitleAttribute($value) + { + $this->attributes['post_title'] = $value; + } + + /** + * @return mixed + */ + public function getTitleAttribute() + { + return $this->attributes['post_title']; + } + + /** + * @param $value + */ + public function setExcerptAttribute($value) + { + $this->attributes['post_excerpt'] = $value; + } + + /** + * @return mixed + */ + public function getExcerptAttribute() + { + return $this->attributes['post_excerpt']; + } + + /** + * @param $value + */ + public function setStatusAttribute($value) + { + $this->attributes['post_status'] = $value; + } + + /** + * @return mixed + */ + public function getStatusAttribute() + { + return $this->attributes['post_status']; + } + + /** + * @param $value + */ + public function setPasswordAttribute($value) + { + $this->attributes['post_password'] = $value; + } + + /** + * @return mixed + */ + public function getPasswordAttribute() + { + return $this->attributes['post_password']; + } + + /** + * @param $value + */ + public function setNameAttribute($value) + { + $this->attributes['post_name'] = $value; + } + + /** + * @return mixed + */ + public function getNameAttribute() + { + return $this->attributes['post_name']; + } + + /** + * @param $value + */ + public function setTypeAttribute($value) + { + $this->attributes['post_type'] = $value; + } + + /** + * @return mixed + */ + public function getTypeAttribute() + { + return $this->attributes['post_type']; + } + + /** + * @param $value + */ + public function setMimeAttribute($value) + { + $this->attributes['post_mime_type'] = $value; + } + + /** + * @return mixed + */ + public function getMimeAttribute() + { + return $this->attributes['post_mime_type']; + } + + /* + * Scopes + */ + + /** + * @param $query + */ + public function scopePublished($query) + { + $query->where('post_status', static::STATUS_PUBLISHED); + } + + /** + * @param $query + */ + public function scopeDraft($query) + { + $query->where('post_status', static::STATUS_DRAFT); + } + + /** + * @param $query + */ + public function scopeCommentsOpen($query) + { + $query->where('comment_status', static::STATUS_OPEN); + } + + /** + * @param $query + */ + public function scopeCommentsClosed($query) + { + $query->where('comment_status', static::STATUS_CLOSED); + } + + /** + * @param $query + */ + public function scopePingOpen($query) + { + $query->where('ping_status', static::STATUS_OPEN); + } + + /** + * @param $query + */ + public function scopePingClosed($query) + { + $query->where('ping_status', static::STATUS_CLOSED); + } +} diff --git a/src/Models/PostMeta.php b/src/Models/PostMeta.php new file mode 100644 index 0000000..ccfef09 --- /dev/null +++ b/src/Models/PostMeta.php @@ -0,0 +1,84 @@ +belongsTo(Post::class); + } + + /* + * Accessors & Mutators + */ + + /** + * @param $value + */ + public function setIdAttribute($value) + { + $this->attributes[$this->primaryKey] = $value; + } + + /** + * @return mixed + */ + public function getIdAttribute() + { + return $this->attributes[$this->primaryKey]; + } + + /** + * @param $value + */ + public function setKeyAttribute($value) + { + $this->attributes['meta_key'] = $value; + } + + /** + * @return mixed + */ + public function getKeyAttribute() + { + return $this->attributes['meta_key']; + } + + /** + * @param $value + */ + public function setValueAttribute($value) + { + $this->attributes['meta_value'] = $value; + } + + /** + * @return mixed + */ + public function getValueAttribute() + { + return $this->attributes['meta_value']; + } +} diff --git a/src/Models/User.php b/src/Models/User.php new file mode 100644 index 0000000..f9ffe9d --- /dev/null +++ b/src/Models/User.php @@ -0,0 +1,198 @@ +hasMany(UserMeta::class, 'user_id', 'ID'); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function meta() + { + return $this->usermeta(); + } + + /* + * Accessors & Mutators + */ + + /** + * @param $value + */ + public function setIdAttribute($value) + { + $this->attributes[$this->primaryKey] = $value; + } + + /** + * @return mixed + */ + public function getIdAttribute() + { + return $this->attributes[$this->primaryKey]; + } + + /** + * @param $value + */ + public function setLoginAttribute($value) + { + $this->attributes['user_login'] = $value; + } + + /** + * @return mixed + */ + public function getLoginAttribute() + { + return $this->attributes['user_login']; + } + + /** + * @param $value + */ + public function setPasswordAttribute($value) + { + $this->attributes['user_pass'] = $value; + } + + /** + * @return mixed + */ + public function getPasswordAttribute() + { + return $this->attributes['user_pass']; + } + + /** + * @param $value + */ + public function setNicenameAttribute($value) + { + $this->attributes['user_nicename'] = $value; + } + + /** + * @return mixed + */ + public function getNicenameAttribute() + { + return $this->attributes['user_nicename']; + } + + /** + * @param $value + */ + public function setEmailAttribute($value) + { + $this->attributes['user_email'] = $value; + } + + /** + * @return mixed + */ + public function getEmailAttribute() + { + return $this->attributes['user_email']; + } + + /** + * @param $value + */ + public function setURLAttribute($value) + { + $this->attributes['user_url'] = $value; + } + + /** + * @return mixed + */ + public function getURLAttribute() + { + return $this->attributes['user_url']; + } + + /** + * @param $value + */ + public function setRegisteredAttribute($value) + { + $this->attributes['user_registered'] = $value; + } + + /** + * @return mixed + */ + public function getRegisteredAttribute() + { + return $this->attributes['user_registered']; + } + + /** + * @param $value + */ + public function setActivationKeyAttribute($value) + { + $this->attributes['user_activation_key'] = $value; + } + + /** + * @return mixed + */ + public function getActivationKeyAttribute() + { + return $this->attributes['user_activation_key']; + } + + /** + * @param $value + */ + public function setStatusAttribute($value) + { + $this->attributes['user_status'] = $value; + } + + /** + * @return mixed + */ + public function getStatusAttribute() + { + return $this->attributes['user_status']; + } +} diff --git a/src/Models/UserMeta.php b/src/Models/UserMeta.php new file mode 100644 index 0000000..a019042 --- /dev/null +++ b/src/Models/UserMeta.php @@ -0,0 +1,84 @@ +belongsTo(User::class); + } + + /* + * Accessors & Mutators + */ + + /** + * @param $value + */ + public function setIdAttribute($value) + { + $this->attributes[$this->primaryKey] = $value; + } + + /** + * @return mixed + */ + public function getIdAttribute() + { + return $this->attributes[$this->primaryKey]; + } + + /** + * @param $value + */ + public function setKeyAttribute($value) + { + $this->attributes['meta_key'] = $value; + } + + /** + * @return mixed + */ + public function getKeyAttribute() + { + return $this->attributes['meta_key']; + } + + /** + * @param $value + */ + public function setValueAttribute($value) + { + $this->attributes['meta_value'] = $value; + } + + /** + * @return mixed + */ + public function getValueAttribute() + { + return $this->attributes['meta_value']; + } +} diff --git a/src/models/Comment.php b/src/models/Comment.php deleted file mode 100644 index d1d1e72..0000000 --- a/src/models/Comment.php +++ /dev/null @@ -1,127 +0,0 @@ -belongsTo('Zae\LaraPress\Post', 'comment_post_ID', 'ID'); - } - - public function user() { - return $this->belongsTo('Zae\LaraPress\User', 'user_id', 'ID'); - } - - public function commentmeta() { - return $this->hasMany('Zae\LaraPress\CommentMeta', 'comment_id', $this->primaryKey); - } - - public function meta() { - return $this->commentmeta(); - } - - public function parent() { - return $this->belongsTo('Zae\LaraPress\Comment', 'comment_parent', $this->primaryKey); - } - - public function children() { - return $this->hasMany('Zae\LaraPress\Comment', 'comment_parent', $this->primaryKey); - } - - /** - * Accessors & Mutators - */ - - public function setIdAttribute($value) { - $this->attributes[$this->primaryKey] = $value; - } - public function getIdAttribute() { - return $this->attributes[$this->primaryKey]; - } - - public function setAuthorAttribute($value) { - $this->attributes['comment_author'] = $value; - } - public function getAuthorAttribute() { - return $this->attributes['comment_author']; - } - - public function setAuthorEmailAttribute($value) { - $this->attributes['comment_author_email'] = $value; - } - public function getAuthorEmailAttribute() { - return $this->attributes['comment_author_email']; - } - - public function setAuthorUrlAttribute($value) { - $this->attributes['comment_author_url'] = $value; - } - public function getAuthorUrlAttribute() { - return $this->attributes['comment_author_url']; - } - - public function setAuthorIPAttribute($value) { - $this->attributes['comment_author_IP'] = $value; - } - public function getAuthorIPAttribute() { - return $this->attributes['comment_author_IP']; - } - - public function setContentAttribute($value) { - $this->attributes['comment_content'] = $value; - } - public function getContentAttribute() { - return $this->attributes['comment_content']; - } - - public function setKarmaAttribute($value) { - $this->attributes['comment_karma'] = $value; - } - public function getKarmaAttribute() { - return $this->attributes['comment_karma']; - } - - public function setApprovedAttribute($value) { - $this->attributes['comment_approved'] = $value; - } - public function getApprovedAttribute() { - return $this->attributes['comment_approved']; - } - - public function setUserAgentAttribute($value) { - $this->attributes['comment_agent'] = $value; - } - public function getUserAgentAttribute() { - return $this->attributes['comment_agent']; - } - - public function setTypeAttribute($value) { - $this->attributes['comment_type'] = $value; - } - public function getTypeAttribute() { - return $this->attributes['comment_type']; - } - - /** - * Scopes - */ - - public function scopeApproved($query) { - return $query->where('comment_approved', true); - } - public function scopeNotApproved($query) { - return $query->where('comment_approved', false); - } - -} diff --git a/src/models/CommentMeta.php b/src/models/CommentMeta.php deleted file mode 100644 index 93880f1..0000000 --- a/src/models/CommentMeta.php +++ /dev/null @@ -1,47 +0,0 @@ -belongsTo('Zae\LaraPress\Comment'); - } - - /** - * Accessors & Mutators - */ - - public function setIdAttribute($value) { - $this->attributes[$this->primaryKey] = $value; - } - public function getIdAttribute() { - return $this->attributes[$this->primaryKey]; - } - - public function setKeyAttribute($value) { - $this->attributes['meta_key'] = $value; - } - public function getKeyAttribute() { - return $this->attributes['meta_key']; - } - - public function setValueAttribute($value) { - $this->attributes['meta_value'] = $value; - } - public function getValueAttribute() { - return $this->attributes['meta_value']; - } - -} diff --git a/src/models/Link.php b/src/models/Link.php deleted file mode 100644 index aeb13e3..0000000 --- a/src/models/Link.php +++ /dev/null @@ -1,23 +0,0 @@ -where('link_visible', 'Y'); - } - public function scopeHidden($query) { - return $query->where('link_visible', 'N'); - } - -} diff --git a/src/models/Option.php b/src/models/Option.php deleted file mode 100644 index 6cc537f..0000000 --- a/src/models/Option.php +++ /dev/null @@ -1,49 +0,0 @@ -attributes[$this->primaryKey] = $value; - } - public function getIdAttribute() { - return $this->attributes[$this->primaryKey]; - } - - public function setKeyAttribute($value) { - $this->attributes['option_name'] = $value; - } - public function getKeyAttribute() { - return $this->attributes['option_name']; - } - - public function setValueAttribute($value) { - $this->attributes['option_value'] = $value; - } - public function getValueAttribute() { - return $this->attributes['option_value']; - } - - /** - * Scopes - */ - - public function scopeAutoload($query) { - return $query->where('autoload', 'yes'); - } - public function scopeNotAutoload($query) { - return $query->where('autoload', 'no'); - } - -} diff --git a/src/models/Post.php b/src/models/Post.php deleted file mode 100644 index 857851c..0000000 --- a/src/models/Post.php +++ /dev/null @@ -1,149 +0,0 @@ -hasMany('Zae\LaraPress\PostMeta'); - } - - public function meta() { - return $this->postmeta(); - } - - public function comments() { - return $this->hasMany('Zae\LaraPress\Comment', 'comment_post_ID', $this->primaryKey); - } - - public function user() { - return $this->belongsTo('Zae\LaraPress\User', 'post_author', 'ID'); - } - - public function author() { - return $this->user(); - } - - public function parent() { - return $this->belongsTo('Zae\LaraPress\Post', 'post_parent', $this->primaryKey); - } - - public function children() { - return $this->hasMany('Zae\LaraPress\Post', 'post_parent', $this->primaryKey); - } - - /** - * Accessors & Mutators - */ - - public function setIdAttribute($value) { - $this->attributes[$this->primaryKey] = $value; - } - public function getIdAttribute() { - return $this->attributes[$this->primaryKey]; - } - - public function setContentAttribute($value) { - $this->attributes['post_content'] = $value; - } - public function getContentAttribute() { - return $this->attributes['post_content']; - } - - public function setTitleAttribute($value) { - $this->attributes['post_title'] = $value; - } - public function getTitleAttribute() { - return $this->attributes['post_title']; - } - - public function setExcerptAttribute($value) { - $this->attributes['post_excerpt'] = $value; - } - public function getExcerptAttribute() { - return $this->attributes['post_excerpt']; - } - - public function setStatusAttribute($value) { - $this->attributes['post_status'] = $value; - } - public function getStatusAttribute() { - return $this->attributes['post_status']; - } - - public function setPasswordAttribute($value) { - $this->attributes['post_password'] = $value; - } - public function getPasswordAttribute() { - return $this->attributes['post_password']; - } - - public function setNameAttribute($value) { - $this->attributes['post_name'] = $value; - } - public function getNameAttribute() { - return $this->attributes['post_name']; - } - - public function setTypeAttribute($value) { - $this->attributes['post_type'] = $value; - } - public function getTypeAttribute() { - return $this->attributes['post_type']; - } - - public function setMimeAttribute($value) { - $this->attributes['post_mime_type'] = $value; - } - public function getMimeAttribute() { - return $this->attributes['post_mime_type']; - } - - /** - * Scopes - */ - - public function scopePublished($query) { - return $query->where('post_status', self::STATUS_PUBLISHED); - } - public function scopeDraft($query) { - return $query->where('post_status', self::STATUS_DRAFT); - } - - public function scopeCommentsOpen($query) { - return $query->where('comment_status', self::STATUS_OPEN); - } - public function scopeCommentsClosed($query) { - return $query->where('comment_status', self::STATUS_CLOSED); - } - - public function scopePingOpen($query) { - return $query->where('ping_status', self::STATUS_OPEN); - } - public function scopePingClosed($query) { - return $query->where('ping_status', self::STATUS_CLOSED); - } - -} diff --git a/src/models/PostMeta.php b/src/models/PostMeta.php deleted file mode 100644 index 45717a4..0000000 --- a/src/models/PostMeta.php +++ /dev/null @@ -1,47 +0,0 @@ -belongsTo('Zae\LaraPress\Post'); - } - - /** - * Accessors & Mutators - */ - - public function setIdAttribute($value) { - $this->attributes[$this->primaryKey] = $value; - } - public function getIdAttribute() { - return $this->attributes[$this->primaryKey]; - } - - public function setKeyAttribute($value) { - $this->attributes['meta_key'] = $value; - } - public function getKeyAttribute() { - return $this->attributes['meta_key']; - } - - public function setValueAttribute($value) { - $this->attributes['meta_value'] = $value; - } - public function getValueAttribute() { - return $this->attributes['meta_value']; - } - -} diff --git a/src/models/User.php b/src/models/User.php deleted file mode 100644 index b27e4ee..0000000 --- a/src/models/User.php +++ /dev/null @@ -1,91 +0,0 @@ -hasMany('Zae\LaraPress\UserMeta', 'user_id', 'ID'); - } - - public function meta() { - return $this->usermeta(); - } - - /** - * Accessors & Mutators - */ - - public function setIdAttribute($value) { - $this->attributes[$this->primaryKey] = $value; - } - public function getIdAttribute() { - return $this->attributes[$this->primaryKey]; - } - - public function setLoginAttribute($value) { - $this->attributes['user_login'] = $value; - } - public function getLoginAttribute() { - return $this->attributes['user_login']; - } - - public function setPasswordAttribute($value) { - $this->attributes['user_pass'] = $value; - } - public function getPasswordAttribute() { - return $this->attributes['user_pass']; - } - - public function setNicenameAttribute($value) { - $this->attributes['user_nicename'] = $value; - } - public function getNicenameAttribute() { - return $this->attributes['user_nicename']; - } - - public function setEmailAttribute($value) { - $this->attributes['user_email'] = $value; - } - public function getEmailAttribute() { - return $this->attributes['user_email']; - } - - public function setURLAttribute($value) { - $this->attributes['user_url'] = $value; - } - public function getURLAttribute() { - return $this->attributes['user_url']; - } - - public function setRegisteredAttribute($value) { - $this->attributes['user_registered'] = $value; - } - public function getRegisteredAttribute() { - return $this->attributes['user_registered']; - } - - public function setActivationKeyAttribute($value) { - $this->attributes['user_activation_key'] = $value; - } - public function getActivationKeyAttribute() { - return $this->attributes['user_activation_key']; - } - - public function setStatusAttribute($value) { - $this->attributes['user_status'] = $value; - } - public function getStatusAttribute() { - return $this->attributes['user_status']; - } -} \ No newline at end of file diff --git a/src/models/UserMeta.php b/src/models/UserMeta.php deleted file mode 100644 index d4ae0ad..0000000 --- a/src/models/UserMeta.php +++ /dev/null @@ -1,47 +0,0 @@ -belongsTo('Zae\LaraPress\User'); - } - - /** - * Accessors & Mutators - */ - - public function setIdAttribute($value) { - $this->attributes[$this->primaryKey] = $value; - } - public function getIdAttribute() { - return $this->attributes[$this->primaryKey]; - } - - public function setKeyAttribute($value) { - $this->attributes['meta_key'] = $value; - } - public function getKeyAttribute() { - return $this->attributes['meta_key']; - } - - public function setValueAttribute($value) { - $this->attributes['meta_value'] = $value; - } - public function getValueAttribute() { - return $this->attributes['meta_value']; - } - -}