mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Use new accessory checkout relationship
This commit is contained in:
parent
f2b78d18a4
commit
94e00b8a3e
|
@ -3,6 +3,7 @@
|
|||
namespace Feature\Users\Ui\BulkActions;
|
||||
|
||||
use App\Models\Accessory;
|
||||
use App\Models\AccessoryCheckout;
|
||||
use App\Models\Asset;
|
||||
use App\Models\Consumable;
|
||||
use App\Models\License;
|
||||
|
@ -230,10 +231,9 @@ class BulkDeleteUsersTest extends TestCase
|
|||
private function attachAccessoryToUsers(Accessory $accessory, array $users): void
|
||||
{
|
||||
foreach ($users as $user) {
|
||||
$accessory->users()->attach($accessory->id, [
|
||||
'accessory_id' => $accessory->id,
|
||||
'assigned_to' => $user->id,
|
||||
]);
|
||||
$a = $accessory->checkouts()->make();
|
||||
$a->assignedTo()->associate($user);
|
||||
$a->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue