diff --git a/app/Http/Views/MemberView.php b/app/Http/Views/MemberView.php index 2de82bc7..8415c1e0 100644 --- a/app/Http/Views/MemberView.php +++ b/app/Http/Views/MemberView.php @@ -11,6 +11,7 @@ use App\Payment\Payment; use App\Payment\PaymentResource; use App\Payment\Status; use App\Payment\Subscription; +use App\Region; use App\Subactivity; use Illuminate\Http\Request; @@ -34,6 +35,7 @@ class MemberView 'paymentDefaults' => ['nr' => date('Y')], 'subscriptions' => Subscription::pluck('name', 'id'), 'statuses' => Status::pluck('name', 'id'), + 'regions' => Region::forSelect(), 'activities' => $activities->pluck('name', 'id'), 'courses' => Course::pluck('name', 'id'), 'subactivities' => $activities->map(function (Activity $activity) { diff --git a/app/Region.php b/app/Region.php index c302e9d5..5a9ba256 100644 --- a/app/Region.php +++ b/app/Region.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; class Region extends Model @@ -13,4 +14,9 @@ class Region extends Model public $casts = [ 'is_null' => 'boolean', ]; + + public static function forSelect(): Collection + { + return static::select('id', 'name')->get(); + } }