Skip to content

raalejandre89/animal-project

Repository files navigation

Installation

Follow the following steps to install the necessary components to run the application

Windows

Linux

  • If you are using Docker Desktop for Linux execute the following docker context use default. If you are not using Docker Desktop for Linux, you may skip this step.

  • After docker is installed and running navigate to the root folder of the project and run ./vendor/bin/sail up -d
    • Instead of repeatedly typing vendor/bin/sail to execute Sail commands, you can configure a shell alias that allows you to execute Sail's commands more easily: alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)' that way next time instead of executing ./vendor/bin/sail up -d just run sail up -d.
  • The previous command should set up a redis cluster, a mysql cluster and the application.

Setting up the Database

  • While in your project root folder run the laravel migrations: sail artisan migrate:fresh --seed. This should create all tables for the database and seed the metadata. NOTE: be aware that this will drop all tables before doing any action so if run for the second time it will remove all the data.

##Usage There are two available commands: one to create animals and another one to list the created animals.

Create Animals

  • Run sail artisan create {animalName} {animalType}
    • {animalName} could be one name or a comma separated list of names.
    • {animalType} could be one type or a comma separated list of types.
    • IMPORTANT: the count of names needs to match the count of types.
    • In addition there are three optional arguments --ages= --colors= and --foods=. Each could be one value or a comma separated list of values.
    • NOTE: Each value in each argument correspond to the animal in the Nth position in the list. For example in the following command sail artisan create Blake,Riki dog,cat --ages=5,6 Blake is a 5 years old dog and Riki is a 6 years old cat.

List Animals

  • Run sail artisan animal:list
    • After running the command the app will guide you with the different options to list animals.

Test

  • To run the tests run sail artisan test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published