-
Enable PPA
sudo apt update sudo apt install software-properties-common
-
Install apt-fast
<?php | |
return [ | |
/* | |
|-------------------------------------------------------------------------- | |
| Laravel-admin upload setting | |
|-------------------------------------------------------------------------- | |
| | |
| File system configuration for form upload files and images, including | |
| disk and upload path. | |
| |
<?php | |
protected function form() | |
{ | |
$form = new Form(new ModelName); | |
$form->text('title')->rules('required')->required()->help('This field must be required'); | |
$form->text('number')->rules('required|regex:/\d{3}/')->pattern('\d{3}')->help('This field must be three digits'); | |
return $form; | |
} |
title = "AJAX File Upload" | |
url = "/test" | |
layout = "default" | |
is_hidden = 0 | |
== | |
<?php | |
use System\Models\File; | |
function onSubmit() | |
{ |
<?php | |
/** | |
* This method logically validates Turkish VAT number | |
* | |
* @param string $taxNumber | |
* @return bool | |
*/ | |
public function validateTaxNumber(string $taxNumber): bool | |
{ |
<?php | |
if (!function_exists('dd')) { | |
function dd($data) | |
{ | |
ini_set("highlight.comment", "#969896; font-style: italic"); | |
ini_set("highlight.default", "#FFFFFF"); | |
ini_set("highlight.html", "#D16568"); | |
ini_set("highlight.keyword", "#7FA3BC; font-weight: bold"); | |
ini_set("highlight.string", "#F2C47E"); |
PHP handling on apache is done via modules of one sort or another, and running multiple version is problematic on a single instance. The solution is to run two instances of apache on the same machine. This allows one instance to run PHP 7 (the default on 16.04), and another can run PHP 5. Since normal http/https is on ports 80 and 443, the second instance will run on ports 81 and 444. Since it is running on the same machine, all file system and database access is the exact same.
All the commands herein have to be run as root, or with sudo
prefixed to the command.
-
Read /usr/share/doc/apache2/README.multiple-instances
-
Run
sh ./setup-instance php5
from/usr/share/doc/apache2/examples
, wherephp5
is the suffix for the second site; all commands for the second site will have that suffix. This will keep all of the same configuration for all sites on the new instance, including SSL certif
<?php | |
namespace App\Http\Controllers\Admin; | |
use App\Http\Requests; | |
use App\Article; | |
use App\Tag; | |
use App\Category; | |
use Zofe\Rapyd\DataForm\Field\Checkboxgroup; | |
class AdminArticlesController extends AdminController |