mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
WIP notifications and other refactors (#88)
* WIP notifications and other refactors - refactor notification channels - send notifications on events related to the servers and sites - delete server log files on server deletion - add telegram notification channel - add new icons - cache configs and icons on installation and updates - new navbar for dark mode and settings * discord channel * build assets * pint
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Contracts\Database\Query\Expression;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
function random_color(): string
|
||||
@ -63,3 +64,10 @@ function date_with_timezone($date, $timezone): string
|
||||
|
||||
return $dt->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
function cast_to_json(array $json): Illuminate\Database\Query\Expression|Expression
|
||||
{
|
||||
$json = addslashes(json_encode($json));
|
||||
|
||||
return DB::raw("CAST('{$json}' AS JSON)");
|
||||
}
|
||||
|
Reference in New Issue
Block a user