recca0120 / eloquent-logrotate
laravel eloquent auto create table by daily or weekly or monthly or yearly
v1.0.4
2018-02-09 04:52 UTC
Requires
- php: >=5.5.9
- illuminate/database: ^5.1
Requires (Dev)
- mockery/mockery: ~0.9.4|~1.0
- nesbot/carbon: ~1.20
- phpunit/phpunit: ~4.8|~5.4|~6.1|~7.0
README
INSTALL
composer require recca0120/eloquent-logrotate
HOW TO USE
define model
namespace App; use Illuminate\Database\Eloquent\Model; use Recca0120\EloquentLogrotate\Logrotate; class MonthlyLog extends Model { use Logrotate; /** * $logrotateType: hourly, daily, weekly, monthly, yearly */ protected $logrotateType = 'monthly'; protected function logrotateTableSchema($table) { $table->increments('id'); $table->string('name'); $table->string('email')->unique(); $table->string('password'); $table->timestamps(); } }
it will create database by monthly