This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Скрипт создания форейн ключа $foreignKey в таблице $table1 на таблицу $table2. | |
| * | |
| * -Получаем все элементы таблицы1 и таблицы2. | |
| * -Перебираем циклом элементы таблицы1 и проверяем существуют ли они в таблице2. | |
| * -Если элемент в таблице2 не существует, удаляем ссылку на него из таблицы1. | |
| * -Создаем форейн ключ в таблице1. | |
| */ | |
| function validateTableAndCreateForeignKey($table1, $table2, $foreignKey) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Create project folders first. Than run this script | |
| parametr1=$1 | |
| projectPath=/home/userName/PhpstormProjects | |
| cp /etc/nginx/example.conf /etc/nginx/conf.d/$parametr1.conf | |
| rpl -iqR example $parametr1 /etc/nginx/conf.d/$parametr1.conf | |
| sed -i -e '1 s/^/127.0.0.1 '$parametr1'.local\n/;' /etc/hosts | |
| service nginx restart | |
| chown www-data $projectPath/$parametr1/bootstrap/cache/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Step 1. Create this class in the middleware folder (/app/Http/Middleware). | |
| <?php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| class BeforeAutoTrimmer { |
NewerOlder