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

50 lines
1.4 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\AsStringable;
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
*/
class InstaMedia extends Model
{
use HasFactory;
/**
* $fillable
*
* @var string[]
*/
protected $fillable = [
'insta_id',
'type',
'username',
'caption',
'permalink',
'timestamp',
'comments_count',
'like_count'
];
/**
* The attributes that should be cast.
*
* @var string[]
*/
protected $casts = [
'caption' => AsStringable::class,
'permalink' => AsStringable::class,
'timestamp' => 'immutable_datetime'
];
}