diff --git a/app/Models/Common/Recurring.php b/app/Models/Common/Recurring.php index 0640d04e6..bb308c77a 100644 --- a/app/Models/Common/Recurring.php +++ b/app/Models/Common/Recurring.php @@ -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(); } diff --git a/app/Models/Expense/Bill.php b/app/Models/Expense/Bill.php index b46bdcb07..dba2b8044 100644 --- a/app/Models/Expense/Bill.php +++ b/app/Models/Expense/Bill.php @@ -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() diff --git a/app/Models/Expense/Payment.php b/app/Models/Expense/Payment.php index 56a85d43e..d179d5854 100644 --- a/app/Models/Expense/Payment.php +++ b/app/Models/Expense/Payment.php @@ -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() diff --git a/app/Models/Income/Invoice.php b/app/Models/Income/Invoice.php index 04b5b7f98..cbbe8a094 100644 --- a/app/Models/Income/Invoice.php +++ b/app/Models/Income/Invoice.php @@ -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() diff --git a/app/Models/Income/Revenue.php b/app/Models/Income/Revenue.php index 87a794f42..95c3d008b 100644 --- a/app/Models/Income/Revenue.php +++ b/app/Models/Income/Revenue.php @@ -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() diff --git a/database/migrations/2018_04_26_000000_create_recurrings_table.php b/database/migrations/2018_04_26_000000_create_recurring_table.php similarity index 77% rename from database/migrations/2018_04_26_000000_create_recurrings_table.php rename to database/migrations/2018_04_26_000000_create_recurring_table.php index 1d50638d2..0057ca08d 100644 --- a/database/migrations/2018_04_26_000000_create_recurrings_table.php +++ b/database/migrations/2018_04_26_000000_create_recurring_table.php @@ -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'); } }