Laravel / Intervention Image Class - class not found

前端 未结 7 616
无人及你
无人及你 2020-12-03 05:00

I just installed Intervention Image Class following instructions from here: http://image.intervention.io/getting_started/installation

I also added these 2 lines into

相关标签:
7条回答
  • 2020-12-03 05:07
    composer require intervention/image
    

    solves definitively the problem.

    0 讨论(0)
  • 2020-12-03 05:07
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.2.*",
        "intervention/image": "dev-master"
    },
    

    add new code "intervention/image": "dev-master" in composer.json, and cmd

    $ composer update
    
    0 讨论(0)
  • 2020-12-03 05:12

    Step 1:

    Add "intervention/image": "dev-master" to the “require” section of your composer.json file.

    "require": {
        "laravel/framework": "4.1.*",
        "intervention/image": "dev-master"
    },
    

    Step 2:

    Run CMD;
    $ composer install
    

    If you've got this warning:

    Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.

    do $ composer update and then $ composer install

    Step 3:

    open the config/app.php file. Add this to the $providers array.

    Intervention\Image\ImageServiceProvider::class
    

    Step 4:

    Next add this to the $aliases array.

    'Image' => Intervention\Image\Facades\Image::class
    

    Step 5:

    If there is an error;

    Class 'Intervention\Image\ImageServiceProvider' not found

    try

    $ composer update
    
    0 讨论(0)
  • 2020-12-03 05:14

    Try add \ symbol before Image:

    \Image::make();
    

    It helped for me on Laravel 5.3 and Intervention 2.3

    0 讨论(0)
  • 2020-12-03 05:20

    just write that on the controller

    use Image;

    config/app.php providers

    Intervention\Image\ImageServiceProvider::class,

    Alias

    'Image' => Intervention\Image\Facades\Image::class,

    0 讨论(0)
  • 2020-12-03 05:26

    Try this, It works for me.

    use Intervention\Image\Facades\Image as Image;
    
    0 讨论(0)
提交回复
热议问题