35 lines
616 B
PHP
35 lines
616 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Pelanggan extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'pelanggans';
|
|
|
|
protected $fillable = [
|
|
'nama_pemesan',
|
|
'email',
|
|
'no_tlpn',
|
|
'template_id',
|
|
'form',
|
|
'harga',
|
|
'status',
|
|
'invitation_code',
|
|
];
|
|
|
|
protected $casts = [
|
|
'form' => 'array',
|
|
'harga' => 'decimal:2',
|
|
];
|
|
|
|
public function template()
|
|
{
|
|
return $this->belongsTo(Template::class, 'template_id');
|
|
}
|
|
}
|