Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 7 |
| ImageController | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 7 |
| resizeImage | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| resizeImagePost | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 6 |
|||
| <?php | |
| namespace App\Http\Controllers; | |
| use Illuminate\Http\Request; | |
| use App\Helpers\ImageHelper; | |
| class ImageController extends Controller | |
| { | |
| // | |
| /** | |
| * Show the form for creating a new resource. | |
| * | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function resizeImage() | |
| { | |
| return view('resizeImage'); | |
| } | |
| /** | |
| * Show the form for creating a new resource. | |
| * | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function resizeImagePost(Request $request) | |
| { | |
| $this->validate($request, [ | |
| // 'title' => 'required', | |
| 'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048', | |
| ]); | |
| $image = ImageHelper::upload($request->file('image')); | |
| return back() | |
| ->with('success','Image Upload successful') | |
| ->with('imageName',$image); | |
| } | |
| } |