Use installed file which name contain hyphen via composer - composer-php

I'd like to use installed file via composer. However, its name has hyphens. So, I’m troubled. How do I use in case of the situation?
composer.json
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.0.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "^2.8",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0",
"j7mbo/twitter-api-php": "dev-master"
},

Since composer packages aren't case-sensitive, hyphens (or dash) are used as an alternative to CamelCace notation:
Note that package names are case-insensitive, but it's encouraged to
use a dash (-) as separator instead of CamelCased names.
Source: https://packagist.org/about
Class names can't contain hyphens, but are case-sensitive. You can use it's CamelCase class name. In your case, TwitterAPIExchange.php is autoloaded, so you can use:
$twitter = new TwitterAPIExchange($settings);

Related

Laravel model can't be named 'Match' [duplicate]

This question already has an answer here:
List of PHP Keywords that are Invalid as Class Name Parts
(1 answer)
Closed last year.
I want to create a model in Laravel named 'Match'. When I try to do this, I get an error: syntax error, unexpected token "match", expecting identifier. When I add a character (for example: 'Matcha'), the error goes away.
I am using this code in composer.json:
"require": {
"php": "^7.3|^8.0",
"beyondcode/laravel-websockets": "^1.12",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.75",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.4"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10"
},
I have tried to solve the problem, but I couldn't find any solutions on the internet.
Is there a way I can solve this error?
You are using PHP 8 and match is a reserved keyword in PHP 8.
Refer reserved keywords.

Composer update failure

I understand there has been a number of solutions provided for this question but I can't seem to find an answer.After running composer update I am getting this error Problem 1. What could be the issue? Here is the "required" section for the composer.json file.
"require": {
"barryvdh/laravel-ide-helper": "~2.4",
"doctrine/dbal": "~2.8",
"dompdf/dompdf": "~0.8",
"filp/whoops": "~2.2",
"guzzlehttp/guzzle": "~6.3",
"guzzlehttp/psr7": "~1.4",
"illuminate/support": "^6.12",
"intervention/image": "~2.4",
"laracasts/utilities": "~2.1",
"laravel/framework": "~5.6",
"laravel/socialite": "~3.0",
"laravelcollective/html": "^6.0",
"league/flysystem-aws-s3-v3": "~1.0",
"maatwebsite/excel": "~2.1",
"maxhoffmann/parsedown-laravel": "dev-master",
"mcamara/laravel-localization": "~1.2",
"mews/purifier": "^2.1",
"milon/barcode": "~5.3",
"nitmedia/wkhtml2pdf": "dev-master",
"omnipay/common": "~3",
"omnipay/dummy": "~3",
"omnipay/paypal": "~3",
"omnipay/stripe": "3.1",
"php-http/curl-client": "^1.7",
"php-http/message": "^1.6",
"predis/predis": "~1.1",
"vinelab/http": "~1.5",
"laravel/tinker": "^1.0",
"stripe/stripe-php": "^6.43",
"paynow/php-sdk": "^1.0",
"berzel/paynow-php": "^1.1"
},
"require-dev": {
"phpunit/phpunit": "7.3.*",
"phpspec/phpspec": "5.0.*",
"fzaninotto/faker": "1.8.*",
"symfony/dom-crawler": "~3.0",
"symfony/css-selector": "~3.0"
},
One or many of your packages are looking for a different version of another / sub package. Not only does Laravel itself depend on a whole slew of different 3rd party packages, so do the packages you install. Keeping up to date on all of them is challenging.
If you look at the error reported:
Laracasts/utilities 2.1 requires illuminate/support ~5.0
It is telling you that this particular package you are trying to install (Laracasts utils) needs a v5 from illuminate/support. Most likely, if you are working with Laravel V6, you thus are likely pulling in an illuminate/support package of a different version than required.
Solution:
Either find an updated Laracast package that will accept a newer version of illuminate/support, or reduce Laravel to V5 (which will pull in an older version of support). Former is preferable :)

Laravel: This cache store does not support tagging with array or redis

I am getting the following error on my Laravel application :
BadMethodCallException
This cache store does not support tagging.
But, in my .env I have set CACHE_DRIVER=array or redis.
I am unable to use spatie/laravel-responsecache because of this issue.
Reinstalling my application didn't help.
Maybe a package is interfering with my app, but the problem is new. Here is my composer.json:
"require": {
"php": "^7.3",
"ext-json": "*",
"doctrine/dbal": "^2.9",
"felixinx/gtfs-realtime-protobuf-php": "#dev",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^6.0",
"laravel/horizon": "^3.2",
"laravel/tinker": "^1.0",
"league/csv": "^9.1",
"mad-web/laravel-initializer": "^2.0",
"predis/predis": "^1.1",
"pusher/pusher-php-server": "~4.0",
"spatie/laravel-responsecache": "^6.3",
"symfony/psr-http-message-bridge": "^1.1"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
You need to define the RESPONSE_CACHE_DRIVER environment variable:
RESPONSE_CACHE_DRIVER=array|redis|memcached
Check cache_tag on your config/responsecache.php file.
/*
* If the cache driver you configured supports tags, you may specify a tag name
* here. All responses will be tagged. When clearing the responsecache only
* items with that tag will be flushed.
*
* You may use a string or an array here.
*/
'cache_tag' => '', // <-- make sure this is empty
If it's already empty, try setting it to false or null. Hope it helps!
Using the php artisan optimize:clear command worked for me. It clears everything, I'm guessing clearing config cache would be enough.

Laravel upgrage 5.5 to 5.6 - routing error

I have one problem after updating my Laravel 5.5 project to 5.6.
Type error: Argument 1 passed to Illuminate\Routing\Router::sortMiddleware()
must be an instance of Illuminate\Support\Collection,
instance of Tightenco\Collect\Support\Collection given,
called in ../vendor/laravel/framework/src/Illuminate/Routing/Router.php on line 676
My composer.json
"require": {
"php": ">=7.1.3",
"ellipsesynergie/api-response": "^0.15.0",
"fideloper/proxy": "~4.0",
"jeroen-g/laravel-packager": "^1.6",
"laravel/framework": "5.6.*",
"laravel/tinker": "~1.0",
"predis/predis": "^1.1"
}

Toddish verify package error

I ran composer update today, and one of my package Toddish/Verify was d
Class Toddish\Verify\VerifyUserProvider contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Illuminate\Auth\UserProviderInterface::retrieveByToken, Illuminate\Auth\UserProviderInterface::updateRememberToken)
Have no idea how to fix it
composer json
"require": {
"laravel/framework": "4.1.*",
"mews/captcha": "dev-master",
"intervention/image": "dev-master",
"moltin/laravel-cart": "dev-master",
"davejamesmiller/laravel-breadcrumbs": "dev-master",
"artdarek/oauth-4-laravel": "dev-master",
"lucadegasperi/oauth2-server-laravel": "dev-master",
"toddish/verify": "2.*",
"doctrine/dbal": "~2.3",
"pda/pheanstalk": "dev-master",
"maatwebsite/excel": "dev-master"
}
After Laravel upgrading To 4.1.26 you have to upgrade Todish pagackage
run in console composer update
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing toddish/verify (v2.3.1)
- Installing toddish/verify (v2.4.0)
Downloading: 100%

Resources