From: Vincent Vanwaelscappel Date: Wed, 11 Mar 2020 18:48:26 +0000 (+0100) Subject: wip #3490 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3bcfae0b65314fd081e74284b8445a3660d8d64f;p=cubist_cms-back.git wip #3490 --- diff --git a/src/app/Magic/Controllers/CubistMagicController.php b/src/app/Magic/Controllers/CubistMagicController.php index 426787c..f3c1e77 100644 --- a/src/app/Magic/Controllers/CubistMagicController.php +++ b/src/app/Magic/Controllers/CubistMagicController.php @@ -31,6 +31,8 @@ class CubistMagicController extends CubistCrudController protected $_oneInstance; protected $_nested = false; + protected $hidden=[]; + public function _postSetModel() { @@ -119,8 +121,10 @@ class CubistMagicController extends CubistCrudController $field = Field::getInstance($field); } if (!$field->getAttribute('fillable', true)) { - $field->setAttribute('type','hidden'); - $field->setAttribute('type','hidden'); + $field->setAttribute('type', 'hidden'); + } + if ($field->getAttribute('hidden', false)) { + $this->hidden[] = $field->getAttribute('name'); } /** @var $field Field */ if ($field->isDisplayColumn()) { diff --git a/src/app/Magic/Models/CubistMagicAuthenticatable.php b/src/app/Magic/Models/CubistMagicAuthenticatable.php index fa23dad..db1cfc6 100644 --- a/src/app/Magic/Models/CubistMagicAuthenticatable.php +++ b/src/app/Magic/Models/CubistMagicAuthenticatable.php @@ -3,6 +3,7 @@ namespace Cubist\Backpack\app\Magic\Models; +use Backpack\CRUD\app\Notifications\ResetPasswordNotification; use Illuminate\Auth\Authenticatable; use Illuminate\Auth\MustVerifyEmail; use Illuminate\Auth\Passwords\CanResetPassword; @@ -44,4 +45,13 @@ class CubistMagicAuthenticatable extends CubistMagicAbstractModel { return $this->email; } + + public function setFields() + { + parent::setFields(); + + $this->addField(['name' => 'remember_token', + 'type' => 'Text', + 'hidden' => true]); + } }