K9 Squad is PHP Laravel API for provide random dog images and facts
Use following instruction to install K9 Squad
-
Place "squad" file in your localhost root directory
-
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
-
Configure virtual host as "squad.local" How to configure vertual host
-
From "squad" directory open CMD and run following command.
$ php artisan migrate
$ php artisan db:seed
To get random image, you have to call following API
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
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."}]
To run unittest you have to run following command
$ composer test