Merge pull request #504 from rahulshukla-webkul/development
Development
This commit is contained in:
commit
c7df2e73e9
|
|
@ -9,6 +9,7 @@ use Webkul\Admin\Facades\Configuration;
|
|||
use Webkul\Core\Repositories\CoreConfigRepository as CoreConfig;
|
||||
use Webkul\Core\Tree;
|
||||
use Webkul\Admin\Http\Requests\ConfigurationForm;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
/**
|
||||
* Configuration controller
|
||||
|
|
@ -143,4 +144,18 @@ class ConfigurationController extends Controller
|
|||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
/**
|
||||
* download the file for the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function download(Request $request)
|
||||
{
|
||||
$id = request()->route()->parameters()['id'];
|
||||
|
||||
$config = $this->coreConfig->findOneByField('id', $id);
|
||||
|
||||
return Storage::download($config['value']);
|
||||
}
|
||||
}
|
||||
|
|
@ -28,8 +28,7 @@ class ConfigurationForm extends FormRequest
|
|||
'sales.*.*.title' => 'required',
|
||||
'sales.*.*.active' => 'required',
|
||||
'sales.*.*.order_status' => 'required',
|
||||
// 'sales.*.*.Image' => 'image|mimes:jpg,png',
|
||||
// 'sales.*.*.File' => 'mimes:doc,pdf,docx,zip',
|
||||
'sales.*.*.file' => 'max:2048',
|
||||
];
|
||||
|
||||
return $this->rules;
|
||||
|
|
@ -46,8 +45,6 @@ class ConfigurationForm extends FormRequest
|
|||
'sales.*.*.title.required' => 'The title field is required.',
|
||||
'sales.*.*.active.required' => 'The status field is required.',
|
||||
'sales.*.*.order_status.required' => 'Order Status field is required',
|
||||
// 'sales.*.*.Image.image' => 'Image field must be an image',
|
||||
// 'sales.*.*.Image.mimes' => 'Image must be a file of type: jpg, png',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ Route::group(['middleware' => ['web']], function () {
|
|||
|
||||
Route::get('customers/delete/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@destroy')->name('admin.customer.delete');
|
||||
|
||||
|
||||
Route::get('reviews', 'Webkul\Product\Http\Controllers\ReviewController@index')->defaults('_config',[
|
||||
'view' => 'admin::customers.reviews.index'
|
||||
])->name('admin.customer.review.index');
|
||||
|
|
@ -83,6 +82,10 @@ Route::group(['middleware' => ['web']], function () {
|
|||
'redirect' => 'admin.configuration.index'
|
||||
])->name('admin.configuration.index.store');
|
||||
|
||||
Route::get('configuration/{slug?}/{slug2?}/{path}', 'Webkul\Admin\Http\Controllers\ConfigurationController@download')->defaults('_config', [
|
||||
'redirect' => 'admin.configuration.index'
|
||||
])->name('admin.configuration.download');
|
||||
|
||||
// Reviews Routes
|
||||
Route::get('reviews/edit/{id}', 'Webkul\Product\Http\Controllers\ReviewController@edit')->defaults('_config',[
|
||||
'view' => 'admin::customers.reviews.edit'
|
||||
|
|
|
|||
|
|
@ -558,6 +558,16 @@ body {
|
|||
}
|
||||
// customer oder css for admin end here
|
||||
|
||||
//configuration css
|
||||
.configuration-image {
|
||||
position: relative;
|
||||
height: 33px;
|
||||
width: 33px;
|
||||
top: 15px;
|
||||
border-radius: 3px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// css for rtl start here
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@
|
|||
?>
|
||||
|
||||
@if ($result)
|
||||
<img src="{{ $src }}" style="position: relative; top: 15px" />
|
||||
<img src="{{ $src }}" class="configuration-image"/>
|
||||
@endif
|
||||
|
||||
<input type="file" v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="{{ old($name) ?: core()->getConfigData($name) }}" data-vv-as=""{{ $field['name'] }}"" style="padding-top: 5px;">
|
||||
|
|
@ -185,6 +185,8 @@
|
|||
|
||||
<?php
|
||||
$result = core()->getConfigData($name);
|
||||
$src = explode("/", $result);
|
||||
$path = end($src);
|
||||
?>
|
||||
|
||||
<input type="file" v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="{{ old($name) ?: core()->getConfigData($name) }}" data-vv-as=""{{ $field['name'] }}"" style="padding-top: 5px;">
|
||||
|
|
|
|||
Loading…
Reference in New Issue