Fixed: Get all regions
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
92b23244da
commit
81a1989e80
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue