Skip to content

In this analysis, I am analyzing every line of code on the Laravel framework.

License

Notifications You must be signed in to change notification settings

isaka-james/laravel-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Logo

🚀 Web-Artisan Engineering 🤵‍♂

since 2 April,2024

What's this about? 🤔

I've crafted this for those who have a deep love for PHP. It's not just for the framework users, but also for those curious about the magic behind this popular PHP framework.

This serves as an understanding of how Laravel works, an operational tutorial, and offers unique ways to optimize along the way. You're welcome to delve deeper into Laravel and advance your skills.

So, I'm eager and grateful to share the inner workings of Laravel with you fella!

My Thoughts 💭:

Big thanks to @taylorotwell for making Laravel framework accessible to all. If you're looking for someone to follow or sponsor, he's a great choice!

image

"Make developers' lives easier, and you'll be heaven-bound for sure." — Yours Truly

Contributions Welcome! 🎉

Laravel is a vast PHP framework with a plethora of features and technologies. I warmly welcome all corrections, suggestions, and new ideas to this analysis. Together, let's help fellow web-artisans better understand this framework.

Let's Get Set Up 🛠️

Blueprint 🗺️

Installing Laravel:

First off, according to the official Laravel documentation, you'll need to have PHP and Composer installed on your system to create and use Laravel projects.

image

To create a new Laravel project, use this command:

composer create-project laravel/laravel:^11.0 laravel-project

Alternatively, you can use the Laravel installer:

composer global require laravel/installer
laravel new laravel-project

If you're wondering what Composer is, it's an application-level dependency manager for PHP. Check out Composer's official website for more info.

Another Way:

For the geeks among us, here's another method:

git clone https://github.com/laravel/laravel.git
cd laravel
composer install

Using this method, you'll need to change the file .env-example to .env, which contains the environment variables for your application.

Notice that the vendor directory is not present initially. After running the composer command, the vendor directory will be created, containing the composer dependencies. We'll explore this further later on.

Setting Up the Project:

By default, Laravel uses sqlite database. However, for this analysis, we'll use mysql:

Update the .env file as follows:

Before:

DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=

After:

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

Assuming you have a database called laravel, customize these credentials as needed.

Ensure you've created your database using mariadb or phpmyadmin.

Next, run this command to initialize the pre-defined tables that come with Laravel, such as session storage:

php artisan migrate

Testing the Configuration:

php artisan serve

By default, Laravel listens on port 8000. After running this command, open your browser and go to http:localhost:8000 to see the default page. image

Laravel's Basic Tree:

The tree is quite large, so I've placed it in a separate file. You can view the Laravel Tree here.

Let's Dive In 🏊‍♂️

Now that you've seen Laravel's default page, let's delve into what's behind the scenes.

We'll start with the artisan file, here.

Jump to Your Interest 🚀

Feel free to explore my the whole roadmap.

License

MIT