1
0
Fork 0

Add snowflake ids to Collection models

This commit is contained in:
Daniel Supernault 2019-04-25 19:56:04 -06:00
parent ba8cae362f
commit 4f14a7dd74
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
2 changed files with 20 additions and 0 deletions

View File

@ -3,9 +3,19 @@
namespace App;
use Illuminate\Database\Eloquent\Model;
use Pixelfed\Snowflake\HasSnowflakePrimary;
class Collection extends Model
{
use HasSnowflakePrimary;
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
public function profile()
{
return $this->belongsTo(Profile::class);

View File

@ -3,9 +3,19 @@
namespace App;
use Illuminate\Database\Eloquent\Model;
use Pixelfed\Snowflake\HasSnowflakePrimary;
class CollectionItem extends Model
{
use HasSnowflakePrimary;
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
public function collection()
{
return $this->belongsTo(Collection::class);