Fixed: Get all regions
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2022-03-20 12:20:01 +01:00
parent 92b23244da
commit 81a1989e80
2 changed files with 8 additions and 0 deletions

View File

@ -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) {

View File

@ -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();
}
}