/** * Save the role. * * @param \Orchestra\Model\Role $role * @param array $input * @param string $type * * @return bool */ protected function saving(Eloquent $franchise, $request, $type = 'create') { // dd($request->all()); $beforeEvent = $type === 'create' ? 'creating' : 'updating'; $afterEvent = $type === 'create' ? 'created' : 'updated'; $franchise->setAttributes('accredit_category', $request->accredit_category); $franchise->setAttributes('name_franchise', $request->name_franchise); $franchise->setAttributes('name_applicant', $request->name_applicant); $franchise->setAttributes('nationality', $request->nationality); $franchise->setAttributes('passport_nid', $request->passport_nid); $franchise->setAttributes('role', $request->role); $franchise->setAttributes('date_of_birth', $request->date_of_birth); $franchise->setAttributes('country_of_birth', $request->country_of_birth); $franchise->setAttributes('phone', $request->phone); $franchise->setAttributes('passport_expire_date', $request->passport_expire_date); $franchise->setAttributes('noc', $request->accredit_category); $franchise->setAttributes('mail', $request->mail); $franchise->setAttributes('photo', $request->photo); $franchise->setAttributes('attachment', $request->attachment); $franchise->save(); // $franchises->setAttribute('phone', $input['phone']); // $franchises->setAttribute('address', $input['address']); // dd($franchise); // $this->fireEvent($beforeEvent, [$franchise]); // $this->fireEvent('saving', [$franchise]); // DB::transaction(function () use ($franchise) { // // }); // $organization = $franchises->create($request->organization); // $organization->member()->insert($request->officer); // $organization->reporter()->insert($request->reporter); // $this->fireEvent($afterEvent, [$franchise]); // $this->fireEvent('saved', [$franchise]); dd($franchise); return true; }