Support the ongoing development of Laravel.io →
Configuration Database Validation
Last updated 1 year ago.
0
Solution
if ($request->hasFile('image')) {
    $image = $request->file('image');
    $upload = 'uploads/image';
    $filename = $image->getClientOriginalName($filename);
    /* You can also use the fit(w,h) method,
    which crops and resizes the image, instead of the resize(w,h) method... */
    $img = Image::make($image)->resize(200, 200);
    $img->save($upload.'/'.$filename);
} else {
    $filename = null;
}

$datas = new Information();

$datas->idno = Input::get('idno');
$datas->email = Input::get('email');
$datas->image = $filename;
Last updated 8 years ago.
0

lagbox - thanks men ! you're a hero :)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

taneoboy taneoboy Joined 6 Feb 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.