parfum/app/Models/Customer.php
Yoga Pangestu ac44f25001 feat(customer): membuat module customer
-membuat model, migrasi seeder dan faker
-membuat relasi di user
-membuat test untuk memastikan jalannya aplikasi
2025-09-30 11:20:58 +07:00

29 lines
563 B
PHP

<?php
namespace App\Models;
use App\Enums\Gender;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class Customer extends Model
{
use HasFactory, SoftDeletes;
protected $guarded = ['id'];
protected function casts(): array
{
return [
'gender' => Gender::class,
];
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}