Pony.fm/app/Models/AlexaSession.php

31 lines
523 B
PHP
Raw Normal View History

2016-09-30 23:21:17 +02:00
<?php
namespace Poniverse\Ponyfm\Models;
use Illuminate\Database\Eloquent\Model;
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;
}
}