PHPackages                             aaronheath/laravel-model-copy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. aaronheath/laravel-model-copy

ActiveLibrary[Database &amp; ORM](/categories/database)

aaronheath/laravel-model-copy
=============================

Copy one Laravel Eloquent model from one table to another.

1.1.1(3y ago)11.4k2[1 PRs](https://github.com/aaronheath/laravel-model-copy/pulls)MITPHPPHP ^7.4|^8.0

Since Oct 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/aaronheath/laravel-model-copy)[ Packagist](https://packagist.org/packages/aaronheath/laravel-model-copy)[ Docs](https://github.com/aaronheath/laravel-model-copy)[ RSS](/packages/aaronheath-laravel-model-copy/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (8)Dependencies (6)Versions (14)Used By (0)

Laravel Model Copy
==================

[](#laravel-model-copy)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cb4ab34cb7f24694cb04b95213dcd8e435a226a2ac36e48c3af3c04e220b2324/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6161726f6e68656174682f6c61726176656c2d6d6f64656c2d636f70792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aaronheath/laravel-model-copy)[![GitHub Tests Action Status](https://camo.githubusercontent.com/355279da63c64e20c4cc7f16fec1d0c75596623cdf4b9596426a34f49f4c7580/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6161726f6e68656174682f6c61726176656c2d6d6f64656c2d636f70792f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/aaronheath/laravel-model-copy/actions?query=workflow%3Arun-tests+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/62022115d94ff1cf5d2902ebed84577f38427c8eebef721ec9180a18e3b177fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6461726f6e68656174682f6c61726176656c2d6d6f64656c2d636f70792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aaronheath/laravel-model-copy)

Laravel model copy helps you copy, move records from one database table to another. This solution is designed for moving un-needed records to another table in a safe manner which can then be backed-up and, if need, truncated.

The package is also able to assist in performing batch model deletions over using the same conditions as are made available when copying models.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require aaronheath/laravel-model-copy
```

Usage
-----

[](#usage)

The package can be used in one of three ways:

- A) Copy or move an individual model.
- B) Batch copy or move many models from a query.
- C) Batch deletion of models from a query.

### Copy or move individual model

[](#copy-or-move-individual-model)

Copying an individual model is as easy as...

```
