1 | $this ->devices()->withPivot()->get(); |
1 | $user ->devices()->orderBy( 'pivot_updated_at' , 'desc' )->paginate(); |
1 2 3 4 | $this ->devices()->updateExistingPivot( $deviceId , [ 'status' => 'active' , 'updated_at' => Carbon::now(), ]); |
1 2 3 4 | $this ->devices()->newPivotStatement() ->where( 'user_id' , $userId ) ->whereIn( 'device_id' , $deviceIds ) ->update([ 'status' => 'inactive' ]); |
No comments:
Post a Comment