Homparty dev

This commit is contained in:
Kevin Adametz 2020-12-16 20:03:51 +01:00
parent 9252094a04
commit ac0d5b781e
60 changed files with 3443 additions and 293 deletions

View file

@ -51,6 +51,12 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereUpdatedAt($value)
* @mixin \Eloquent
* @property string|null $token
* @property bool|null $token_active
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\HomepartyUser[] $homeparty_guests
* @property-read int|null $homeparty_guests_count
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereToken($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereTokenActive($value)
*/
class Homeparty extends Model
{
@ -62,13 +68,18 @@ class Homeparty extends Model
'status' => 'int',
'order_to' => 'bool',
'active' => 'bool',
'default' => 'bool'
'default' => 'bool',
'token_active' => 'bool'
];
protected $dates = [
'date'
];
protected $hidden = [
'token'
];
protected $fillable = [
'auth_user_id',
'date',
@ -80,7 +91,9 @@ class Homeparty extends Model
'status',
'order_to',
'active',
'default'
'default',
'token',
'token_active',
];
public function auth_user()
@ -116,5 +129,9 @@ class Homeparty extends Model
{
$this->attributes['date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL;
}
public function getTokenLink(){
return url('homeparty/'.$this->token);
}
}