'decimal:2', 'discount' => 'decimal:2', 'final_amount' => 'decimal:2', 'sent_at' => 'datetime', 'accepted_at' => 'datetime', ]; public function project() { return $this->belongsTo(Project::class); } public function client() { return $this->belongsTo(User::class, 'client_id'); } public function items() { return $this->hasMany(QuotationItem::class); } public static function generateNumber(): string { $year = date('Y'); $last = self::whereYear('created_at', $year)->count() + 1; return 'QUO-' . $year . '-' . str_pad($last, 4, '0', STR_PAD_LEFT); } }