Triumfator's avatar

Laravel 5.8 image intervention how to name image with its inserted database id #?

What' the best way to rename uploaded image to the auto incremented id value that will be obtained after its filename will be entered in a database table? I'm using image intervention. Do I get next value before naming the file or rename filename after id value has been obtained already?

0 likes
1 reply
Snapey's avatar

create the database record and save it.

use the id now present on the model and save the image

Please or to participate in this conversation.