Download the PHP package binbytes/laravel-model-media-backup without Composer
On this page you can find all versions of the php package binbytes/laravel-model-media-backup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download binbytes/laravel-model-media-backup
More information about binbytes/laravel-model-media-backup
Files in binbytes/laravel-model-media-backup
Package laravel-model-media-backup
Short Description Take media backup for model in Laravel.
License MIT
Homepage https://github.com/binbytes/laravel-model-media-backup
Informations about the package laravel-model-media-backup
Laravel Model Media Backup
Take newly added media backup associated with any model rather than full backup on daily basis.
This package will be useful in the case where you have lot of media/attachment with any models but rather than taking all media directories each day it might be better to just take newly added media.
BinBytes is an web & mobile application development agency in Rajkot, India. You'll find an overview of all our services on our website.
Installation
You can install this package via composer using:
The package will automatically register itself.
To publish the config file to config/modelmediabackup.php
run:
This will publish a file modelmediabackup.php
in your config directory with the following contents:
Usage
After you've installed the package and filled in the values in the config-file, you need to setup model from which you want to take media.
Your Eloquent models should use the BinBytes\ModelMediaBackup\Traits\HasBackupRecord
trait.
The trait contains an abstract method backupFiles()
that you must implement yourself.
Here's an example of how to implement the trait:
Want to take records as per own strategy? according to your need? No problem! By default the records of yesterday will be taken for backup.
Now you are ready to go, just run below artisan command to take backup
To run backup on daily basis add this in App\Console\Kernel
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
License
MIT License. Please see the license file for more information.