Search code examples
phplaravelintervention

Laravel - If I have model Image and instal Intervention Image package will they conflict?


I am currently having a Product model that has a one to many relationship with Image model. I need to manipulate my images so I want to use the Image Intervention package but I am afraid they might conflict and mess up everything. So should I watch out for something or should I install directly?


Solution

  • The Image Intervention package really only supplies you with a Facade so that you can manipulate images easily. It has no effect on your database models, or any other code.

    It is just like any other of the library, you pull it in and it will give you access to things like

    $img = Image::make('public/foo.jpg');
    $img->resize(320, 240);
    

    Where as before you would need to load the image with gd/gd2, get the picture information, figure out the size to resize and scale it down, etc...

    tl;dr; You can bring that package in safely