feat: add breath colors

This commit is contained in:
2026-06-16 18:52:25 +03:30
parent 81ac4a896f
commit 42f3808343
9 changed files with 206 additions and 8 deletions
+16
View File
@@ -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',
];
}
+6 -1
View File
@@ -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()