Google2Fa ready to upload

This commit is contained in:
Kevin Adametz 2021-11-09 18:38:44 +01:00
parent e3495be8b8
commit 73e38a006e
127 changed files with 2637 additions and 589 deletions

View file

@ -38,6 +38,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereObject($value)
* @property int|null $pos
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
*/
class CMSContent extends Model
{
@ -82,6 +83,16 @@ class CMSContent extends Model
];
}
public function setNameAttribute($value){
$this->attributes['name'] = $value == '' ? '#empty#' : $value;
}
public function getNameWithEmpty(){
if(!$this->attributes['name']){ return ""; }
return $this->attributes['name'] === '#empty#' ? '' : $this->attributes['name'];
}
public static function getFieldsOptions($setKey = false){
$options = self::$fields;
$ret = "";
@ -229,6 +240,11 @@ class CMSContent extends Model
$this->object = $obj;
}
public static function findObjectsBy($key, $value){
$find = '"'.$key.'":"'.$value.'"';
return CMSContent::where('object', 'LIKE', '%'.$find.'%')->get();
}
public static function getContentBySlug($slug){
$CMSContent = CMSContent::whereSlug(trim($slug))->first();
if($CMSContent){