[WIP] Store Limit
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class Claim extends Model
|
||||
{
|
||||
@@ -19,6 +20,28 @@ class Claim extends Model
|
||||
'benefit_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function ($model) {
|
||||
try {
|
||||
$model->code = (string) Str::orderedUuid(); // generate uuid
|
||||
} catch (\Exception $e) {
|
||||
abort(500, $e->getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function member()
|
||||
{
|
||||
return $this->belongsTo(Member::class, 'member_id');
|
||||
@@ -38,4 +61,5 @@ class Claim extends Model
|
||||
{
|
||||
return $this->belongsTo(Benefit::class, 'benefit_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user