In this project I tried my best to recreate a framework very similar to laravel to understand its internals and getting more deep in php.
Download the repository or clone it by using this command:
git clone https://github.com/SniffAByte/My-Little-Framework.git
Install the project dependencies via composer:
composer install
Rename .env.example
file to .env
and update it with your data.
cd
into the project directory and run this command:
php -S localhost:8080 -t public/ public/index.php
thephpleague/route/
is the responsible for routing system. You can check their documentation through this page.
redirect($path)
is a helper function receives a path or a url to redirect the user to.
Already registered middlewares are Authenticated
, Guest
, and other middlewares you can find or create your own middlewares inside App/middleware
folder and register them by adding to config/app.php
middlewares array.
Eloquent is used for Database connection so that any information you need will be found in Eloquent documentation.
You can switch to Doctrine or whatever you want for ORM by modifying the Database Service Provider App\Providers\DatabaseServiceProvider
and updating depenting functions inside Auth (App\Auth\Auth
) class with the syntax of the new package
Twig template engine is used in this project. You can add your views files inside views
directory and all twig syntax will be find through twig documentation.
vlucas/valitron
package is used for validation and the validate functionality is written inside the Abstract Controllers inside App/Controllers
directory. You can check rules through (their docs)[https://github.com/vlucas/valitron]. And you can create your own rules and register them inside App\Providers\ValidationRuleServiceProvider
.