欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Resize image in Laravel 5.2 uploads upload 上传 有大用 有大大用

Can anyone help me how to implement resizing image in Laravel?

I have this code only:

if($request->hasFile('image')){
    if (Input::file('image')->isValid()) {
        $file = Input::file('image');
        $destination = base_path() . '/public/images/ServiceImages';
        $extension = Input::file('image')->getClientOriginalExtension();
        $fileName = rand(111,99999).'.'.$extension;

        if(!empty($data['Image'])){
            unlink($destination.$data['Image']);
        }

        $file->move($destination, $fileName);
        $service->image=$fileName;
    }
}
普通分类: