A lot of things.
This commit is contained in:
@@ -2,11 +2,29 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Auth\XenForoUser;
|
||||
use App\Services\XenforoService;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Author extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name', 'slug', 'user_id', 'website'
|
||||
];
|
||||
|
||||
public function entries(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Entry::class, 'entry_authors');
|
||||
}
|
||||
|
||||
public function user(): ?XenForoUser
|
||||
{
|
||||
if( !$this->user_id )
|
||||
return null;
|
||||
|
||||
return app(XenforoService::class)->getXfUser($this->user_id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user