Every laravel developer has this wish to contribute to laravel, but it's hard to find a starting point on how to do that. where to start, how this, what that, all these questions and searching on the internet won't be much of a help. There are many articles on how to do laravel but almost no detailed information on how to contribute to this master framework.
In this article, we will try to find out answers to some of those questions.
Familiarize Yourself with Laravel
Before jumping in the contributing, I would highly recommend that you familiarize yourself with laravel. it can be done in the following three ways.
- Read the Documentation
- Build Projects
- Engage with the Community
If you think you have overcome the above-mentioned requirement, let's get started.
Fork the Laravel Framework Repository
The first step in the contribution is to fork the laravel framework repository in your GitHub account.
Pro Tip: While forking uncheck the latest release branch only check. Else you will have only the latest release branch in your account.
Local Setup
Follow the steps below to set up the workflow on your local machine.
Create a new Laravel project
Create a new laravel project. You can get instructions for that from here. As of this time, laravel 11 is the latest version so that will be our base for the work. Once you have the setup up and running we will start our development changes. You can also use the following command.
composer create-project laravel/laravel laravel-app
Clone the Fork on your machine
Use the following command to clone the fork to your local machine
git clone "path to your git repository"
Pro Tip: I suggest to make the directory structure as shown in the picture below.
Updating the composer.json
Once all the things are in place, update the content of composer.json
with the following content.
"minimum-stability": "dev",
"repositories": [
{
"type": "path",
"url": "../laravel-framework"
}
]
After that run composer update
Now you have your laravel App using your local copy of the laravel framework.
Create a Feature or Bug Branch
Create a new branch on your local machine and make the required changes. You can use the following command to create a new branch.
git checkout -b feature/new-feature
Once the changes are done, push the changes to your repository.
Create a new Issue and submit the PR in reference to that issue.
Create a new issue in the parent repository, in our case the laravel/framework repository. Be as detailed as you can be for the update you are doing.
And there we go. You have your contribution done. Ones verified by the Laravel maintainers it can move forward.
Fell free to comment below in case of feedback or questions.
For those who are visual learners
Here is the Link to YouTube Video