Skip to content

srijayasinghe/squad_k9

Repository files navigation

K9 Squad

K9 Squad is PHP Laravel API for provide random dog images and facts

Installation

Use following instruction to install K9 Squad

  1. Place "squad" file in your localhost root directory

  2. Update .env file for database connection, env location: squad/.env

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=squad_live
DB_USERNAME=root
DB_PASSWORD=secret
  1. Configure virtual host as "squad.local" How to configure vertual host

  2. From "squad" directory open CMD and run following command.

$ php artisan migrate
$ php artisan db:seed

Usage

To get random image, you have to call following API

Live Link

http://dogimg.clicksitetesting.website/api/images

Local

http://squad.local/api/images

Json Return

{"fileSizeBytes":182509,"url":"http:\/\/squad.local\/uploads\/images\/345fbb70bd7d9fcf2886ff3e678def04.jpg"}

To get random fact, you have to call following API

Live Link

http://dogimg.clicksitetesting.website/api/fact/2

Local

http://squad.local/api/fact/5

You can change last number "5" according to your request, according to this number it'll change the fact count.

Json Return

[{"fact":"Ut corrupti commodi voluptatibus corporis cum impedit et."},{"fact":"Fugiat modi exercitationem et ut natus."}]

Unit Testing

To run unittest you have to run following command

$ composer test

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published