feat: add whatsapp_number field to suppliers, customers, users
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
de3f4ceae6
commit
92a2eb120f
@ -9,7 +9,7 @@ class Customer extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = ['name', 'contact_person', 'email', 'phone', 'address', 'tax_number', 'credit_limit', 'outstanding_balance', 'is_active'];
|
||||
protected $fillable = ['name', 'contact_person', 'email', 'phone', 'whatsapp_number', 'address', 'tax_number', 'credit_limit', 'outstanding_balance', 'is_active'];
|
||||
|
||||
protected $casts = [
|
||||
'credit_limit' => 'decimal:2',
|
||||
@ -17,6 +17,11 @@ class Customer extends Model
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
|
||||
public function routeNotificationFor(string $channel, mixed $notification = null): ?string
|
||||
{
|
||||
return $this->whatsapp_number;
|
||||
}
|
||||
|
||||
public function salesOrders()
|
||||
{
|
||||
return $this->hasMany(SalesOrder::class);
|
||||
|
||||
@ -12,7 +12,7 @@ class Supplier extends Model
|
||||
protected $fillable = [
|
||||
'supplier_code', 'name', 'category',
|
||||
'contact_person', 'email', 'secondary_email',
|
||||
'phone', 'phone2', 'whatsapp',
|
||||
'phone', 'phone2', 'whatsapp', 'whatsapp_number',
|
||||
'address', 'website',
|
||||
'tax_number', 'credit_terms', 'credit_days',
|
||||
'is_active', 'remarks',
|
||||
@ -20,6 +20,11 @@ class Supplier extends Model
|
||||
|
||||
protected $casts = ['is_active' => 'boolean'];
|
||||
|
||||
public function routeNotificationFor(string $channel, mixed $notification = null): ?string
|
||||
{
|
||||
return $this->whatsapp_number;
|
||||
}
|
||||
|
||||
public function purchaseOrders()
|
||||
{
|
||||
return $this->hasMany(PurchaseOrder::class);
|
||||
|
||||
@ -22,6 +22,7 @@ class User extends Authenticatable
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'whatsapp_number',
|
||||
'password',
|
||||
];
|
||||
|
||||
@ -40,6 +41,11 @@ class User extends Authenticatable
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function routeNotificationFor(string $channel, mixed $notification = null): ?string
|
||||
{
|
||||
return $this->whatsapp_number;
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('customers', function (Blueprint $table) {
|
||||
$table->string('whatsapp_number')->nullable()->after('phone');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('customers', function (Blueprint $table) {
|
||||
$table->dropColumn('whatsapp_number');
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('suppliers', function (Blueprint $table) {
|
||||
$table->string('whatsapp_number')->nullable()->after('phone');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('suppliers', function (Blueprint $table) {
|
||||
$table->dropColumn('whatsapp_number');
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('whatsapp_number')->nullable()->after('email');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('whatsapp_number');
|
||||
});
|
||||
}
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user