Fixed the other upload handleUploads signatures

This commit is contained in:
snipe 2020-08-24 18:32:40 -07:00
parent 66686f8080
commit e5dd6035b9
No known key found for this signature in database
GPG key ID: 10BFFDA3ED34B5AC
3 changed files with 8 additions and 6 deletions

View file

@ -81,7 +81,7 @@ class LocationsController extends Controller
$location->manager_id = $request->input('manager_id'); $location->manager_id = $request->input('manager_id');
$location->user_id = Auth::id(); $location->user_id = Auth::id();
$location = $request->handleImages($location,600, public_path().'/uploads/locations'); $location = $request->handleImages($location);
if ($location->save()) { if ($location->save()) {
return redirect()->route("locations.index")->with('success', trans('admin/locations/message.create.success')); return redirect()->route("locations.index")->with('success', trans('admin/locations/message.create.success'));
@ -146,7 +146,7 @@ class LocationsController extends Controller
$location->ldap_ou = $request->input('ldap_ou'); $location->ldap_ou = $request->input('ldap_ou');
$location->manager_id = $request->input('manager_id'); $location->manager_id = $request->input('manager_id');
$location = $request->handleImages($location,600, public_path().'/uploads/locations'); $location = $request->handleImages($location);
if ($location->save()) { if ($location->save()) {

View file

@ -69,7 +69,7 @@ class SuppliersController extends Controller
$supplier->notes = request('notes'); $supplier->notes = request('notes');
$supplier->url = $supplier->addhttp(request('url')); $supplier->url = $supplier->addhttp(request('url'));
$supplier->user_id = Auth::id(); $supplier->user_id = Auth::id();
$supplier = $request->handleImages($supplier,600, public_path().'/uploads/suppliers'); $supplier = $request->handleImages($supplier);
if ($supplier->save()) { if ($supplier->save()) {
@ -129,7 +129,7 @@ class SuppliersController extends Controller
$supplier->email = request('email'); $supplier->email = request('email');
$supplier->url = $supplier->addhttp(request('url')); $supplier->url = $supplier->addhttp(request('url'));
$supplier->notes = request('notes'); $supplier->notes = request('notes');
$supplier = $request->handleImages($supplier,600, public_path().'/uploads/suppliers'); $supplier = $request->handleImages($supplier);
if ($supplier->save()) { if ($supplier->save()) {
return redirect()->route('suppliers.index')->with('success', trans('admin/suppliers/message.update.success')); return redirect()->route('suppliers.index')->with('success', trans('admin/suppliers/message.update.success'));

View file

@ -126,7 +126,9 @@ class UsersController extends Controller
} }
$user->permissions = json_encode($permissions_array); $user->permissions = json_encode($permissions_array);
app('App\Http\Requests\ImageUploadRequest')->handleImages($user, '', 'avatar', 'avatars');
// we have to invoke the
app('App\Http\Requests\ImageUploadRequest')->handleImages($user);
if ($user->save()) { if ($user->save()) {
if ($request->filled('groups')) { if ($request->filled('groups')) {
@ -288,7 +290,7 @@ class UsersController extends Controller
$user->permissions = json_encode($permissions_array); $user->permissions = json_encode($permissions_array);
app('App\Http\Requests\ImageUploadRequest')->handleImages($user, '', 'avatar', 'avatars'); app('App\Http\Requests\ImageUploadRequest')->handleImages($user);
// Was the user updated? // Was the user updated?