for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Oscer\Cms\Core\Options\Models;
use Illuminate\Support\Carbon;
use Oscer\Cms\Core\Models\BaseModel;
/**
* @property int id
* @property string key
* @property string value
* @property Carbon created_at
* @property Carbon updated_at
*/
class Option extends BaseModel
{
public static function getValueByKey(string $key, $default = null): ?string
$option = static::query()->where('key', $key)->first();
return $option ? $option->value : $default;
}