src/controllers/FileController.php
public function image() {
		if (Request::hasFile('image') && Request::has('table_name') && Request::has('field_name')) {
			return json_encode(self::saveImage(
				Request::input('table_name'), 
				Request::input('field_name'), 
				Request::file('image'),
				null,
				Request::file('image')->getClientOriginalExtension()
			));
		} elseif (!Request::hasFile('image')) {
			return 'no image';
		} elseif (!Request::hasFile('table_name')) {
			return 'no table_name';
		} elseif (!Request::hasFile('field_name')) {
			return 'no field_name';
		}
	}
public function image() {
		if (Request::hasFile('image') && Request::has('table_name') && Request::has('field_name')) {
			return json_encode(self::saveImage(
				Request::input('table_name'), 
				Request::input('field_name'), 
				Request::file('image'),
				null,
				Request::file('image')->getClientOriginalExtension()
			));
		} elseif (!Request::hasFile('image')) {
			return 'no image';
		} elseif (!Request::hasFile('table_name')) {
			return 'no table_name';
		} elseif (!Request::hasFile('field_name')) {
			return 'no field_name';
		}
	}
public function image ( ) { if ( Request :: hasFile ( 'image' ) && Request :: has ( 'table_name' ) && Request :: has ( 'field_name' ) ) { return json_encode ( self :: saveImage ( Request :: input ( 'table_name' ) , Request :: input ( 'field_name' ) , Request :: file ( 'image' ) , null , Request :: file ( 'image' ) -> getClientOriginalExtension ( ) ) ) ; } elseif ( ! Request :: hasFile ( 'image' ) ) { return 'no image' ; } elseif ( ! Request :: hasFile ( 'table_name' ) ) { return 'no table_name' ; } elseif ( ! Request :: hasFile ( 'field_name' ) ) { return 'no field_name' ; } }
handle image upload route
handle image upload route