WIP on loan order
This commit is contained in:
@@ -2,6 +2,19 @@
|
||||
|
||||
namespace App\Nova\Resources\Order\Loan\Concerns;
|
||||
|
||||
use App\Models\Branch\Branch;
|
||||
use Closure;
|
||||
|
||||
class LoanOrderNovaRepo
|
||||
{
|
||||
public function fillUniqueId(): Closure
|
||||
{
|
||||
return function ($request, $model, $attribute, $requestAttribute) {
|
||||
$model->{$attribute} = mb_strtoupper(sprintf(
|
||||
'%s-%s',
|
||||
Branch::find($request->branch_id)->unique_code,
|
||||
$request->id
|
||||
)) ?? uniqid();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user