Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

Commit

Permalink
Fillable fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mlantz committed May 2, 2017
1 parent c69a7cc commit 8aa3cb6
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 45 deletions.
7 changes: 2 additions & 5 deletions src/Models/Blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ class Blog extends QuarxModel

public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$keys = array_keys(request()->except('_method', '_token'));

if (count($keys) > count($this->fillable)) {
$this->fillable($keys);
}
$this->fillable(array_values(array_unique(array_merge($this->fillable, $keys))));
parent::__construct($attributes);
}

public function getEntryAttribute($value)
Expand Down
7 changes: 2 additions & 5 deletions src/Models/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ class Event extends QuarxModel

public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$keys = array_keys(request()->except('_method', '_token'));

if (count($keys) > count($this->fillable)) {
$this->fillable($keys);
}
$this->fillable(array_values(array_unique(array_merge($this->fillable, $keys))));
parent::__construct($attributes);
}

public function getDetailsAttribute($value)
Expand Down
7 changes: 2 additions & 5 deletions src/Models/FAQ.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ class FAQ extends QuarxModel

public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$keys = array_keys(request()->except('_method', '_token'));

if (count($keys) > count($this->fillable)) {
$this->fillable($keys);
}
$this->fillable(array_values(array_unique(array_merge($this->fillable, $keys))));
parent::__construct($attributes);
}
}
7 changes: 2 additions & 5 deletions src/Models/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ class File extends QuarxModel

public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$keys = array_keys(request()->except('_method', '_token'));

if (count($keys) > count($this->fillable)) {
$this->fillable($keys);
}
$this->fillable(array_values(array_unique(array_merge($this->fillable, $keys))));
parent::__construct($attributes);
}
}
7 changes: 2 additions & 5 deletions src/Models/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ class Image extends QuarxModel

public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$keys = array_keys(request()->except('_method', '_token'));

if (count($keys) > count($this->fillable)) {
$this->fillable($keys);
}
$this->fillable(array_values(array_unique(array_merge($this->fillable, $keys))));
parent::__construct($attributes);
}

/**
Expand Down
7 changes: 2 additions & 5 deletions src/Models/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ class Link extends QuarxModel

public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$keys = array_keys(request()->except('_method', '_token'));

if (count($keys) > count($this->fillable)) {
$this->fillable($keys);
}
$this->fillable(array_values(array_unique(array_merge($this->fillable, $keys))));
parent::__construct($attributes);
}
}
7 changes: 2 additions & 5 deletions src/Models/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ class Menu extends QuarxModel

public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$keys = array_keys(request()->except('_method', '_token'));

if (count($keys) > count($this->fillable)) {
$this->fillable($keys);
}
$this->fillable(array_values(array_unique(array_merge($this->fillable, $keys))));
parent::__construct($attributes);
}
}
7 changes: 2 additions & 5 deletions src/Models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ class Page extends QuarxModel

public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$keys = array_keys(request()->except('_method', '_token'));

if (count($keys) > count($this->fillable)) {
$this->fillable($keys);
}
$this->fillable(array_values(array_unique(array_merge($this->fillable, $keys))));
parent::__construct($attributes);
}

public function getEntryAttribute($value)
Expand Down
7 changes: 2 additions & 5 deletions src/Models/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ class Widget extends QuarxModel

public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$keys = array_keys(request()->except('_method', '_token'));

if (count($keys) > count($this->fillable)) {
$this->fillable($keys);
}
$this->fillable(array_values(array_unique(array_merge($this->fillable, $keys))));
parent::__construct($attributes);
}
}

0 comments on commit 8aa3cb6

Please sign in to comment.