Composer test branch install - laravel

I have made a test branch to test some composer installations:
https://github.com/Sangoku/laravel4-idehelper-generator/tree/compabilityTest
Now I want to install via Composer this changed branch on my Laravel project, but I don't know how I could tell composer to pull my version of the code.
I don't know Composer enough to tell it which branch he should pull.

Edit your composer.json and:
require the package
"require": {
...
"jonphipps/idehelper": "dev-master"
},
And set the repository for it to be downloaded from
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Sangoku/laravel4-idehelper-generator.git"
}
],

Related

I cant install ffmpeg binary driver on my laravel project

I am trying to install ffmpeg binary on my laravel application but I am getting this error. Could not find a matching version of package php-ffmpeg/binary-driver. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (dev). I am using laravel 6.4.1
My composer.json
{
"require": {
"pawlox/video-thumbnail": "^1.0",
"lakshmaji/thumbnail": "^1.4",
"pion/laravel-chunk-upload": "^1.3",
"pbmedia/laravel-ffmpeg": "^5.0"
},
"repositories": [{
"type": "vcs",
"url": "https://github.com/PHP-FFMpeg/BinaryDriver.git"
}]
}
composer require php-ffmpeg/binary-driver=dev-master
Any Solutions. Thanks
php-ffmpeg is not a front-end package, so you have to install it by your composer and it is on composer.json not package.json. you can find windows version of php-ffmpeg here:
For Windows users: Please find the binaries at

How to require node_modules from my own Laravel project packages

I'm setting up my own Laravel Package, and want to create dependancies to some node_modules. How can they be required in the composer.json of my package for this is not linked to the node_modules.
Used Git Bash to install to create my package in the packages/my/project/ folder and my composer.json looks like this:
{
"name": "my/project",
"description": "Description.",
"keywords": [
"front-end",
"framework"
],
...
"require": {
"php": ">=7.1.0"
},
I want te require from node_modules: #vue/component-compiler-utils
You can require them in package.json file in your root directory and then run a npm install. And then add them to your app.js or bootstrap.js file under resources/js and run a npm run production.

How to write an odd case version constraint for composer?

The constraint that I am interested in is
"require":{ "php": "..."
Is there a way to target php 7.1 for the project packages in composer.json even though I'm running 7.2 when I call composer update/install on the command line?
You can use platform configuration from Composer: https://getcomposer.org/doc/06-config.md#platform
Basically, your composer.json would look like this:
{
"require": {
...
},
"config": {
"platform": {
"php": "7.1"
}
}
}
This will make sure that you install only packages compatible with PHP 7.1, no matter which PHP version you use to actually install the packages.

composer create-project - command donot work

I have my project on github containing composer.json in the root directory.
This is how my composer.json code looks like:
{
"name": "vendor/projectname",
"description": "My first Composer project",
"authors": [
{
"name": "John Deo",
"email": "johndeo#demo.com"
}
],
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"php": "~5.3"
}
}
I had defined/submited my package on packagist.org.
Now when I try to get the project in my localhost using composer create-project - commands one of its work and another do not work.
1. composer create-project -s dev vendor/projectname >> WORKS
2. composer create-project vendor/projectname >> DO NOT WORK
Can someone please tell why the second command does not work.
What am I missing or doing wrong?
Please Help!
You're missing a stable version of vendor/projectname. In git, a tag (without flag) is a stable version and branches are dev versions. So you have to tag a release (e.g. git tag 1.0.0).

Problems installing Laravel 4 on Windows 7 using XAMP

After installing Composer, I then went to c:\xampp\htdocs and executed the following command:
composer create-project laravel/laravel khandakhulu --prefer-dist
I then get the following error:
[Composer\Repository\RepositorySecurityException] The contents of http://packagist.org/p/laravel/laravel$a996426ffd2d6fcd0d9a 2dfdd97171b28b3d196d34061f15d79ce67004b9c19d.json do not match its signatur e. This should indicate a man-in-the-middle attack. Try running composer ag ain and report this if you think it is a mistake.
Basically we need to force the composer use https repository at composer.json as we know from Laravel.io Forum
But we don't have any skeleton of laravel project. So, use Laravel Installer instead. This global installation generate composer.json at ~/.composer/composer.json and modify to this
{
"require": {
"laravel/installer": "~1.1"
},
"repositories": {
"packagist": { "url": "https://packagist.org", "type": "composer" }
}
}
First time installation of Laravel Installer maybe will get same error, after you force the respository URL. Finally, create your new Laravel application.
~/.composer/vendor/bin/laravel -v new justapp

Resources