Setting company logo and invoice logo delete issue solved

This commit is contained in:
cuneytsenturk 2018-03-06 16:36:06 +03:00
parent cf15174dd8
commit da5eb9b16a
3 changed files with 23 additions and 1 deletions

View File

@ -3,6 +3,7 @@
namespace App\Http\Controllers\Common;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Common\Media;
use File;
use Storage;
@ -51,7 +52,7 @@ class Uploads extends Controller
* @param $id
* @return callable
*/
public function destroy($id)
public function destroy($id, Request $request)
{
$media = Media::find($id);
@ -68,6 +69,17 @@ class Uploads extends Controller
File::delete($path);
if (!empty($request->input('page'))) {
switch ($request->input('page')) {
case 'setting':
setting()->set($request->input('key'), '');
setting()->save();
break;
default;
}
}
return back();
}

4
public/css/app.css vendored
View File

@ -549,3 +549,7 @@ span.picture, span.attachment {
margin-left: 10px;
vertical-align: middle;
}
.form-group.col-md-6 input.fake-input.form-control{
min-width: 150px;
}

View File

@ -221,6 +221,9 @@
company_logo_html += ' <a id="remove-company_logo" href="javascript:void();">';
company_logo_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
company_logo_html += ' </a>';
company_logo_html += ' <input type="hidden" name="page" value="setting" />';
company_logo_html += ' <input type="hidden" name="key" value="general.company_logo" />';
company_logo_html += ' <input type="hidden" name="value" value="{{ $setting['company_logo']->id }}" />';
company_logo_html += ' {!! Form::close() !!}';
company_logo_html += '</span>';
@ -252,6 +255,9 @@
invoice_logo_html += ' <a id="remove-invoice_logo" href="javascript:void();">';
invoice_logo_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
invoice_logo_html += ' </a>';
invoice_logo_html += ' <input type="hidden" name="page" value="setting" />';
invoice_logo_html += ' <input type="hidden" name="key" value="general.invoice_logo" />';
invoice_logo_html += ' <input type="hidden" name="value" value="{{ $setting['invoice_logo']->id }}" />';
invoice_logo_html += ' {!! Form::close() !!}';
invoice_logo_html += '</span>';