creiamo base_test
da bash
mkdir base_test
cd base_test
composer create-project laravel/laravel laravel "8.*"
mv laravel/public public_html
git init
creare repo su github/laraxot
https://github.com/organizations/laraxot/repositories/new
Mettere tutte le 3 spunte, con gitignore di Laravel
git remote add origin https://github.com/laraxot/base_cyber.git
sulla pagina su questo esempio https://github.com/laraxot/base_cyber/branches cambiare da main a master
in public_html modificare index.php
$app = require_once LARAVEL_DIR.'/bootstrap/app.php';
// set the public path to this directory
$app->bind('path.public', function () {
return __DIR__;
});
al posto di __DIR__ mettere LARAVEL_DIR, e togiere i due punti, e sotto LARAVEL_START (prima riga) mettere define('LARAVEL_DIR', __DIR__.'/../laravel');
touch .gitmodules
modificare il .env come quello delle altre basi
copiare da composer.json su autoload > psr-4
"Modules\\": "Modules/",
"Themes\\": "Themes/",
fuori da laravel nella cartela root git submodule add https://github.com/laraxot/bashscripts.git bashscripts
(se sbagli git rm –cached bashscripts e rm -rf bashscripts)
mkdir Modules
mkdir Themes
git submodule add https://github.com/laraxot/module_lu.git LU
git submodule add https://github.com/laraxot/module_xot.git Xot
git submodule add https://github.com/laraxot/module_tenant.git Tenant
git submodule add https://github.com/laraxot/module_lang.git Lang
git submodule add https://github.com/laraxot/module_cms.git Cms
git submodule add https://github.com/laraxot/module_theme.git Theme
Aggiungere i temi su Themes, come sopra.
Esempio:
git submodule add https://github.com/laraxot/theme_adminlte.git AdminLTE
per creare modulo in git:
New > module_blabla > gitignore Laravel.
Su brench rinomini main a master come prima.
ci metti i file dentro tranne .git e pushi
mette dentro la cartella local o quello che è con i file (basta copiarli da altre basi e modificare)
al posto di composer update, su laravel fare ../bashscripts/composer_init.sh e Xot Services fare ./bashscripts/composer_init.sh
in laravel vendor:publish > 0 serve per prendere dai componenti e mettere i file nei punti giusti
copiare config/localhost nella base da un altra base
php artisan module:list
php artisan module:enable e abiliti tutto
se viene fuori questo errore:
Call to undefined function Modules\Tenant\Services\inAdmin()
vai su modules_statuses.json in /laravel
e li metti a mano
se vedi che facendo url/it/models non vedi una minchia, ma su morph_map c'è, forse bisogna decommentare la lingua in laravel\config\laravellocalization.php