Add branch & province model
This commit is contained in:
1 parent
0309e8f7d8
commit
fe68420bab
11 files changed
+490
-5
No files matched your search
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Nova\Resources\Branch\Concerns;
|
||||
|
||||
use App\Models\Branch\Branch;
|
||||
|
||||
class BranchNovaRepo
|
||||
{
|
||||
/**
|
||||
* Depends on region
|
||||
*/
|
||||
public static function dependsOnRegion(): Closure
|
||||
{
|
||||
return function ($field, $request, $formData) {
|
||||
$field->options(
|
||||
$formData->region
|
||||
? Branch::where('region', $formData->region)->pluck('name', 'id')
|
||||
: []
|
||||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user