Why are there 2 version of Laravel? - laravel

I just notice that at Github, there are 2 version of Laravel. One is this: https://github.com/laravel/laravel and the other is https://github.com/laravel/framework. One has more frequent update than the other. For example: one has laravel version 4.1.30 and 4.2.1, but the other one has version 4.1.27 and 4.2.0.
I tried to do composer install & update for laravel 4.1.* on 2 different computer. One give me version. 4.1.30, but the other give me 4.1.27.
Why is that there are two of it? What is the difference?

The first repository link in your question (https://github.com/laravel/laravel) is to build an application using Laravel 4 and you should use this (laravel/laravel) repository if you want to build an application using the Laravel framework.
On the other hand, the second one which is https://github.com/laravel/framework; it's the core code of the Laravel framework and there is a note available in that Github page as given below:
Note: This repository contains the core code of the Laravel framework.
If you want to build an application using Laravel 4, visit the main
Laravel repository.
So, if you want to contribute in the Laravel Framework then clone this repository. This is the core code repository/Laravel Framework (Kernel) and it's laravel/framework not for building an application.
Installation:
For installing the Laravel to build an application you may use:
// Via Composer Create-Project
composer create-project laravel/laravel --prefer-dist
Also you may use this (using Laravel installer and it's faster than composer install):
// Via Laravel Installer
laravel new projectname
For this, you need to download the Laravel installer PHAR archive first. For detail information, check Via Laravel Installer on Laravel website.

The recommended method of installing Laravel is via Composer with the following command:
composer create-project laravel/laravel --prefer-dist
This uses the laravel/laravel repository as the beginning for your project. One of laravel/laravel's Composer dependencies is laravel/framework, which'll get installed to your copy of laravel/laravel's vendor directory along with any dependencies you add yourself.
Everything in laravel/laravel is part of your application code - you'd tweak it, check it into your version control, etc. The stuff in laravel/framework is stuff you use, but don't touch, and it's exempted from version control.

One is the application you'd use as an end user, the other is the core packages which make up the framework.
So when you install laravel/laravel it pulls in the components from laravel/framework into the /vendor directory.

Related

How to setup the Shopware development template without docker? (to provide a Shopware platform pull request)

I understand, that in order to contribute to the Shopware platform / core, I have to setup Shopware 6 using the development template.
I followed the steps at
https://github.com/shopware/platform#quickstart--installation
But only until
./psh.phar docker:start
I was thinking about installing via bin/console system:setup and bin/console system:install but it fails with
PHP Fatal error: Uncaught Symfony\Component\Dotenv\Exception\PathException:
Unable to read the "/home/projects/shopware-dev-bd/bin/../.env" environment file. in
/home/projects/shopware-dev-bd/vendor/symfony/dotenv/Dotenv.php:567
Is there an easy way to create the .env? Do I have to copy it manually?
It is recommended now to use the platform repository directly for setting up development installations.
Just clone directly from shopware/platform
composer install
bin/console system:setup to create the .env file
composer run setup
optionally bin/console framework:demodata if you need demo data
Addition to the accepted answer:
While in the development template there was psr.phar to manage things like building the admin theme, and in production template there is bin/build-administration.sh none of those are there in the method described by #dneustadt.
Instead this is managed by composer scripts which are defined in the composer.json
For example admin JS is build using
composer run build:js:admin

Laravel sail not supported dependency error [duplicate]

We are using PHPCI and composer. The server which runs PHPCI is on PHP 5.3.
For a project we added the Facebook PHP SDK, using composer. It requires PHP 5.4.
Composer gets triggered by PHPCI and get executed. But because the CI server just got PHP 5.3 composer failed with the error message:
facebook/php-sdk-v4 4.0.9 requires php >=5.4.0 -> no matching package found.
This let fail my build in PHPCI, of course.
Is there a possibility to skip this requirement? Maybe by adding an option to composer.json? Or a parameter to composer.phar call?
I've found the option:
composer install --ignore-platform-reqs
Ignore platform requirements (php & ext- packages).
Alternative: Specify your projects' PHP version
You can skip the platform checks by configuring composer.json#/config/platform/php with the PHP version to use.
Composer will fetch packages based on that configured PHP version then.
So when you need to tell Composer the PHP version for your projects dependencies, you can (and should) specify the PHP version if different than the PHP version you execute composer with in your composer.json project configuration file (AKA root package):
{
"config": {
"platform": {
"php": "5.6.6"
}
}
}
Here PHP 5.6.6 version is exemplary, it could be 8.0.4 or any other PHP version.
This also documents the target (platform) PHP configuration. Additionally installed PHP extensions and library versions can be specified.
Compare: Config: platform - Composer documentation
For many commands, you can tell composer to bypass php version check, with parameter "--ignore-platform-reqs":
composer COMMAND --ignore-platform-reqs
this will bypass php version specification.
Be aware that the software may work or not: php version specification is there because somewhere in the code is needed at least the specified php version, so if you use that code the software will break.
If anything requires a specific version of PHP, it won't run in a lower version of PHP. You will properbly still recieve errors when bypassing the PHP requirement.
Btw, PHP 5.3 is no longer maintained, I would strongly recommend updating the PHPCI server.

Laravel Collection installation with Composer and Laravel 5

I need help with a problem.
I'm learning Laravel 5.
And I've found a problem trying to do something.
I tried to install Laravel Collection.
I go to composer.json and I add this line on require:
"laravelcollective/html": "5.1.*"
But when I execute composer update on shell, I have an error:
Your requirements could not be resolved to an installable set of packages.
And a lot of posibles conclusions to the problem.
I put a screenshot to help you to understand.
Actually, the error messages are clear. You are trying to install a package that has a dependency of laravel componenents with a version of 5.1, but in your composer.json file, you imply that your project works with laravel 5.0. Either change the laravelcollective/html version to 5.0.* or change and upgrade your laravel dependency as 5.1.* so that your problem will be solved.

Installing only new packages from composer.json

I'm trying to make composer update only newly added packages to composer.json i.e when I manually add a package dependency to the composer.json file, it should update the composer.lock file only for the new package; the rest of the packages should be at the same version as before. I tried running composer update --lock but I don't think it does what I'm trying to achieve and it took a lot of time to finish. I checked the commands on composer's documentation but can't find one to achieve my wish. Any advice or workaround will be appreciated.
Note: I'm using Laravel Forge, so there is a 2 minutes deployment limit.
In order to install only new packages with composer you should run
composer install
Because composer update will install your new packages but will update and all the other already installed packages.
You can specify the name of the package as an argument to the update command. This will perform a partial update: composer update the-package/you-want-to-update
I think your question is related to your (guessed) current workflow: To add a new package you edit the composer.json file and then run composer update - wishing to only add/update that new file.
If that is true, here is the solution:
composer require new/package will add the newest possible version (taking into account the currently installed packages) of the new package. Benefits: Only one command line, and no fiddling with JSON content.
If you already know which version you want, you could also run composer require new/package:^2.1.25#beta (or whatever version and stability level you want - this example is exaggerating a bit). If this version is incompatible with existing packages, nothing will get installed, everything will get rolled back, and you get an error message.

how to safely update way generators 3.0 package in laravel 4.2

i figured out too late that way generators version 3 package is not compatible with laravel version 4.2 it only work with laravel 5, now i need to switch to a previous version of the package and i do not know how to do it properly as my laravel project is in the half way.
Thank you so much for any further help
Update your composer.json file to use "way/generators": "~2.0". Once that is done, run the following command:
composer update "way/generators" --dev
By providing the package name to the composer command, composer will only update the specified package.

Resources