This commit is contained in:
denisdulici 2018-04-27 17:42:45 +03:00
parent 4b56001806
commit 7a595608d5
6 changed files with 11 additions and 11 deletions

View File

@ -7,20 +7,20 @@ use App\Models\Model;
class Recurring extends Model
{
protected $table = 'recurrings';
protected $table = 'recurring';
/**
* Attributes that should be mass-assignable.
*
* @var array
*/
protected $fillable = ['company_id', 'recurrable_id', 'recurrable_type', 'frequency', 'interval', 'started_at', 'count'];
protected $fillable = ['company_id', 'recurable_id', 'recurable_type', 'frequency', 'interval', 'started_at', 'count'];
/**
* Get all of the owning recurrable models.
*/
public function recurrable()
public function recurable()
{
return $this->morphTo();
}

View File

@ -88,7 +88,7 @@ class Bill extends Model
public function recurring()
{
return $this->morphOne('App\Models\Common\Recurring', 'recurrable');
return $this->morphOne('App\Models\Common\Recurring', 'recurable');
}
public function status()

View File

@ -69,7 +69,7 @@ class Payment extends Model
public function recurring()
{
return $this->morphOne('App\Models\Common\Recurring', 'recurrable');
return $this->morphOne('App\Models\Common\Recurring', 'recurable');
}
public function transfers()

View File

@ -94,7 +94,7 @@ class Invoice extends Model
public function recurring()
{
return $this->morphOne('App\Models\Common\Recurring', 'recurrable');
return $this->morphOne('App\Models\Common\Recurring', 'recurable');
}
public function status()

View File

@ -80,7 +80,7 @@ class Revenue extends Model
public function recurring()
{
return $this->morphOne('App\Models\Common\Recurring', 'recurrable');
return $this->morphOne('App\Models\Common\Recurring', 'recurable');
}
public function transfers()

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateRecurringsTable extends Migration
class CreateRecurringTable extends Migration
{
/**
* Run the migrations.
@ -12,10 +12,10 @@ class CreateRecurringsTable extends Migration
*/
public function up()
{
Schema::create('recurrings', function (Blueprint $table) {
Schema::create('recurring', function (Blueprint $table) {
$table->increments('id');
$table->integer('company_id');
$table->morphs('recurrable');
$table->morphs('recurable');
$table->string('frequency');
$table->integer('interval')->default(1);
$table->date('started_at');
@ -32,6 +32,6 @@ class CreateRecurringsTable extends Migration
*/
public function down()
{
Schema::drop('recurrings');
Schema::drop('recurring');
}
}