diff --git a/app/Models/Client.php b/app/Models/Client.php index dd13688b0b..d0653b14e5 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -39,7 +39,7 @@ class Client extends BaseModel protected $appends = [ ]; - + /* protected $guarded = [ 'id', 'updated_at', @@ -52,6 +52,37 @@ class Client extends BaseModel 'country', 'shipping_country' ]; + */ + + protected $fillable = [ + 'name', + 'website', + 'private_notes', + 'industry_id', + 'size_id', + 'currency_id', + 'address1', + 'address2', + 'city', + 'state', + 'postal_code', + 'country_id', + 'custom_value1', + 'custom_value2', + 'custom_value3', + 'custom_value4,', + 'shipping_address1', + 'shipping_address2', + 'shipping_city', + 'shipping_state', + 'shipping_postal_code', + 'shipping_country_id', + 'settings', + 'payment_terms', + 'vat_number', + 'id_number', + ]; + /* protected $with = [ 'contacts', diff --git a/app/Models/ClientContact.php b/app/Models/ClientContact.php index 460f41e789..ee9287f26a 100644 --- a/app/Models/ClientContact.php +++ b/app/Models/ClientContact.php @@ -35,8 +35,16 @@ class ClientContact extends Authenticatable protected $dates = ['deleted_at']; - protected $guarded = [ - 'id', + protected $fillable = [ + 'first_name', + 'last_name', + 'phone', + 'custom_value1', + 'custom_value2', + 'custom_value3', + 'custom_value4', + 'email', + 'avatar', ]; protected $hidden = [ diff --git a/app/Models/Company.php b/app/Models/Company.php index 5c1e138acd..144b0c2614 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -44,6 +44,20 @@ class Company extends BaseModel protected $fillable = [ 'name', 'logo', + 'industry_id', + 'address1', + 'address2', + 'city', + 'state', + 'postal_code', + 'work_phone', + 'work_email', + 'country_id', + 'subdomain', + 'vat_number', + 'id_number', + 'size_id', + 'settings', ]; protected $appends = [ diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 4040c7c6aa..2325d298a2 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -48,6 +48,8 @@ class Invoice extends BaseModel 'partial_due_date', 'custom_value1', 'custom_value2', + 'custom_value3', + 'custom_value4', 'custom_taxes1', 'custom_taxes2', 'custom_text_value1', @@ -55,6 +57,7 @@ class Invoice extends BaseModel 'line_items', 'settings', 'client_id', + 'footer', ]; protected $casts = [ diff --git a/app/Models/Payment.php b/app/Models/Payment.php index d9571d7901..6e272c8741 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -27,8 +27,12 @@ class Payment extends BaseModel const STATUS_PARTIALLY_REFUNDED = 5; const STATUS_REFUNDED = 6; - protected $guarded = [ - 'id', + protected $fillable = [ + 'client_id', + 'payment_type_id', + 'amount', + 'payment_date', + 'transaction_reference' ]; public function client() diff --git a/app/Models/Product.php b/app/Models/Product.php index 453e35dcb4..c06fa42140 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -22,12 +22,20 @@ class Product extends BaseModel use SoftDeletes; use Filterable; - protected $guarded = [ - 'id', - 'updated_at', - 'created_at', - 'deleted_at', - 'q', + protected $fillable = [ + 'custom_value1', + 'custom_value2', + 'custom_value3', + 'custom_value4', + 'product_key', + 'notes', + 'cost', + 'price', + 'qty', + 'tax_name1', + 'tax_name2', + 'tax_rate1', + 'tax_rate2', ]; public function company() diff --git a/app/Models/Quote.php b/app/Models/Quote.php index 5bbf74bdd3..a6bd9cbbe2 100644 --- a/app/Models/Quote.php +++ b/app/Models/Quote.php @@ -20,8 +20,31 @@ class Quote extends BaseModel use MakesHash; use Filterable; - protected $guarded = [ - 'id', + protected $fillable = [ + 'client_id', + 'quote_number', + 'discount', + 'is_amount_discount', + 'po_number', + 'quote_date', + 'valid_until', + 'line_items', + 'settings', + 'footer', + 'public_note', + 'private_notes', + 'terms', + 'tax_name1', + 'tax_name2', + 'tax_rate1', + 'tax_rate2', + 'custom_value1', + 'custom_value2', + 'custom_value3', + 'custom_value4', + 'amount', + 'partial', + 'partial_due_date', ]; protected $casts = [ diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index 05cf90b647..41e8b4c2d3 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -52,8 +52,32 @@ class RecurringInvoice extends BaseModel const RECURS_INDEFINITELY = -1; - protected $guarded = [ - 'id', + protected $fillable = [ + 'client_id', + 'invoice_number', + 'discount' + 'is_amount_discount', + 'po_number', + 'invoice_date', + 'due_date', + 'line_items', + 'settings', + 'footer', + 'public_notes' + 'private_notes', + 'terms', + 'tax_name1', + 'tax_name2', + 'tax_rate1', + 'tax_rate2', + 'custom_value1', + 'custom_value2', + 'custom_value3', + 'custom_value4', + 'amount', + 'partial' + 'frequency_id' + 'start_date', ]; protected $casts = [ diff --git a/app/Models/RecurringQuote.php b/app/Models/RecurringQuote.php index d6e7034a24..cd1ef68118 100644 --- a/app/Models/RecurringQuote.php +++ b/app/Models/RecurringQuote.php @@ -51,9 +51,32 @@ class RecurringQuote extends BaseModel const RECURS_INDEFINITELY = -1; - protected $guarded = [ - 'id', - ]; + protected $fillable = [ + 'client_id', + 'quote_number', + 'discount', + 'is_amount_discount', + 'po_number', + 'quote_date', + 'valid_until', + 'line_items', + 'settings', + 'footer', + 'public_note', + 'private_notes', + 'terms', + 'tax_name1', + 'tax_name2', + 'tax_rate1', + 'tax_rate2', + 'custom_value1', + 'custom_value2', + 'custom_value3', + 'custom_value4', + 'amount', + 'frequency_id', + 'start_date', + ]; protected $casts = [ 'settings' => 'object' diff --git a/app/Models/Task.php b/app/Models/Task.php index 7b9b0bb415..6c296a4955 100644 --- a/app/Models/Task.php +++ b/app/Models/Task.php @@ -18,8 +18,14 @@ class Task extends BaseModel { use MakesHash; - protected $guarded = [ - 'id', + protected $fillable = [ + 'client_id', + 'invoice_id', + 'custom_value1', + 'custom_value2', + 'description', + 'is_running', + 'time_log', ]; protected $appends = ['task_id']; diff --git a/app/Models/TaxRate.php b/app/Models/TaxRate.php index 9b257f121d..213b897fac 100644 --- a/app/Models/TaxRate.php +++ b/app/Models/TaxRate.php @@ -18,8 +18,9 @@ class TaxRate extends BaseModel { use MakesHash; - protected $guarded = [ - 'id', + protected $fillable = [ + 'name', + 'rate' ]; protected $appends = ['tax_rate_id'];