feat: add breath colors
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class BreathingColor extends Model
|
||||
{
|
||||
protected $fillable = ['name', 'colors', 'order', 'is_active'];
|
||||
|
||||
protected $casts = [
|
||||
'colors' => 'array',
|
||||
'is_active' => 'boolean',
|
||||
'order' => 'integer',
|
||||
];
|
||||
}
|
||||
@@ -8,12 +8,17 @@
|
||||
class BreathingTemplate extends Model
|
||||
{
|
||||
use HasSaves;
|
||||
protected $fillable = ['user_id', 'name', 'inhale', 'exhale', 'breath_hold' , 'duration' , 'description','image_id' , 'source'];
|
||||
protected $fillable = ['user_id', 'name', 'inhale', 'exhale', 'breath_hold' , 'duration' , 'description','image_id' , 'source', 'breathing_color_id'];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function breathingColor()
|
||||
{
|
||||
return $this->belongsTo(BreathingColor::class);
|
||||
}
|
||||
protected $appends = ['image_url', 'is_saved','saved_count'];
|
||||
|
||||
public function getImageUrlAttribute()
|
||||
|
||||
Reference in New Issue
Block a user