Support the ongoing development of Laravel.io →
Requests Eloquent Validation
Last updated 1 year ago.
0

Should I presume that is the better way? :P

0

well, maybe just to make it more readable, you can split that long line:

$input = $request->except('image_URL');
$input['image_URL'] = $imageName;
Child::create($input)->parents()->attach(Auth::user()->id);

I don't think you should encrease performance for this single action. It is not used in foreach loop with thousands of iterations or something like this.

0

Yes, you're right! :) Thank you

0

Sign in to participate in this thread!

Eventy

Your banner here too?

LonnyX lonnyx Joined 30 Mar 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.