I created a project with Laravel and downloaded from git
via this command:
git clone -b develop git://github.com/laravel/laravel.git
The file size was about 21MB,
I want to know should I download Laravel for every project with this command?
Via Download. Once Composer is installed, download the 4.2 version of the Laravel framework and extract its contents into a directory on your server. Next, in the root of your Laravel application, run the php composer.phar install (or composer install ) command to install all of the framework's dependencies.
Installing PHP 7.3+Laravel 8 requires PHP 7.3+ or above so you need this version or the latest version of PHP installed on your system. The process is straightforward on most systems.
At first, you should install XAMPP on your computer. To install different versions of Laravel, the PHP version of your XAMPP program is very important. If you have a lower version of PHP, you should upgrade it. Laravel needs the Composer program to manage its extensions.
The first and best advantage of using the Laravel framework is that it follows - Model, View, and Controller-based architectural pattern and it has an expressive beautiful syntax which makes it object-oriented. Laravel provides an out-of-the-box configuration for the Authentication and Authorization system.
What you have done is cloned the framework itself, which you should only do if you're going to fork and develop the Laravel core.
What you should do instead is use Composer to install your Laravel projects. You'll also be using Composer for other dependency-related actions in said projects (including autoload). This is the proper way of installing a fresh Laravel framework for developing a website:
composer create-project laravel/laravel --prefer-dist
http://laravel.com/docs/installation
Then, any future Laravel projects you create will be loaded from your Composer cache without needing to re-download.
The Composer package also sets up all your vendor-related .gitignore
information and includes several other really useful management features. This is important, because you only want to keep your application-specific code under git
version control, not the framework itself or any other dependencies. (Otherwise, your diffs and commits will get polluted with the dependencies' development changes.)
Once you've created a repository for your project, and installed Laravel with Composer, and created your first few commits (with some migrations, models, and controllers, for instance), cloning your project usually works something like this:
cd /clone-here
git clone /myproject # Location of current project
# /clone-here now has only the application-specific files from /myproject. It is
# still missing the framework itself and other dependencies.
composer install # Composer now looks at the dependencies in
# /clone-here/composer.json and installs them into /clone-here/vendor
# including the Laravel framework.
# Now the framework and other dependencies are good to go.
php artisan migrate # Laravel makes all your DB schemas from your migrations
php artisan db:seed # Seed your lovely new DB tables
It's really elegant and fun once you get used to it.
Edit:
See Sheikh
's answer to save some time in the Composer install process!
Already Leng
gave a nice answer.
Installing Laravel since version-4.1*
via Laravel Installer is faster than composer
First, download the Laravel installer PHAR archive. For convenience, rename the file to laravel and move it to /usr/local/bin. Once installed, the simple laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog would create a directory named blog containing a fresh Laravel installation with all dependencies installed. This method of installation is much faster than installing via Composer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With