Attachment to new model #2511
vinod-digitalcubez
started this conversation in
General
Replies: 1 comment
-
In order to attach existing attachments to the model you can use: use App\Models\User;
use Orchid\Attachment\Models\Attachment;
$user = User::find(1);
$attachment = Attachment::find(1)
$user->attachment()->attach($attachment->id); This is the Elocument relationship you can learn about here: https://laravel.com/docs/9.x/eloquent-relationships#updating-many-to-many-relationships |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
An attachment has already been uploaded and I want to move or copy this attachment with another model table. how can we do this?
Beta Was this translation helpful? Give feedback.
All reactions