Skip to content

Commit

Permalink
update files
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jan 8, 2018
1 parent 5788233 commit edc464e
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 13 deletions.
3 changes: 0 additions & 3 deletions app/Http/Controllers/Install/Updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ public function post($alias, $old, $new)
// Clear cache after update
Artisan::call('cache:clear');

// Update database
Artisan::call('migrate', ['--force' => true]);

event(new UpdateFinished($alias, $old, $new));

flash(trans('updates.success'))->success();
Expand Down
2 changes: 2 additions & 0 deletions app/Listeners/Updates/Version113.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ public function handle(UpdateFinished $event)
$currency->save();
}

// Update database
Artisan::call('migrate', ['--force' => true]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
use App\Events\UpdateFinished;
use App\Models\Setting\Currency;

class Version116 extends Listener
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;

class Version117 extends Listener
{
const ALIAS = 'core';

const VERSION = '1.1.6';
const VERSION = '1.1.7';

/**
* Handle the event.
Expand All @@ -24,6 +27,37 @@ public function handle(UpdateFinished $event)
return;
}

Schema::create('media', function (Blueprint $table) {
$table->increments('id');
$table->string('disk', 32);
$table->string('directory');
$table->string('filename');
$table->string('extension', 32);
$table->string('mime_type', 128);
$table->string('aggregate_type', 32);
$table->integer('size')->unsigned();
$table->timestamps();
$table->softDeletes();

$table->index(['disk', 'directory']);
$table->unique(['disk', 'directory', 'filename', 'extension']);
$table->index('aggregate_type');
});

Schema::create('mediables', function (Blueprint $table) {
$table->integer('media_id')->unsigned();
$table->string('mediable_type');
$table->integer('mediable_id')->unsigned();
$table->string('tag');
$table->integer('order')->unsigned();

$table->primary(['media_id', 'mediable_type', 'mediable_id', 'tag']);
$table->index(['mediable_id', 'mediable_type']);
$table->index('tag');
$table->index('order');
$table->foreign('media_id')->references('id')->on('media')->onDelete('cascade');
});

$migrations = [
'\App\Models\Auth\User' => 'picture',
'\App\Models\Item\Item' => 'picture',
Expand Down Expand Up @@ -52,5 +86,8 @@ public function handle(UpdateFinished $event)
}
}
}

// Update database
Artisan::call('migrate', ['--force' => true]);
}
}
2 changes: 1 addition & 1 deletion app/Models/Auth/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class User extends Authenticatable
*
* @var array
*/
protected $fillable = ['name', 'email', 'password', 'locale', 'picture', 'enabled'];
protected $fillable = ['name', 'email', 'password', 'locale', 'enabled'];

/**
* The attributes that should be hidden for arrays.
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Expense/Bill.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Bill extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'bill_number', 'order_number', 'bill_status_code', 'billed_at', 'due_at', 'amount', 'currency_code', 'currency_rate', 'vendor_id', 'vendor_name', 'vendor_email', 'vendor_tax_number', 'vendor_phone', 'vendor_address', 'notes', 'attachment'];
protected $fillable = ['company_id', 'bill_number', 'order_number', 'bill_status_code', 'billed_at', 'due_at', 'amount', 'currency_code', 'currency_rate', 'vendor_id', 'vendor_name', 'vendor_email', 'vendor_tax_number', 'vendor_phone', 'vendor_address', 'notes'];

/**
* Sortable columns.
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Expense/BillPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BillPayment extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'bill_id', 'account_id', 'paid_at', 'amount', 'currency_code', 'currency_rate', 'description', 'payment_method', 'reference', 'attachment'];
protected $fillable = ['company_id', 'bill_id', 'account_id', 'paid_at', 'amount', 'currency_code', 'currency_rate', 'description', 'payment_method', 'reference'];

public function account()
{
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Expense/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Payment extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'account_id', 'paid_at', 'amount', 'currency_code', 'currency_rate', 'vendor_id', 'description', 'category_id', 'payment_method', 'reference', 'attachment'];
protected $fillable = ['company_id', 'account_id', 'paid_at', 'amount', 'currency_code', 'currency_rate', 'vendor_id', 'description', 'category_id', 'payment_method', 'reference'];

/**
* Sortable columns.
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Income/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Invoice extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'invoice_number', 'order_number', 'invoice_status_code', 'invoiced_at', 'due_at', 'amount', 'currency_code', 'currency_rate', 'customer_id', 'customer_name', 'customer_email', 'customer_tax_number', 'customer_phone', 'customer_address', 'notes', 'attachment'];
protected $fillable = ['company_id', 'invoice_number', 'order_number', 'invoice_status_code', 'invoiced_at', 'due_at', 'amount', 'currency_code', 'currency_rate', 'customer_id', 'customer_name', 'customer_email', 'customer_tax_number', 'customer_phone', 'customer_address', 'notes'];

/**
* Sortable columns.
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Income/InvoicePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class InvoicePayment extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'invoice_id', 'account_id', 'paid_at', 'amount', 'currency_code', 'currency_rate', 'description', 'payment_method', 'reference', 'attachment'];
protected $fillable = ['company_id', 'invoice_id', 'account_id', 'paid_at', 'amount', 'currency_code', 'currency_rate', 'description', 'payment_method', 'reference'];

public function account()
{
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Income/Revenue.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Revenue extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'account_id', 'paid_at', 'amount', 'currency_code', 'currency_rate', 'customer_id', 'description', 'category_id', 'payment_method', 'reference', 'attachment'];
protected $fillable = ['company_id', 'account_id', 'paid_at', 'amount', 'currency_code', 'currency_rate', 'customer_id', 'description', 'category_id', 'payment_method', 'reference'];

/**
* Sortable columns.
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Item/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Item extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'name', 'sku', 'description', 'sale_price', 'purchase_price', 'quantity', 'category_id', 'tax_id', 'picture', 'enabled'];
protected $fillable = ['company_id', 'name', 'sku', 'description', 'sale_price', 'purchase_price', 'quantity', 'category_id', 'tax_id', 'enabled'];

/**
* Sortable columns.
Expand Down

0 comments on commit edc464e

Please sign in to comment.