45 lines
758 B
PHP
45 lines
758 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use GoldSpecDigital\LaravelEloquentUUID\Database\Eloquent\Uuid;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Source;
|
|
use App\Topic;
|
|
|
|
class Article extends Model
|
|
{
|
|
use Uuid;
|
|
|
|
/**
|
|
* The "type" of the auto-incrementing ID.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $keyType = 'string';
|
|
|
|
/**
|
|
* Indicates if the IDs are auto-incrementing.
|
|
*
|
|
* @var bool
|
|
*/
|
|
public $incrementing = false;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $guarded = [];
|
|
|
|
public function source()
|
|
{
|
|
return $this->belongsTo(Source::class);
|
|
}
|
|
|
|
public function topics()
|
|
{
|
|
return $this->belongsToMany(Topic::class);
|
|
}
|
|
}
|