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

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.

Related

What is causing a slow Laravel 8 website?

I have migrated one website from Laravel 5.7 to Laravel 8.
On localhost, everything seems to work fine, unfortunately on my webserver sometimes pages get loaded very slot. It can take more than 20+ seconds to load the contact page. On that page, there is just one MySQL query.
The Timeline debugbar is showing just the time to load the page, but nothing more.
I am posting here all my packages, maybe some on them is causing this?
"require": {
"php": "^7.3|^8.0",
"albertcht/invisible-recaptcha": "^1.9",
"arcanedev/log-viewer": "8.x",
"darkghosthunter/laraguard": "dev-master",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"intervention/image": "^2.5",
"jamesmills/laravel-timezone": "^1.9",
"jenssegers/agent": "^2.6",
"lab404/laravel-impersonate": "^1.6",
"langleyfoxall/laravel-nist-password-rules": "^4.1",
"laravel/framework": "^8.12",
"laravel/socialite": "^5.0",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.0",
"laravelcollective/html": "^6.2",
"livewire/livewire": "^2.0",
"mcamara/laravel-localization": "^1.6",
"predis/predis": "^1.1",
"rappasoft/laravel-livewire-tables": "^0.3",
"rappasoft/lockout": "^3.0",
"romanzipp/laravel-twitch": "^4.0",
"spatie/laravel-activitylog": "^3.14",
"spatie/laravel-html": "^2.28",
"spatie/laravel-image-optimizer": "^1.6",
"spatie/laravel-permission": "^3.11",
"stichoza/google-translate-php": "^4.1",
"tabuna/breadcrumbs": "^2.2",
"thujohn/twitter": "^2.3"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"barryvdh/laravel-debugbar": "^3.2",
"barryvdh/laravel-ide-helper": "^2.6",
"codedungeon/phpunit-result-printer": "^0.29",
"facade/ignition": "^2.5",
"friendsofphp/php-cs-fixer": "^2.16",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^0.0.5",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
}
I don't have any clue how to solve this problem. Will appreciate every tip or tool on how to analyze my pages.

Please provide a valid cache path Laravel deployment to GCP¨

I got this error when I'm trying to deploy my laravel project to GCP.
I deploy the same project in Heoku I don't have any problem and the project.
Step #1: [29-Aug-2020 20:37:05 UTC] [2020-08-29 20:37:05] local.ERROR: Please provide a valid cache path. {"exception":"[object] (InvalidArgumentException(code: 0): Please provide a valid cache path. at /app/vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php:36)
My composer.json
"require": {
"php": "^7.1.3",
"ext-gd": "*",
"barryvdh/laravel-dompdf": "^0.8.6",
"bitfumes/laravel-multiauth": "^3.0",
"bodunde/geocoder": "^1.2",
"consoletvs/charts": "6.*",
"fideloper/proxy": "^4.0",
"fx3costa/laravelchartjs": "^2.7",
"fzaninotto/faker": "^1.4",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"maatwebsite/excel": "^3.1",
"spatie/geocoder": "^3.5",
"twilio/sdk": "^6.9"
},
"require-dev": {
"filp/whoops": "^2.0",
"laravel/ui": "^1.1",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},

Moving from laravel 6 to 7x getting this error, arcanedev/laravel-messenger 7.2.0 requires arcanedev/support ^5.1

Moving from laravel 6 to 7x getting this error, arcanedev/laravel-messenger 7.2.0 requires arcanedev/support ^5.1
This is the error while i run composer update
This is composer.json file
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"arcanedev/laravel-messenger": "7.2",
"cboden/ratchet": "^0.4.2",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3",
"intervention/image": "^2.4",
"laravel/cashier": "^10.5",
"laravel/framework": "7.0.*",
"laravel/nexmo-notification-channel": "^2.3",
"laravel/tinker": "^2.0",
"php-imap/php-imap": "^4.1",
"pusher/pusher-php-server": "^4.0",
"spatie/laravel-permission": "^3.13.0",
"twilio/sdk": "^6.6",
"webklex/laravel-imap": "^1.4"
},
"require-dev": {
"facade/ignition": "^2.0",
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.9.1",
"laravel/ui": "^2.0.0",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
I can not post complete Composer.json file here getting this error while i posting my question, so i attached another screenshot of my composer.json file
screenshot of my composer.json file
Can anyone help me out? Thank you!

Composer memory limit exhausted [duplicate]

This question already has answers here:
Composer require runs out of memory. PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted
(39 answers)
Closed 2 years ago.
i have business hosting at All-Inkl.com, unfortunately i cannot use composer there anymore. The support wrote more that I have reached the limit of 1.5 GB and more is not possible.
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes)
Now my question is, is there any way to let the Composer update or install it piece by piece, so that it frees the memory in between or is there any other solution to run my Laravel app on the server?
Currently the following packages are in the Composer JSON. And there are a few more planned.
"require": {
"php": "^7.2.5",
"ext-json": "*",
"benjaminhirsch/nova-slug-field": "^1.2",
"cloudcake/nova-snowball": "^1.2",
"ctessier/nova-advanced-image-field": "^1.0",
"davidpiesse/nova-toggle": "^0.0.6",
"digitalcloud/nova-address-field": "^1.3",
"dillingham/nova-detail-link": "^1.0",
"ebess/advanced-nova-media-library": "*",
"ek0519/quilljs": "^0.1.9",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"gabrieliuga/laravel-mail-log": "*",
"guzzlehttp/guzzle": "^6.3",
"inspheric/nova-email-field": "^1.42",
"jenssegers/agent": "^2.6",
"jubeki/nova-card-linkable": "^1.1",
"kabbouchi/nova-logs-tool": "*",
"khalin/nova-link-field": "*",
"klepak/nova-dynamic-page-title": "^1.0",
"laraning/nova-time-field": "^0.2.5",
"laravel/framework": "^7.0",
"laravel/nova": "*",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
"laravelcollective/html": "^6.1",
"m-a-k-o/nova-custom-table-card": "^2.0",
"maatwebsite/laravel-nova-excel": "^1.2",
"normanhuth/nova-menu-order": "1.0.2",
"ofcold/nova-sortable": "^1.0",
"opanegro/field-nova-password-show-hide": "^1.0",
"raiym/instagram-php-scraper": "^0.9.7",
"richardkeep/nova-timenow": "^1.0",
"sbine/route-viewer": "^0.0.6",
"sidis405/nova-installed-packages": "^0.1.8",
"spatie/laravel-activitylog": "^3.11",
"spatie/laravel-backup": "^6.8",
"spatie/laravel-medialibrary": "^7.19",
"spatie/laravel-permission": "^3.11",
"spatie/nova-backup-tool": "*",
"spatie/schema-org": "^2.12",
"vyuldashev/nova-permission": "*",
"whitecube/nova-flexible-content": "^0.1.16"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpmd/phpmd": "^2.8",
"phpunit/phpunit": "^8.5",
"sirbrillig/phpcs-import-detection": "^1.2",
"sirbrillig/phpcs-variable-analysis": "^2.8",
"squizlabs/php_codesniffer": "^3.5"
},
I tried the limit at -1 and 99999.The "All-Inkl" webhosting servers are just too weak and already reached their limits. I will now change the provider and temporarily copy the packages manually to the server.

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.

Resources