Laravel upgrade from laravel 7 to laravel 10

  Thu 18 / 05 / 2023

  Posted by: +923105741095

Category : Laravel

Tags : laravel , php laravel , backend , deployment

Post Thumbnail
Description

sir actually i want to upgrade version from  7 to 10 but i am facing issue upgradation is not done i will make change regarding upating but i am facing this issue i attached issue screenshot below please check it and code above that is write in composer .json


View Code
                        {
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^8.0",
        "laravel/framework": "^10.0",
        "laravel/tinker": "^2.0",
        "laravel/ui": "^4.0",
        "fruitcake/laravel-cors": "^3.0",
        "setasign/fpdf": "^1.8",
        "setasign/fpdi": "^2.3",
        "twilio/sdk": "^6.10"
    },
    "require-dev": {
        "facade/ignition": "^3.0",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^4.1",
        "phpunit/phpunit": "^8.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "files": [
            "app/helpers.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}
                
  Answered by CDL

Here are some gotchas when using fruitcake/laravel-cors: Put HandleCors middleware at the top of $middleware in app/Http/Kernel.php:

~~~

protected $middleware = [

\Fruitcake\Cors\HandleCors::class,

\App\Http\Middleware\TrustProxies::class,

\App\Http\Middleware\CheckForMaintenanceMode::class,

\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,

\App\Http\Middleware\TrimStrings::class,

\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,

];

~~~

Putting it at the bottom or somewhere between won't work because requests might be rejected by other middlewares with higher priority.


For more details please visit the StackOverflow link. 

  Comment   Share
0 Likes   0 Comments