'decimal:2', 'budget_max' => 'decimal:2', 'is_active' => 'boolean' ]; ======= 'user_id', 'name', 'prompt_template', 'is_active', ]; protected $casts = [ 'is_active' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; // Связь с пользователем (если шаблон пользовательский) public function user() { return $this->belongsTo(User::class); } // Общие (глобальные) шаблоны — где user_id IS NULL public function scopeGlobal($query) { return $query->whereNull('user_id'); } // Активные шаблоны public function scopeActive($query) { return $query->where('is_active', true); } >>>>>>> origin/main }