wip
This commit is contained in:
@@ -4,12 +4,17 @@ namespace App\Modules\FilamentPermission\Repositories;
|
||||
|
||||
class FilamentPermissionRepository
|
||||
{
|
||||
public static function hiddenOnCreate(string $context): bool
|
||||
{
|
||||
return $context === 'create';
|
||||
}
|
||||
|
||||
public static function forClients(): bool
|
||||
{
|
||||
return ! user()->isSystemUser();
|
||||
}
|
||||
|
||||
public static function defaultSystemInput(string $context)
|
||||
public static function defaultSystemInput(string $context): bool
|
||||
{
|
||||
if (user()->isSystemUser()) {
|
||||
return false;
|
||||
|
||||
@@ -154,20 +154,11 @@ class LoanOrder extends Model implements BelongsToBranch, HasStatus
|
||||
/**
|
||||
* "boot" method for model
|
||||
*/
|
||||
protected static function boot()
|
||||
protected static function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(LoanOrderRepository::creating());
|
||||
static::created(LoanOrderRepository::created());
|
||||
// static::updated(function (LoanOrder $model) {
|
||||
// if ($model->notes && $model->wasChanged('notes')) {
|
||||
// Alert::create([
|
||||
// 'user_id' => $model->user_id,
|
||||
// 'name' => 'Duýdyryş',
|
||||
// 'value' => $model->notes,
|
||||
// ]);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
namespace App\Modules\LoanPaidOffLetter\Models;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Modules\Branch\Interfaces\BelongsToBranch;
|
||||
use App\Modules\Branch\Models\Branch;
|
||||
use App\Modules\LoanOrder\Repositories\LoanOrderRepository;
|
||||
use App\Modules\OrderStatus\Interfaces\HasStatus;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
@@ -30,7 +33,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
* @property \Illuminate\Support\Carbon $created_at
|
||||
* @property \Illuminate\Support\Carbon $updated_at
|
||||
*/
|
||||
class LoanPaidOffLetter extends Model
|
||||
class LoanPaidOffLetter extends Model implements BelongsToBranch, HasStatus
|
||||
{
|
||||
protected $table = 'loan_paid_off_letters';
|
||||
|
||||
@@ -58,4 +61,15 @@ class LoanPaidOffLetter extends Model
|
||||
{
|
||||
return $this->belongsTo(Branch::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* "boot" method for model
|
||||
*/
|
||||
protected static function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(LoanOrderRepository::creating());
|
||||
static::created(LoanOrderRepository::created());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user