Laravel 9 Web App - Our client José Gustavo, passionate about soccer and technology, wants to have an application that simulates the soccer leagues in his neighborhood, called My League.

Overview

Laravel 9 Web App

Proposta da Aplicação

Nosso cliente José Gustavo, apaixonado por futebol e tecnologia, deseja ter uma aplicação que simule os campeonatos de futebol do seu bairro, chamada Meu Campeonato.

Para isso, considere um sistema eliminatório que inicia-se nas quartas de final:

  • oito times participam do campeonato;
  • o perdedor de cada jogo é eliminado do campeonato;
  • na primeira fase (quartas de final) quatro jogos são sorteados, sendo que cada time joga apenas uma vez;
  • na segunda fase (semifinais) dois jogos são sorteados, sendo que cada time joga apenas uma vez;
  • os perdedores das semifinais disputam o 3º lugar;
  • a final é disputada pelos vencedores das semifinais, definindo o 1º e 2º lugar do campeonato;
  • em caso de empate, considere como vencedor o time com a maior pontuação (acumulada desde o início do campeonato):
    • para cada gol marcado, o time recebe 1 ponto;
    • para cada gol sofrido, o time perde 1 ponto;
  • em caso de novo empate, considere como vencedor o time que foi inscrito primeiro no campeonato;
  • o placar de cada jogo pode ser gerado randomicamente pelo back-end ou por uma rotina em Python, como detalhado no tópico a seguir.

Placar do jogo

O placar de cada jogo pode ser gerado por uma rotina em Python, com o código apresentado abaixo.

import random
print(random.randrange(0, 8, 1))
print(random.randrange(0, 8, 1))
# Exemplo de output:
# 0
# 2

O back-end deve executar o script acima, capturar seu output e utilizá-lo como resultado de cada uma das partidas.

Setup Inicial

  • Criar banco MysQl: db_meucampeonato

  • Criando Aplicação em Laravel 9

# Para criar a nossa aplicação de nome Meu-campeonato, com composer instalado em sua máquina, execute:
$ composer create-project laravel/laravel Meu-campeonato

Iniciando a Aplicação

# Para iniciar a aplicação em localhost, execute:
php artisan serve

Criando Controllers

# Para criar os controllers de estatísticas, classificação e partidas execute:
$ php artisan make:controller StandingsController
$ php artisan make:controller ClassificationsController
$ php artisan make:controller GamesController
# Controller já com pré-definições de 'CRUD' do laravel
$ php artisan make:controller ChampionshipsController --resource

Criando Migrations

# Para criar a migration referente aos times execute:
$ php artisan make:migration create_teams_table
# Após montar as migrations, para executar a criação no banco, execute:
$ php artisan migrate

Criando Models

Para criar os models de partida e partida, execute:
$ php artisan make:model Team
$ php artisan make:model Game

Criando Table Seeder

# Para criar o table seeder, execute:
$ php artisan make:seeder TeamsTableSeeder

Como Rodar o Projeto

# Criando as tabelas no banco MySql:
$ php artisan migrate
# Caso queira criar times na tabela do banco MySql, sem precisar inserir manualmente no formulário, execute:
$ php artisan db:seed
# Iniciando o Projeto
$ php artisan serve
You might also like...
Kyle is a web application built with Laravel for web developers and small companies to efficiently track and stay on top of yearly expenses related to services
Kyle is a web application built with Laravel for web developers and small companies to efficiently track and stay on top of yearly expenses related to services

Kyle Kyle is a web application built with Laravel for web developers and small companies to efficiently track and stay on top of yearly expenses relat

Unified sample web app. The easy way to learn web frameworks.
Unified sample web app. The easy way to learn web frameworks.

Notejam The easy way to learn web frameworks Do you know framework X and want to try framework Y? The easy way to start with a new framework is to com

TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application
TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application

TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application for storing, uploading, editing and managing files and folders online via web browser. The Application runs on PHP 5.5+, It allows the creation of multiple users and each user can have its own directory and a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes.

OroCRM is an open source Client Relationship Management (CRM) application

OroCRM is an open source Client Relationship Management (CRM) application that allows to create a 360° view of your customers across multiple channels, organize the sales pipeline, manage account and contact information, communicate with customers, run marketing campaigns and track campaign performance.

