Add branch & province model

This commit is contained in:
2023-11-23 15:34:04 +05:00
parent 0309e8f7d8
commit fe68420bab
11 changed files with 490 additions and 5 deletions

View File

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