Pony.fm/app/Models/AlexaSession.php

44 lines
1.1 KiB
PHP
Raw Normal View History

2016-09-30 23:21:17 +02:00
<?php
2021-02-14 03:34:58 +01:00
namespace App\Models;
2016-09-30 23:21:17 +02:00
use Illuminate\Database\Eloquent\Model;
2016-12-10 17:47:49 +01:00
/**
2021-02-14 03:34:58 +01:00
* App\Models\AlexaSession
2016-12-10 17:47:49 +01:00
*
* @property string $id
* @property string $payload
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
2021-02-14 03:34:58 +01:00
* @method static \Illuminate\Database\Query\Builder|\App\Models\AlexaSession whereId($value)
* @method static \Illuminate\Database\Query\Builder|\App\Models\AlexaSession wherePayload($value)
* @method static \Illuminate\Database\Query\Builder|\App\Models\AlexaSession whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\App\Models\AlexaSession whereUpdatedAt($value)
2016-12-10 17:47:49 +01:00
* @mixin \Eloquent
*/
2016-09-30 23:21:17 +02:00
class AlexaSession extends Model
{
public $incrementing = false;
protected $table = 'alexa_session';
protected $casts = [
'payload' => 'array'
];
public function put($key, $value)
{
$payload = $this->payload;
$payload[$key] = $value;
$this->payload = $payload;
}
public function get($key, $default = null)
{
return $this->payload[$key] ?? $default;
}
}