Skip to main content

Sadržaj

💪 WDR app readme - installs, configs and tools 💪

FIREWALL BAN

  • sudo fail2ban-client set sshd banip 5.188.18.0/24

  • sudo fail2ban-client set webmin-auth banip 5.188.18.0/24

  • php artisan migrate:fresh --database=old2_wdr_mysql && php artisan db:seed --class=DatabaseSeeder --database=old2_wdr_mysql

  • chmod +x /home/willdienstrad/public_html/wdr-cloud-platform/vendor/bin/composer-unused

  • php artisan migrate:fresh --path=/database/migrations/2024_07_04_193529_create_data_archives_table.php

  • php artisan db:seed --class=OldCompaniesRetailersImport

mkdir -p /home/willdienstrad/public_html/wdr-cloud-platform/database/settings

FILE AND FOLDERS Permissions - LIVE

  • sudo chown -R willdienstrad:willdienstrad /home/willdienstrad/public_html/wdr-cloud-platform/
  • sudo chmod -R 755 /home/willdienstrad/public_html/wdr-cloud-platform/storage/
  • sudo chmod -R 755 /home/willdienstrad/public_html/wdr-cloud-platform/public/

Composer - packages updates

Composer.json - post install scripts - maknut --force

  • "@php artisan vendor:publish --tag=config --ansi --no-interaction"
  • "@php artisan vendor:publish --tag=laravel-assets --ansi --no-interaction"

Latest Added packages:

Inverse seed generator (iSeed)

  • https://github.com/orangehill/iseed

Laravel reCAPTCHA

  • composer require josiasmontag/laravel-recaptchav3
  • php artisan vendor:publish --provider="Lunaweb\RecaptchaV3\Providers\RecaptchaV3ServiceProvider"

Spatie Settings

  • composer require spatie/laravel-settings
  • php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="migrations"
  • php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="config"

Removed packages

Removed development packages -maileclipse, migrator, dibi, prequel

  • composer remove qoraiche/laravel-mail-editor
  • composer remove rezaamini-ir/migrator

Laravel tools and commands

-   pa queue:table
-   pa queue:failed-table
-   pa migrate:fresh --seed

Informacija o modelima

-   pa model:show Company\\Company
-   pa model:show Employee\\Employee

VSCode - dev optimization

Settings:

  • VS code - settings.json: Podešavanje za Larvel i PHP Intelephense - 15.6.2024. "github.copilot.editor.enableAutoCompletions": true, "editor.formatOnSave": false, "editor.formatOnType": false, "[php]": { "editor.defaultFormatter": "junstyle.php-cs-fixer" }, // Podešavanja za PHP Intelephense "php.suggest.maxWorkerThreads": 4, "intelephense.telemetry.enabled": false, "intelephense.files.maxSize": 5000000, "intelephense.diagnostics.enable": false, // Telemetry i Crash Reporter "telemetry.enableTelemetry": false, "telemetry.enableCrashReporter": false,

Rappasoft livewire table view publish

-php artisan vendor:publish --tag=livewire-tables-views

  • File:
    • resources/views/vendor/livewire-tables/specific/bootstrap-4/pagination.blade.php
    • resources/views/vendor/livewire-tables/specific/bootstrap-4/simple-pagination.blade.php
    • resources/views/layouts/partials/pagination.blade.php - nova datoteka za custom paginaciju + medota u komponenti

Application cache, logs and preview clear

php artisan app:clear-app-cache

Composer.json -script correction - post update removed

novo - php artisan vendor:publish --tag=public izbačeno - "@php artisan app:commands:azuriraj-jezike --ansi", izbačeno - "@php artisan app:commands:ocisti-jezike --ansi", "@php artisan lang:update --ansi", "@php artisan lang:publish --ansi",

PHP Composer and Laravel commands

composer global show composer show 'phpstan/*' composer outdated // promjene u composer vendor composer status -v // dependencies composer show -D

Testing - PHPStan and Larastan

composer require --dev phpstan/phpstan composer require --dev larastan/larastan php /home/willdienstrad/public_html/wdr-cloud-platform/vendor/bin/phpstan analyse

Database tools

composer require rezaamini-ir/migrator php artisan vendor:publish --provider="Migrator\MigratorServiceProvider" --tag="views"

https://github.com/Protoqol/Prequel

Schedule and queue

https://stackoverflow.com/questions/54628998/no-scheduled-commands-are-ready-to-run-only-in-schedule

Composer unused packages

composer require --dev icanhazstring/composer-unused vendor/bin/composer-unused

Desktop notifications

https://github.com/jolicode/JoliNotif/blob/main/doc/05-cli-usage.md

Translations and languages

Langs: https://laravel-lang.com/ https://github.com/Laravel-Lang/lang GUI: https://github.com/MohmmedAshraf/laravel-translations URL i sve ostalo: https://github.com/mcamara/laravel-localization?tab=readme-ov-file#collaborators

Laravel default language publish :

php artisan lang:publish

Laravel Lang package

composer require --dev laravel-lang/common php artisan lang:update php artisan lang:add hr php artisan lang:add de

Translations package publish :

php artisan translations:import php artisan translations:publish

Mail - Maileclipse

php artisan laravel-mail-editor:install

Laravel Scheduler - Cron job

          • root /usr/bin/php8.3 /home/willdienstrad/public_html/wdr-cloud-platform/artisan schedule:run >> /dev/null 2>&1 ##

Publishes all vendor assets

php artisan vendor:publish

🎉Rappasoft datatables🎉

Datatables - current

php artisan vendor:publish --provider="Rappasoft\LaravelLivewireTables\LaravelLivewireTablesServiceProvider" --tag=livewire-tables-config php artisan vendor:publish --provider="Rappasoft\LaravelLivewireTables\LaravelLivewireTablesServiceProvider" --tag=livewire-tables-views php artisan vendor:publish --provider="Rappasoft\LaravelLivewireTables\LaravelLivewireTablesServiceProvider" --tag=livewire-tables-translations

php artisan vendor:publish --tag=livewire-tables-public

Rappasoft bugs

php artisan clear-compiled && php artisan cache:clear && php artisan route:clear && php artisan view:clear && php artisan config:clear && composer dumpautoload -o

PDF

composer require barryvdh/laravel-dompdf php artisan vendor:publish --provider="Barryvdh\DomPDF\ServiceProvider"

Publish all assets

php artisan vendor:publish --all

PIVOT MODELI

php artisan make:model CompanyFilePivot --pivot

WDR Cloud Platform

💻 Languages and tools

🚀 Frameworks and technologies

PHP dependencies

  • apt-get install php8.2-cli php8.2-cgi php8.2-fpm php8.2-common php8.2-imap php8.2-redis php8.2-snmp php8.2-xml php8.2-gd php8.2-oauth php8.2-apcu php8.0-bcmath php8.2-curl php8.2-mbstring php8.2-xsl php8.2-xdebug php8.2-yaml php8.2-mysql php8.2-opcache php8.2-soap php8.2-zip -y

Debug bar - pomoć u razvoju

composer require barryvdh/laravel-debugbar --dev

PHPMyAdmin - MySQL

https://db.willdienstrad.app

Ide helper - pomoćnik za razvoj

composer require --dev barryvdh/laravel-ide-helper

Log viewer

URL : https://willdienstrad.app/logs

composer require opcodesio/logs php artisan vendor:publish --tag="logs-config"

Datatables 10.3.1 - alat za tablice

composer require yajra/laravel-datatables-oracle:"^10.3.1"

PDF - DOM PDF - generator PDF-a

composer require barryvdh/laravel-dompdf

Laravel 10 - Bootstrap 5 - Skeleton starter kit

composer require laravel/ui

php artisan ui bootstrap php artisan ui bootstrap --auth

Roles and permissions - Custom many to many RBAC

php artisan make:migration create_roles_permissions_table --create=roles_permissions

php artisan make:migration create_users_permissions_table --create=users_permissions php artisan make:migration create_users_roles_table --create=users_roles

Database - Migrations and Seeders

php artisan migrate

php artisan db:seed

Frontend - VITE bundle - npm

npm install

npm run build

Error stranice

php artisan vendor:publish --tag=laravel-notifications

php artisan vendor:publish --tag=laravel-errors

Folder dozvole

sudo chmod -R 755 wdr-cloud-platform

chmod -R o+w wdr-cloud-platform/storage chmod -R o+w wdr-cloud-platform/bootstrap/cache sudo chmod -R ugo+rwx storage sudo chmod -R 777 storage

PHP packages and dependencies

composer require beyondcode/laravel-query-detector --dev

composer require beyondcode/laravel-query-detector --dev composer require spatie/laravel-health

Health check

https://willdienstrad.app/health?fresh

Folder dozvole

sudo chown -R wdr:wdr /home/wdr/public_html/wdr-cloud-platform/

find /home/wdr/public_html/wdr-cloud-platform/ -type d -exec chmod 755 {} ; find /home/wdr/public_html/wdr-cloud-platform/ -type f -exec chmod 644 {} ;

sudo find ./bootstrap/cache -type d -exec chmod g+s {} ; sudo find ./storage -type d -exec chmod g+s {} ;

sudo chmod -R 775 /home/wdr/public_html/wdr-cloud-platform/storage sudo chmod -R 775 /home/wdr/public_html/wdr-cloud-platform//bootstrap/cache

sudo chown -R :adravolonteri ./storage sudo chown -R :adravolonteri ./bootstrap/cache sudo find ./storage -type d -exec chmod 775 {} ; sudo find ./storage -type f -exec chmod 664 {} ; sudo find ./bootstrap/cache -type d -exec chmod 775 {} ; sudo find ./bootstrap/cache -type f -exec chmod 664 {} ; sudo find ./ -type d -exec chmod 755 {} ; sudo find ./ -type f -exec chmod 644 {} ; sudo setfacl -R -d -m g::rwx ./storage sudo setfacl -R -d -m g::rwx ./bootstrap/cache

node js

sudo chmod -R +x node_modules

Backup downloads

sudo chmod -R a+rwx,o-w storage/

Composer unused packages

Run from shell as composer root => "/root/.config/composer/vendor/insolita/unused-scanner/unused_scanner wdr_scanner_config.php"

Made with ♥️ Mellon development© 2023