feat: Add customer notes functionality and enhance invoice/order models with date fields
This commit is contained in:
@@ -17,6 +17,7 @@ class Invoice extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
protected $casts = [
|
||||
'date' => 'date',
|
||||
'due_date' => 'date',
|
||||
'paid_at' => 'datetime',
|
||||
'auto_renew' => 'boolean',
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Note extends Model
|
||||
{
|
||||
@@ -14,6 +15,12 @@ class Note extends Model
|
||||
protected $fillable = [
|
||||
'note',
|
||||
'customer_id',
|
||||
'service_id',
|
||||
'user_id'
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,11 @@ class Order extends Model
|
||||
protected $table = 'orders';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
protected $casts = [
|
||||
'date' => 'date',
|
||||
];
|
||||
|
||||
public function customer()
|
||||
{
|
||||
return $this->belongsTo(Customer::class);
|
||||
|
||||
Reference in New Issue
Block a user