/laravel-credit-system

Um simples sisteminha onde os usuários podem comprar créditos para gastar dentro da plataforma.

Primary LanguagePHP

laravel-credit-system

A demo system where users can buy credits to purchase products within the platform.

Run Locally

Clone this repo and run commands in the order below:

composer install
cp .env.example .env # And edit the values
php artisan key:generate

Then start Docker containers using Sail:

sail up -d

And run the migrations:

sail artisan migrate
sail artisan db:seed # Optional

Front-end assets

Open another terminal tab and run the command below to compile front-end assets:

sail yarn install
sail yarn run watch

Now you can access the project at http://localhost in the browser.

Running tests

To run tests, first create a database named "testing-laravel"

CREATE DATABASE "testing-laravel";

And run the following command:

sail artisan test
# sail artisan test --filter GetUserTest
# sail artisan test --filter "Deve retornar um erro ..."
# sail artisan test --stop-on-failure

NOTE: Make sure you started the docker containers first.