From 7e9af18941967445c0840d1a6790ac652aa2b4d5 Mon Sep 17 00:00:00 2001 From: Prasad Chinwal Date: Thu, 20 May 2021 10:22:12 -0500 Subject: [PATCH] Update README.md --- README.md | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/README.md b/README.md index 2f6072c..19a1b88 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,108 @@ This package helps in separating base laravel application in docker build step. > > You are free to update the stubs once they are published. > > You can also install other required packages as you would previously. +## Local Set Up +- Create a fresh laravel application as we do for all projects +- Create a folder ``` packages ```` at ``` /var/www/laravel/packages``` +- Create a folder ``` uisits``` which is the vendor name for our package in the packages directory at ``` /var/www/laravel/packages/uisits``` +- cd into this vendor name folder (``` cd /var/www/laravel/packages/uisits```) and run ``` git clone git@github.com:uisits/ui.git ``` +- This copies all the files of the package from github. +- To work on the **7.x** run ``` git checkout 7.x``` (Here 7.x is the name of the branch on github) +- Similarly to work on the **8.x** run ``` git checkout .8x``` (Here 8.x is the name of the branch on github) +- To use this package locally we need to add this package to our laravel app. We can do this by adding the following to out ``` composer.json``` file at ``` /var/www/laravel/composer.json```. + ```php + "repositories": { + "local": { + "type": "path", + "url": "./packages/uisits/ui" + } + }, + ``` + Now your entire composer.json file looks like this: + ```php + { + "name": "laravel/laravel", + "type": "project", + "description": "The Laravel Framework.", + "keywords": [ + "framework", + "laravel" + ], + "license": "MIT", + "repositories": { + "local": { + "type": "path", + "url": "./packages/uisits/ui" + } + }, + "require": { + "adldap2/adldap2-laravel": "^6.0", + "fideloper/proxy": "^4.4", + "fruitcake/laravel-cors": "^2.0", + "laravel/framework": "^7.0", + "laravel/passport": "^8.4", + "laravel/tinker": "^2.0", + "php": "^7.2.5|^8.0", + "uabookstores/laravel-shibboleth": "3.1.1", + "uisits/ui": "^7.0", + "yajra/laravel-oci8": "^7.0" + }, + "require-dev": { + "barryvdh/laravel-debugbar": "^3.3", + "facade/ignition": "^2.0", + "fzaninotto/faker": "^1.4", + "laravel/dusk": "^5.5", + "mockery/mockery": "^1.0", + "nunomaduro/collision": "^4.1", + "phpunit/phpunit": "^8.5" + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true + }, + "extra": { + "laravel": { + "dont-discover": [ + "laravel/dusk" + ] + } + }, + "autoload": { + "psr-4": { + "App\\": "app/" + }, + "classmap": [ + "database/seeds", + "database/factories" + ] + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "scripts": { + "post-autoload-dump": [ + "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", + "@php artisan package:discover --ansi" + ], + "post-root-package-install": [ + "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" + ], + "post-create-project-cmd": [ + "@php artisan key:generate --ansi" + ] + } + } + ``` +- All that is now required is to run ``` composer install uisits/ui ```. This should now install the package from the local directory. + +> Note: +> Sometimes you might need to run ``` composer dump-autoload```. + ## Testing - Create a docker container. - remove the current laravel application at ``` /var/www/laravel```