ModifsModifs
This commit is contained in:
parent
0ddc6e835a
commit
6608d12b1c
|
@ -15,7 +15,6 @@
|
||||||
"symfony/process" : "3.*",
|
"symfony/process" : "3.*",
|
||||||
"intervention/image": "^2.4",
|
"intervention/image": "^2.4",
|
||||||
"intervention/imagecache": "^2.3",
|
"intervention/imagecache": "^2.3",
|
||||||
"jenssegers/model": "^1.1",
|
|
||||||
"spatie/laravel-image-optimizer": "^1.1"
|
"spatie/laravel-image-optimizer": "^1.1"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
namespace Meoran\Images\Http\Controllers;
|
namespace Meoran\Images\Http\Controllers;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
use Laravel\Lumen\Routing\Controller as BaseController;
|
use Laravel\Lumen\Routing\Controller as BaseController;
|
||||||
use Meoran\Images\Model\Image;
|
use Meoran\Images\Model\Image;
|
||||||
|
|
||||||
|
@ -21,11 +22,13 @@ class ImagesController extends BaseController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function upload()
|
public function upload(Request $request)
|
||||||
{
|
{
|
||||||
$pathImage = storage_path('Sunset_at_Tiergarten_UHD.jpg');
|
$this->validate($request, [
|
||||||
|
'image' => 'required|file|image'
|
||||||
|
]);
|
||||||
|
|
||||||
$image = new Image(['content' => $pathImage]);
|
$image = new Image(['content' => $request->input('image')]);
|
||||||
$image->save();
|
$image->save();
|
||||||
|
|
||||||
return response()->json($image);
|
return response()->json($image);
|
||||||
|
|
|
@ -32,7 +32,7 @@ class ImagesServiceProvider extends ServiceProvider
|
||||||
|
|
||||||
public function loadRoutes()
|
public function loadRoutes()
|
||||||
{
|
{
|
||||||
$this->app->get('images/upload', [
|
$this->app->post('images/upload', [
|
||||||
'as' => 'uploadImage', 'uses' => '\Meoran\Images\Http\Controllers\ImagesController@upload'
|
'as' => 'uploadImage', 'uses' => '\Meoran\Images\Http\Controllers\ImagesController@upload'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue