renaming
This commit is contained in:
parent
4b56001806
commit
7a595608d5
@ -7,20 +7,20 @@ use App\Models\Model;
|
|||||||
class Recurring extends Model
|
class Recurring extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $table = 'recurrings';
|
protected $table = 'recurring';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attributes that should be mass-assignable.
|
* Attributes that should be mass-assignable.
|
||||||
*
|
*
|
||||||
* @var array
|
* @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.
|
* Get all of the owning recurrable models.
|
||||||
*/
|
*/
|
||||||
public function recurrable()
|
public function recurable()
|
||||||
{
|
{
|
||||||
return $this->morphTo();
|
return $this->morphTo();
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ class Bill extends Model
|
|||||||
|
|
||||||
public function recurring()
|
public function recurring()
|
||||||
{
|
{
|
||||||
return $this->morphOne('App\Models\Common\Recurring', 'recurrable');
|
return $this->morphOne('App\Models\Common\Recurring', 'recurable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function status()
|
public function status()
|
||||||
|
@ -69,7 +69,7 @@ class Payment extends Model
|
|||||||
|
|
||||||
public function recurring()
|
public function recurring()
|
||||||
{
|
{
|
||||||
return $this->morphOne('App\Models\Common\Recurring', 'recurrable');
|
return $this->morphOne('App\Models\Common\Recurring', 'recurable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function transfers()
|
public function transfers()
|
||||||
|
@ -94,7 +94,7 @@ class Invoice extends Model
|
|||||||
|
|
||||||
public function recurring()
|
public function recurring()
|
||||||
{
|
{
|
||||||
return $this->morphOne('App\Models\Common\Recurring', 'recurrable');
|
return $this->morphOne('App\Models\Common\Recurring', 'recurable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function status()
|
public function status()
|
||||||
|
@ -80,7 +80,7 @@ class Revenue extends Model
|
|||||||
|
|
||||||
public function recurring()
|
public function recurring()
|
||||||
{
|
{
|
||||||
return $this->morphOne('App\Models\Common\Recurring', 'recurrable');
|
return $this->morphOne('App\Models\Common\Recurring', 'recurable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function transfers()
|
public function transfers()
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreateRecurringsTable extends Migration
|
class CreateRecurringTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
@ -12,10 +12,10 @@ class CreateRecurringsTable extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('recurrings', function (Blueprint $table) {
|
Schema::create('recurring', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('company_id');
|
$table->integer('company_id');
|
||||||
$table->morphs('recurrable');
|
$table->morphs('recurable');
|
||||||
$table->string('frequency');
|
$table->string('frequency');
|
||||||
$table->integer('interval')->default(1);
|
$table->integer('interval')->default(1);
|
||||||
$table->date('started_at');
|
$table->date('started_at');
|
||||||
@ -32,6 +32,6 @@ class CreateRecurringsTable extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::drop('recurrings');
|
Schema::drop('recurring');
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user