sudo nano /etc/php/7.2/fpm/php.ini
sudo nano /etc/php/7.2/cli/php.ini
sudo service php-fpm restart
sudo service php7.2-fpm restart
sudo service nginx restart
<?php | |
public function formExtendRefreshFields($formWidget, $fields) | |
{ | |
$model = $fields['model']->value; | |
$values = $model::all()->toArray(); | |
$values = array_column($values, 'code'); | |
$fields['code']->value = join(', ', $values); |
<?php | |
/** | |
* Extract namespace from a PHP file | |
* | |
* @param string $file | |
* @return string | |
*/ | |
public function extractNamespace(string $file) : string | |
{ |
<?php | |
use PhpOffice\PhpSpreadsheet\Spreadsheet; | |
use PhpOffice\PhpSpreadsheet\IOFactory; | |
use PhpOffice\PhpSpreadsheet\Style\Alignment; | |
use PhpOffice\PhpSpreadsheet\Style\NumberFormat; | |
const FORMAT_CODE = '_(* #,##0_);_(* (#,##0);_(* "-"??_);_(@_)'; | |
# set row auto height | |
$worksheet->getRowDimension($rowDetail)->setRowHeight(-1); |
sudo nano /etc/php/7.2/fpm/php.ini
sudo nano /etc/php/7.2/cli/php.ini
sudo service php-fpm restart
sudo service php7.2-fpm restart
sudo service nginx restart
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hoá đơn {{ invoice.code }}</title> | |
<style> | |
.clearfix:after { | |
content: ""; | |
display: table; |
<?php namespace; | |
use BackendAuth, Exception, ValidationException; | |
use Rebing\GraphQL\Support\Mutation; | |
class BaseMutation extends Mutation | |
{ | |
/** | |
* Permission required access to mutation | |
* @var array |
<?php | |
$code = 'OD.' . str_pad($this->count() + 1, 10, '0', STR_PAD_LEFT); |
# first we download the list of IP ranges from CloudFlare | |
wget https://www.cloudflare.com/ips-v4 | |
# iterate over the lines in the downloaded file | |
# make sure to set `--group-id` and `--port`; more details at http://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html | |
while read p; do aws ec2 authorize-security-group-ingress --group-id sg-e0000000 --protocol tcp --port 80 --cidr $p; done< ips-v4 |
ssh username@server-ip -L 5434:127.0.0.1:5434 |
psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'postgres';" | |
createuser odoo –pwprompt | |
createdb odoo -O odoo | |
pip3.7 install psycopg2 --upgrade |