We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello this is the following update method:
`public function updateProfile(ProfileRequest $request, Profile $profile) { try { \DB::beginTransaction();
$profile = new Profile; $input = [ $this->profileInput(), ]; $index = 'id'; /** @var Mavinoo\Batch\Batch $batch */ $batch = batch(); $batch->update($profile, $input, $index); \DB::commit(); session()->flash("message", ["success", __("<h5>Perfil actualizado</h5>")]); return redirect(route('profile', ['profile' => $profile])); } catch (\Throwable $exception) { \DB::rollBack(); session()->flash("message", ["danger", $exception->getMessage()]); return back(); } }`
A new profile create, I have an array of a many to many relationship, for that relationship is saved in the database in the store method, i have:
$profile->hobbies()->sync(request("hobbies"));
putting that line of code in the update method gives me the following error:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'profile_id' cannot be null (SQL: insert into category_profile (category_id, profile_id) values (1, ?))
category_profile
category_id
profile_id
how can i solve it?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello this is the following update method:
`public function updateProfile(ProfileRequest $request, Profile $profile) {
try {
\DB::beginTransaction();
A new profile create, I have an array of a many to many relationship, for that relationship is saved in the database in the store method, i have:
$profile->hobbies()->sync(request("hobbies"));
putting that line of code in the update method gives me the following error:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'profile_id' cannot be null (SQL: insert into
category_profile
(category_id
,profile_id
) values (1, ?))how can i solve it?
The text was updated successfully, but these errors were encountered: