### Install VaahCMS with npx vaah cms:install Source: https://github.com/webreinvent/vaahcms/blob/2.x/README.md Run this command in your terminal to install VaahCMS. It uses npx to execute the vaah CLI with the cms:install command. ```shell npx vaah cms:install ``` -------------------------------- ### Install with Yarn Source: https://github.com/webreinvent/vaahcms/blob/2.x/Resources/assets/backend/vaahone/scss/bulma-0.9.3/README.md Install the bulma-scss package using Yarn. ```bash yarn add bulma-scss ``` -------------------------------- ### Install VaahCMS Package with Composer Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run this command to install the VaahCMS package via Composer. ```bash composer require webreinvent/vaahcms ``` -------------------------------- ### Install with npm Source: https://github.com/webreinvent/vaahcms/blob/2.x/Resources/assets/backend/vaahone/scss/bulma-0.9.3/README.md Install the bulma-scss package using npm. ```bash npm install bulma-scss ``` -------------------------------- ### Publish VaahCMS Views Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run this command to publish the VaahCMS views. ```bash php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=views ``` -------------------------------- ### Install fs package for Laravel Mix Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Install the fs package as a dev dependency before configuring Laravel Mix asset minification. ```bash npm install --save-dev fs ``` -------------------------------- ### Publish All VaahCMS Assets Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run this command to publish all VaahCMS assets. ```bash php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" ``` -------------------------------- ### Publish VaahCMS Migrations Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run this command to publish the VaahCMS migrations. ```bash php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=migrations ``` -------------------------------- ### Create and Add Jobs to a Batch Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Use this code to create a batch and add jobs to it for tracking progress. ```php $batch = Bus::batch([])->onQueue('high')->dispatch(); $batch->add(new ProcessNotifications($notification, $user, $inputs)); ``` -------------------------------- ### Create VaahCMS Seeders and Command Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run these commands to create seeders and a command for the VaahCMS package. ```bash php artisan make:seeder PermissionsTableSeeder --path=/packages/vaahcms/Database/Seeders php artisan make:seeder RolesTableSeeder --path=/packages/vaahcms/Database/Seeders php artisan make:command HealthcheckCommand --path=/packages/vaahcms/Database/Seeders ``` -------------------------------- ### Run Queue Worker with Specific Queues and Environment Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run this command to start a queue worker for the specified queues and environment. ```shell php artisan queue:work --queue=high,medium,low,default --env=pradeep ``` -------------------------------- ### Publish VaahCMS Assets Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run this command to publish the VaahCMS assets. ```bash php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=assets ``` -------------------------------- ### Publish VaahCMS Configuration Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run this command to publish the VaahCMS configuration file. ```bash php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=config ``` -------------------------------- ### Publish VaahCMS Seeds Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run this command to publish the VaahCMS seeds. ```bash php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=seeds ``` -------------------------------- ### Create VaahCMS Migration Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run this command to create a migration for the VaahCMS package. ```bash php artisan make:migration create_vh_users_table --path=/packages/vaahcms/Database/Migrations ``` -------------------------------- ### Publish VaahCMS Language Files Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run this command to publish the VaahCMS language files. ```bash php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=lang ``` -------------------------------- ### Manual Upgrade of VaahCMS Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run these commands to manually upgrade VaahCMS, publishing assets, migrations, and seeds, then running migrations and seeding. ```bash php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=assets --force php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=migrations --force php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=seeds --force php artisan migrate --force php artisan db:seed --force ``` -------------------------------- ### Dispatch Job to High Queue Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Use this code to dispatch a job to the 'high' queue. ```php dispatch((new ProcessNotifications($notification, $user, $inputs)) ->onQueue('high')); ``` -------------------------------- ### Publish VaahCMS Assets, Migrations, Seeds, and Config Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run these commands to publish the package's assets, migrations, seeds, and configuration files. Use --force to overwrite existing files. ```bash php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=assets --force php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=migrations --force php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=seeds --force php artisan vendor:publish --provider="WebReinvent\VaahCms\VaahCmsServiceProvider" --tag=config --force ``` -------------------------------- ### Create VaahCMS Module and Theme Directories Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Create these folders in your Laravel root to store VaahCMS modules and themes. ```bash vaahcms/Modules vaahcms/Themes ``` -------------------------------- ### Comment headless option in DuskTestCase.php Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md In tests/DuskTestCase.php, comment out the '--headless' argument to run browser tests with a visible Chrome window on Windows. ```php ... $options = (new ChromeOptions)->addArguments([ '--disable-gpu', //'--headless', <-- comment this line '--window-size=1920,1080', ]); ... ``` -------------------------------- ### Regenerate Composer Autoload Files Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Run this command after updating composer.json to regenerate the autoload files. ```bash composer dump-autoload ``` -------------------------------- ### Register VaahCMS Service Provider in config/app.php Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Add this service provider to the 'providers' array in config/app.php to enable VaahCMS. ```php /* * Package Service Providers... */ 'providers' => [ //... WebReinvent\VaahCms\VaahCmsServiceProvider::class, //... ], ``` -------------------------------- ### Configure User Model in config/auth.php Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Add this provider configuration to config/auth.php to use the VaahCMS User model. ```php 'providers' => [ //... 'users' => [ 'driver' => 'eloquent', 'model' => \ WebReinvent\VaahCms\Models\User::class, ], //... ], ``` -------------------------------- ### Set Dusk test directory in phpunit.dusk.xml Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Change the directory path in phpunit.dusk.xml to point to the module's Browser tests directory. ```xml ... ./VaahCms/Modules//Tests/Browser ... ``` -------------------------------- ### Generate Changelog with auto-changelog Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Shell command to generate a changelog using auto-changelog with a custom template and no commit limit. ```shell auto-changelog --commit-limit false --template changelog-template.hbs ``` -------------------------------- ### Add VaahCMS Autoload Paths to composer.json Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Add these lines to the 'psr-4' section of composer.json to autoload VaahCMS modules and themes. ```json ... "autoload": { "files": [], "psr-4": { "App\\": "app/", ... "VaahCms\\Modules\\": "vaahcms/Modules/", "VaahCms\\Themes\\": "vaahcms/Themes/" ... }, "classmap": [ "database/seeds", "database/factories" ] }, ... ``` -------------------------------- ### Run composer update with Process Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md PHP snippet to run a command via Symfony Process with PTY enabled. Used for running composer update or artisan commands. ```php $process = new Process('cd .. && php artisan dusk --group=bkkrishna'); $process->setPTY(true); $process->run(); ``` -------------------------------- ### Packagist GitHub Webhook Payload URL Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Use this URL as the Payload URL when setting up a GitHub webhook to update Packagist. Replace PACKAGIST_USERNAME with your Packagist username. ```text https://packagist.org/api/github?username=PACKAGIST_USERNAME ``` -------------------------------- ### Fix Numeric Value Out of Range Error in AppServiceProvider Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Add this code to the boot method of App\Providers\AppServiceProvider to fix the 'Numeric value out of range' error. ```php public function boot() { Schema::defaultStringLength(191); } ``` -------------------------------- ### Configure webpack.mix.fs for VaahCMS admin assets Source: https://github.com/webreinvent/vaahcms/blob/2.x/INSTRUCTIONS.md Replaces the content of webpack.mix.fs to minify and combine VaahCMS admin assets. It reads assets.json, combines CSS and JS, compiles Vue app files, copies the admin directory, and enables versioning. The webpackConfig sets watch options and ignores certain directories. ```javascript var admin_path = 'resources/assets/vendor/vaahcms/admin/'; var admin_default_theme_path = admin_path+'default/'; mix.setPublicPath(admin_default_theme_path); var admin_assets_json = JSON.parse(fs.readFileSync(admin_default_theme_path+'assets.json')); //console.log(admin_assets_json); var admin_copy_path = './resources/assets/vendor/vaahcms/admin/'; var admin_copy_path_des = './packages/vaahcms/src/Resources/assets/admin/'; fs_extra.removeSync(admin_copy_path_des); mix.combine(admin_assets_json['css'], admin_default_theme_path+'builds/vaahcms.css') .combine(admin_assets_json['js'], admin_default_theme_path+'builds/vaahcms.js') .js(admin_default_theme_path+'vue/app-setup.js', './builds') .js(admin_default_theme_path+'vue/app-dashboard.js', './builds') .js(admin_default_theme_path+'vue/app-modules.js', './builds') .copyDirectory(admin_copy_path, admin_copy_path_des, false) .version(); //mix.copyDirectory(admin_copy_path, admin_copy_path_des, false); mix.webpackConfig({ watchOptions: { aggregateTimeout: 2000, poll: 20, ignored: [ '/app/', '/bootstrap/', '/config/', '/database/', '/packages/', '/public/', '/routes/', '/storage/', '/tests/', '/vaahcms/', '/node_modules/', '/vendor/', ] } }); ```