Roundcube Webmail is a browser-based multilingual IMAP client with an application-like user interface.

Roundcube Webmail roundcube.net ATTENTION This is just a snapshot from the GIT repository and is NOT A STABLE version of Roundcube. It's not recommend

An open source self hosted notes and bookmarks taking web app.
An open source self hosted notes and bookmarks taking web app.

Benotes An open source self hosted web app for your notes and bookmarks side by side. This project is currently in Beta. You may encounter bugs or err

Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP
Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP

MySejahtera-PHP-Web Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP. Disclaimer This web app is

Simple web app to easily create landing pages by dragging and dropping prebuilt blocks
Simple web app to easily create landing pages by dragging and dropping prebuilt blocks

Drag & Drop landing page builder made with Laravel 8, Vue.js 3 and Tailwind CSS

A simple Lumen web app to send basic commands and fetch the current status to your Ford vehicle with Sync 3 enabled

FordPass Access This is a simple Lumen web app to send basic commands and fetch the current status to your Ford vehicle with Sync 3 enabled. Local dev

Owner
Álisson Marques
Web developer, game dev hobbyist. Studying systems analysis and development in UniCesumar
Álisson Marques
A fully responsive and dynamic web app to present all products for a start-up called Zarafah

A fully responsive and dynamic web app to present all products for a start-up called Zarafah. Made of HTML, CSS, TailwindCss, Vanilla JavaScript, AlpineJS, Laravelphp, Laravel Breeze, Jotform Api for forms submissions and Mailchimp Api for Newsletter.

Mostafa Said 7 Dec 11, 2022
The objective of this project is to manage The Website Manga, this site permits to Client to show, read and download Manga with the possibility to react, vote, and save his data.

The objective of this project is to manage The Website Manga, this site permits to Client to show, read and download Manga with the possibility to react, vote, and save his data.

Reda Ennakouri 5 Nov 23, 2022
A learning management system (LMS) is a software application or web-based technology used to plan, implement and assess a specific learning process.

vidyaprabodhan-gov-php-project A learning management system (LMS) is a software application or web-based technology used to plan, implement and assess

Narayan Pote 1 Dec 23, 2021
Genealogy (Silsilah) application to record our family members.

Genealogy Application Development in progress In development progress, any changes of table structure will be updated directly to corresponding migrat

Atef Ben Ali 3 Nov 27, 2021
This prj we have two NODEMCU ( ESP8266) and two RFID_RC522 and some rfid tags we used ARDUINO IDE on NODEMCU and running server with XAMPP

This prj we have two NODEMCU ( ESP8266) and two RFID_RC522 and some rfid tags we used ARDUINO IDE on NODEMCU and running server with XAMPP

Mohammadamir Soltanzadeh 2 Mar 29, 2022
Our team created for you one of the most innovative CRM systems that supports mainly business processes and allows for customization according to your needs. Be ahead of your competition and implement YetiForce!

We design an innovative CRM system that is dedicated for large and medium sized companies. We dedicate it to everyone who values open source software,

YetiForce Sp. z o.o. 1.3k Jan 8, 2023
RSS-Bridge is a PHP project capable of generating RSS and Atom feeds for websites that don't have one

RSS-Bridge is a PHP project capable of generating RSS and Atom feeds for websites that don't have one. It can be used on webservers or as a stand-alone application in CLI mode.

RSS Bridge Community 5.5k Dec 30, 2022
amadeus-ws-client: PHP client for the Amadeus GDS SOAP Web Service interface

amadeus-ws-client: PHP client for the Amadeus GDS SOAP Web Service interface This client library provides access to the Amadeus GDS SOAP Web Service i

Amadeus Benelux 164 Nov 18, 2022
The forum is a base for our Youtube tutorial series on "how to build a forum"

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

AngelJay 15 Oct 11, 2022
Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application that is damn vulnerable.

Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application that is damn vulnerable. Its main goal is to be an aid for security professionals to test their skills and tools in a legal environment, help web developers better understand the processes of securing web applications and to aid both students & teachers to learn about web application security in a controlled class room environment.

Robin Wood 7k Jan 5, 2023