Fixed: Store subactivity for member
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2021-08-22 21:40:27 +02:00
parent 6f376b7f91
commit 55fd4315ce
1 changed files with 7 additions and 3 deletions

View File

@ -2,15 +2,16 @@
namespace App\Member; namespace App\Member;
use App\Activity;
use App\Confession;
use App\Group;
use App\Subactivity;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Zoomyboy\LaravelNami\Nami; use Zoomyboy\LaravelNami\Nami;
use App\Confession;
use App\Group;
use App\Activity;
class CreateJob implements ShouldQueue class CreateJob implements ShouldQueue
{ {
@ -77,6 +78,9 @@ class CreateJob implements ShouldQueue
foreach ($memberships as $membership) { foreach ($memberships as $membership) {
$this->member->memberships()->create([ $this->member->memberships()->create([
'activity_id' => Activity::nami($membership['activity_id'])->id, 'activity_id' => Activity::nami($membership['activity_id'])->id,
'subactivity_id' => $membership['subactivity_id']
? Subactivity::nami($membership['subactivity_id'])->id
: null,
'group_id' => Group::nami($membership['group_id'])->id, 'group_id' => Group::nami($membership['group_id'])->id,
'nami_id' => $membership['id'], 'nami_id' => $membership['id'],
'created_at' => $membership['starts_at'], 'created_at' => $membership['starts_at'],