ldc-op-insta/app/Models/InstaMedia.php

51 lines
1.4 KiB
PHP
Raw Normal View History

2023-02-28 12:27:16 +01:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\AsStringable;
2023-02-28 12:27:16 +01:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $insta_id A unique instagram id that can be used for api calls.
* @property string $type The instagram object type, commonly IMAGE or CAROUSEL_ALBUM.
* @property string $username The instagram user name, scrapped using OG description.
* @property string $caption The object text content.
* @property string $permalink The uri where is stored the Instagram object.
* @property \Carbon\Carbon $timestamp UTC timestamp from instagram api.
* @property integer $comments_count The number of comments.
* @property null|integer $like_count The number of likes.
* @package App\Models
*/
2023-02-28 12:27:16 +01:00
class InstaMedia extends Model
{
use HasFactory;
/**
* $fillable
2023-04-13 12:17:23 +02:00
*
2023-02-28 12:27:16 +01:00
* @var string[]
*/
protected $fillable = [
'insta_id',
'type',
'username',
'caption',
2023-02-28 12:27:16 +01:00
'permalink',
'timestamp',
2023-04-11 10:43:05 +02:00
'comments_count',
'like_count'
2023-02-28 12:27:16 +01:00
];
/**
* The attributes that should be cast.
*
* @var string[]
*/
protected $casts = [
'caption' => AsStringable::class,
'permalink' => AsStringable::class,
'timestamp' => 'immutable_datetime'
];
2023-02-28 12:27:16 +01:00
}