Skip to content

Commit

Permalink
Setting company logo and invoice logo delete issue solved
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Mar 6, 2018
1 parent cf15174 commit da5eb9b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/Http/Controllers/Common/Uploads.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,7 +52,7 @@ public function download($id)
* @param $id
* @return callable
*/
public function destroy($id)
public function destroy($id, Request $request)
{
$media = Media::find($id);

Expand All @@ -68,6 +69,17 @@ public function destroy($id)

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();
}

Expand Down
4 changes: 4 additions & 0 deletions public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
6 changes: 6 additions & 0 deletions resources/views/settings/settings/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>';
Expand Down Expand Up @@ -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>';
Expand Down

0 comments on commit da5eb9b

Please sign in to comment.