You can make it in Posts Model:
const displayed = 1;
const hidden = 0;
public static function status()
{
return [
self::displayed => 'displayed',
self::hidden => 'hidden',
];
}
And retrieve it.
$post = [
"status" => Posts::status()[$request->status]
];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…