Giter VIP home page Giter VIP logo

draw_a_card's Introduction

Set up environent

  1. Fork project
  2. I used xampp in order to run the code, as it was the quickest and easiest way to start and run the project. As long as a database named 'blackjack' is created, the code should run just fine. The database needs to be ran on localhost at port 3306 as a mysql database. You can change the .env file if you want to run it on a different port or on a specific host machine.

The Project

  1. To start application run. php artisan migrate:refresh . php artisan db:seed --class CardsSeeder . php -S localhost:8888 -t public . I'm using PHP 7.06.
  2. The User model has the users name, email and password as well as a token used to cache the user.
  3. The Card model in the database has the name of the card and the image url of th card, which is used to display the card. Currently to keep it simple there are no relationships between different models.
  4. The CardsController class was created with two actions. The index action which shows all the cards in the database, and the randomCard action, which grabs a random card on page load as well as when the random card button is clicked.
  5. You can login to the application, but only after you register first. Being logged in or not doesn't affect the application.
  6. The pages are rendered using the respected views in the resources/auth folder.
  7. In the resources folder, there is a cards view as well with an index page that displays all the cards with their respective names.

My main goal was to get used to the laravel framework as well as create somewhat of an api. The application has the ability to get all the cards in the database, as well as pull any random card from the database.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.