Update
This commit is contained in:
78
app/Models/Meme.php
Normal file
78
app/Models/Meme.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\Tags\HasTags;
|
||||
|
||||
/**
|
||||
* Class Meme
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $type
|
||||
* @property int|null $category_id
|
||||
* @property int|null $user_id
|
||||
* @property int|null $meme_id
|
||||
* @property int|null $background_id
|
||||
* @property string $status
|
||||
* @property string $prompt
|
||||
* @property string|null $caption
|
||||
* @property string|null $meme_keywords
|
||||
* @property string|null $background
|
||||
* @property string $keywords
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $deleted_at
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Meme extends Model
|
||||
{
|
||||
use SoftDeletes, HasTags;
|
||||
|
||||
protected $table = 'memes';
|
||||
|
||||
protected $casts = [
|
||||
|
||||
'is_system' => 'boolean',
|
||||
|
||||
'category_id' => 'int',
|
||||
'user_id' => 'int',
|
||||
'meme_id' => 'int',
|
||||
'background_id' => 'int',
|
||||
|
||||
'meme_keywords' => 'array',
|
||||
'keywords' => 'array',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'type',
|
||||
'is_system',
|
||||
'category_id',
|
||||
'user_id',
|
||||
'meme_id',
|
||||
'background_id',
|
||||
'status',
|
||||
'prompt',
|
||||
'caption',
|
||||
'meme_keywords',
|
||||
'background',
|
||||
'keywords'
|
||||
];
|
||||
|
||||
public function meme_media()
|
||||
{
|
||||
return $this->hasOne(MemeMedia::class, 'id', 'meme_id');
|
||||
}
|
||||
|
||||
public function background_media()
|
||||
{
|
||||
return $this->hasOne(BackgroundMedia::class, 'id', 'background_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user