- require composer kwaadpepper/enum - User->role is now an enum - Add isLocal and isAdmin to user model - changed multiple fields casts on model Settings - added validation for settings
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Settings extends Model
|
|
{
|
|
/**
|
|
* The attributes that should be cast to native types.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'start_date' => 'datetime',
|
|
'end_date' => 'datetime',
|
|
'activated_teaser' => 'bool',
|
|
'use_ean_codes' => 'bool',
|
|
'activated_close_page' => 'bool',
|
|
'notification_emails' => 'array',
|
|
'web_coupons' => 'array',
|
|
'close_page_active_date' => 'datetime'
|
|
];
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'name', 'start_date', 'nb_participation_player',
|
|
'nb_participation_ip', 'nb_unique_code_use',
|
|
'use_ean_codes', 'activated_teaser', 'activated_close_page',
|
|
'redirect_close', 'winning_proof', 'reductions_activated',
|
|
'facebook_activated', 'company', 'facebook_app_id', 'facebook_secret',
|
|
'analytics', 'reductions_site', 'reductions_campaign',
|
|
'notification_emails', 'start_date', 'end_date', 'close_page_active_date',
|
|
'web_coupons'
|
|
];
|
|
}
|