[WIP] Store Limit

This commit is contained in:
R
2022-12-05 04:30:00 +07:00
parent 2d5c7b571e
commit f5372e5d0a
19 changed files with 525 additions and 76 deletions

View File

@@ -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');
}
}