Project to improve your SOLID skills on Laravel Ecossystem

Overview

Try Laravel SOLID

About the Project

The idea is for you get an application built without worrying about the SOLID principles and apply them. The theory is really nice, but you will not really understand it until you code it.

The SOLID Principles exist to make code more readable and maintainable. All the content you need to make it happen can be found here.

Expectations

Fork the project and try to run it on your machine and your goal is to focus on the tasks below:

  • Apply the Open Closed Principle on Services (Github and Twitch) without breaking them.
  • Apply Single Responsibility Principle mostly on Controllers and Repositories (that do not exist yet, so you have to create them).
  • Apply Liskov Substitution Principle on the methods that return specific data and make it a pattern.
  • Apply Interface Segregation Principle on Services that don't use all interface methods.
  • Find a place to implement Dependency Inversion and then make all the major modifications in the code.

If you want to worry about Clean Code here are some tips:

  • Know the difference between single and double quotes.
  • Use "Early Return" on methods.
  • Look to type every function/method in the entire project.
  • Create a new config file to store credentials and NEVER use env() function directly in the code
  • Use this new config file to generate the Sign-In buttons and leave an active flag for each provider as a Feature Flip.

When you're done, open a pull request on your fork and tag me for a code review.

Running the Project

  1. Clone the repository using this command:
$ git clone https://github.com/DanielHe4rt/try-laravel-solid.git
  1. Access the project folder on your terminal:
$ cd try-laravel-solid
  1. Run the command to install all dependencies with Composer.
$ composer install
  1. Copy the .env.example config to a new file called .env
$ cp .env.example .env
  1. Change the database environment variables on .env:
    • DB_DATABASE: Database that you created for the project.
    • DB_USERNAME: MySQL username.
    • DB_PASSWORD: MySQL password.
DB_DATABASE=dev_solid
DB_USERNAME=root
DB_PASSWORD=root
  1. Active the folder sync and let public the user avatars
$ php artisan storage:link
  1. Run the application
$ php artisan serve

Getting the Providers

For this application you will need two base providers, that will be Github and Twitch.

Create a new application on both providers and fill the callback urls same as the .env variables:

"http://localhost:8000/auth/oauth/twitch" ">
Github => "http://localhost:8000/auth/oauth/github"
Twitch => "http://localhost:8000/auth/oauth/twitch"

After that, replace the ID and Secret on envs providers:

GITHUB_OAUTH_ID="Iv1.your-github-app-id"
GITHUB_OAUTH_SECRET="your-github-secret"

TWITCH_OAUTH_ID="your-twitch-app-id"
TWITCH_OAUTH_SECRET="your-twitch-secret"

After the replacement you should be able to authenticate on the platform.

License

The Laravel framework is open-sourced software licensed under the MIT license.

You might also like...
Validate your input data in a simple way, an easy way and right way. no framework required. For simple or large. project.

wepesi_validation this module will help to do your own input validation from http request POST or GET. INTEGRATION The integration is the simple thing

Llum illuminates your Laravel projects speeding up your Github/Laravel development workflow
Llum illuminates your Laravel projects speeding up your Github/Laravel development workflow

Llum illuminates your Laravel projects speeding up your Github/Laravel development workflow

Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App.
Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App.

OvalFi Laravel Package Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App. Installation You can in

Laravel application project as Sheina Online Store backend to be built with Laravel and VueJS

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

Laravel 2-Step Verification is a package to add 2-Step user authentication to any Laravel project easily.
Laravel 2-Step Verification is a package to add 2-Step user authentication to any Laravel project easily.

Laravel 2-Step verification is a package to add 2-Step user authentication to any Laravel project easily. It is configurable and customizable. It uses notifications to send the user an email with a 4-digit verification code. Laravel 2-Step Authentication Verification for Laravel. Can be used in out the box with Laravel's authentication scaffolding or integrated into other projects.

The Laravel Boilerplate Project - https://laravel-boilerplate.com - For Slack access, visit:

Laravel Boilerplate (Current: Laravel 8.*) (Demo) Demo Credentials Admin: [email protected] Password: secret User: [email protected] Password: secret Offici

ergodnc (Ergonomic Desk & Coffee) is an open source Laravel project that's being built live on the official Laravel YouTube Channel

About This Project ergodnc (Ergonomic Desk & Coffee) is an open source Laravel project that's being built live on the official Laravel YouTube Channel

Packagit is amazing laravel modules management, you could manage huge project with many separate laravel modules.

Packagit is amazing laravel modules management, you could manage huge project with many separate laravel modules.

🧑‍🔬 The missing assertions for your views in your Laravel applications.
🧑‍🔬 The missing assertions for your views in your Laravel applications.

Laravel View Assertions The missing assertions for your views in your Laravel applications. Installation You'll have to follow a couple of simple step

Comments
  • docs(readme): fix minor typos

    docs(readme): fix minor typos

    Não sei se ta aceitando pr aqui, mas lendo o readme vi algumas coisinhas que acho que da pra melhorar.

    Tentei manter o mesmo estilo de escrita.

    Se não tiver aceitando, sem problemas.

    opened by PoorlyDefinedBehaviour 0
Owner
Daniel Reis
coding useless stuff since 2011
Daniel Reis
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.

Webdevetc BlogEtc - Complete Laravel Blog Package Quickly add a blog with admin panel to your existing Laravel project. It has everything included (ro

WebDevEtc. 227 Dec 25, 2022
Easily Integrate PingPing APIs in your Laravel Project

PingPing This composer package allows us to easily integrate PingPing APIs in your Laravel project. What is PingPing ? PingPing is the simplest uptime

Bhushan Gaikwad 15 Mar 22, 2022
Let's base your Laravel project with PROS style

Purpose This library is for convenient methods that use to register code base for Laravel project Target We aimed to reduce complexity for real projec

Protean Studios Co., Ltd. 4 Mar 29, 2022
🏭This package lets you create factory classes for your Laravel project.

Laravel Factories Reloaded ?? This package generates class-based model factories, which you can use instead of the ones provided by Laravel. Laravel 8

Christoph Rumpel 372 Dec 27, 2022
Easily setup SEO in your laravel project with lara-head :heart: @code4mk

installation composer require code4mk/lara-head usage meta ~ inside controller use Khead; class Test { public function home() { Khead::setMeta

null 173 Dec 23, 2022
Ghygen is a GitHub Actions configurator for your PHP / Laravel project.

Ghygen Ghygen is a GitHub actions Yaml Generator. Ghygen allows you creating your Yaml file for GitHub Actions, for Laravel/PHP web application, so yo

Hi Folks! 268 Dec 11, 2022
Effortlessly create a PHP preload script for your Laravel project.

This package has been superseeded by Laragear/Preload. Please migrate to the new package. Laraload Effortlessly create a PHP Preload Script for your L

Italo 209 Dec 7, 2022
Use Ciphersweet in your Laravel project

In your project, you might store sensitive personal data in your database. Should an unauthorised person get access to your DB, all sensitive can be read which is obviously not good.

Spatie 248 Jan 1, 2023
Easily add all the 58 Algerian Wilayas and its Dairas to your cool Laravel project (Migrations, Seeders and Models).

Laravel-Algereography Laravel-Algereography allows you to add Migrations, Seeders and Models of Algerian Wilayas and Dairas to your existing or new co

Hocine Saad 48 Nov 25, 2022
Add a general-purpose tools page to your Filament project. 🛠

Add a general-purpose tools page to your Filament project. Installation You can install the package via Composer: composer require ryangjchandler/fila

Ryan Chandler 24 Dec 6, 2022