diff --git a/.env.example b/.env.example index 2150f9b2c..e119dd364 100644 --- a/.env.example +++ b/.env.example @@ -1,18 +1,18 @@ -APP_NAME=Laravel +APP_NAME=Razzo APP_ENV=local APP_VERSION=0.1.6 -APP_KEY= +APP_KEY=base64:uHLkdcrc7RN8pzmDeJNtZrHCI6NmuCXETdocCr1ogAY= APP_DEBUG=true -APP_URL=http://localhost +APP_URL=http://bagsaas.com LOG_CHANNEL=stack DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 -DB_DATABASE=homestead -DB_USERNAME=homestead -DB_PASSWORD=secret +DB_DATABASE=bagsaas1 +DB_USERNAME=root +DB_PASSWORD=12345678 BROADCAST_DRIVER=log CACHE_DRIVER=file @@ -27,16 +27,24 @@ REDIS_PORT=6379 MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null +MAIL_USERNAME= +MAIL_PASSWORD= +MAIL_ENCRYPTION=tls + SHOP_MAIL_FROM=shop@bagsaas.com ADMIN_MAIL_TO=admin@bagsaas.com +STRIPE_ENABLE_TESTING= +STRIPE_TEST_PUBLISHABLE_KEY= +STRIPE_TEST_SECRET_KEY= +STRIPE_LIVE_PUBLISHABLE_KEY= +STRIPE_LIVE_SECRET_KEY= +STRIPE_STATEMENT_DESCRIPTOR= + PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= PUSHER_APP_CLUSTER=mt1 MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" \ No newline at end of file diff --git a/packages/Webkul/CustomerDocument/src/Config/customer-menu.php b/packages/Webkul/CustomerDocument/src/Config/customer-menu.php new file mode 100644 index 000000000..e736b2f99 --- /dev/null +++ b/packages/Webkul/CustomerDocument/src/Config/customer-menu.php @@ -0,0 +1,10 @@ + 'account.documents', + 'name' => 'customerdocument::app.admin.customers.documents', + 'route' =>'customer.documents.index', + 'sort' => 6 + ] +]; \ No newline at end of file diff --git a/packages/Webkul/CustomerDocument/src/Config/menu.php b/packages/Webkul/CustomerDocument/src/Config/menu.php index b469239ea..9a6965f95 100644 --- a/packages/Webkul/CustomerDocument/src/Config/menu.php +++ b/packages/Webkul/CustomerDocument/src/Config/menu.php @@ -2,11 +2,18 @@ return [ [ - 'key' => 'account.documents', + 'key' => 'documents', 'name' => 'customerdocument::app.admin.customers.documents', - 'route' =>'customer.documents.index', - 'sort' => 6 - ] + 'route' => 'admin.documents.index', + 'sort' => 6, + 'icon-class' => 'sales-icon', + ], [ + 'key' => 'documents.files', + 'name' => 'customerdocument::app.admin.documents.b2b-files', + 'route' => 'admin.documents.index', + 'sort' => 1, + 'icon-class' => '', + ], ]; ?> \ No newline at end of file diff --git a/packages/Webkul/CustomerDocument/src/DataGrids/CustomerDocumentDataGrid.php b/packages/Webkul/CustomerDocument/src/DataGrids/CustomerDocumentDataGrid.php new file mode 100644 index 000000000..6738c1677 --- /dev/null +++ b/packages/Webkul/CustomerDocument/src/DataGrids/CustomerDocumentDataGrid.php @@ -0,0 +1,91 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class CustomerDocumentDataGrid extends DataGrid +{ + protected $index = 'id'; //the column that needs to be treated as index column + + protected $sortOrder = 'desc'; //asc or desc + + protected $itemsPerPage = 10; + + public function prepareQueryBuilder() + { + $queryBuilder = DB::table('customer_documents') + ->addSelect('id', 'name', 'status', 'type'); + + $this->setQueryBuilder($queryBuilder); + } + + public function addColumns() + { + $this->addColumn([ + 'index' => 'id', + 'label' => trans('admin::app.datagrid.id'), + 'type' => 'number', + 'searchable' => false, + 'sortable' => true, + 'filterable' => true + ]); + + $this->addColumn([ + 'index' => 'name', + 'label' => trans('admin::app.datagrid.name'), + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'filterable' => true + ]); + + $this->addColumn([ + 'index' => 'status', + 'label' => trans('admin::app.datagrid.status'), + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'filterable' => true, + 'wrapper' => function($value) { + if ($value->status == 1) + return 'Active'; + else + return 'Inactive'; + } + ]); + + $this->addColumn([ + 'index' => 'type', + 'label' => trans('admin::app.datagrid.type'), + 'type' => 'string', + 'searchable' => false, + 'sortable' => true, + 'filterable' => true + ]); + } + + public function prepareActions() { + $this->addAction([ + 'type' => 'Edit', + 'method' => 'GET', + 'route' => 'admin.documents.edit', + 'icon' => 'icon pencil-lg-icon' + ]); + + $this->addAction([ + 'type' => 'Delete', + 'method' => 'POST', // use GET request only for redirect purposes + 'route' => 'admin.documents.delete', + 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']), + 'icon' => 'icon trash-icon' + ]); + } +} \ No newline at end of file diff --git a/packages/Webkul/CustomerDocument/src/Database/migrations/2019_06_07_122059_customer_documents_table.php b/packages/Webkul/CustomerDocument/src/Database/migrations/2019_06_07_122059_customer_documents_table.php index 140a7ea56..f46e7fd0c 100644 --- a/packages/Webkul/CustomerDocument/src/Database/migrations/2019_06_07_122059_customer_documents_table.php +++ b/packages/Webkul/CustomerDocument/src/Database/migrations/2019_06_07_122059_customer_documents_table.php @@ -17,9 +17,10 @@ class CustomerDocumentsTable extends Migration $table->increments('id'); $table->string('name'); $table->text('description')->nullable(); + $table->boolean('status')->default(1); + $table->string('type'); $table->string('path'); - $table->integer('customer_id')->unsigned(); - $table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade'); + $table->integer('customer_id')->default(0); $table->timestamps(); }); } diff --git a/packages/Webkul/CustomerDocument/src/Http/Controllers/Admin/DocumentController.php b/packages/Webkul/CustomerDocument/src/Http/Controllers/Admin/DocumentController.php new file mode 100644 index 000000000..89fd194ff --- /dev/null +++ b/packages/Webkul/CustomerDocument/src/Http/Controllers/Admin/DocumentController.php @@ -0,0 +1,280 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class DocumentController extends Controller +{ + /** + * Contains route related configuration + * + * @var array + */ + protected $_config; + + /** + * CustomerDocumentRepository object + * + * @var array + */ + protected $customerDocument; + + /** + * Create a new controller instance. + * + * @param \Webkul\Customer\Repositories\CustomerDocumentRepository $customerDocument + */ + public function __construct(CustomerDocumentRepository $customerDocument) + { + $this->_config = request('_config'); + + $this->customerDocument = $customerDocument; + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view($this->_config['view']); + } + + /** + * Store a newly created resource in storage. + * + * @return \Illuminate\Http\Response + */ + public function store() + { + $excludedExtensions = core()->getConfigData('customer.settings.documents.allowed_extensions'); + $maxSize = core()->getConfigData('customer.settings.documents.size'); + + if ($excludedExtensions != '') { + $valid_extension = explode(',', $excludedExtensions); + } else { + $valid_extension = []; + } + + $originalSize = filesize(request()->file('file')) / 1000; + + if ($maxSize != null) { + $maxSize = (float) $maxSize * 1000; + } else { + $maxSize = 5 * 1024; + } + + if (! ($originalSize <= $maxSize) || $originalSize == 0) { + session()->flash('error', trans('customerdocument::app.admin.customers.size-error')); + + return redirect()->back(); + } + + if (! empty($valid_extension) && (! in_array(request()->file('file')->getClientOriginalExtension(), $valid_extension))) { + session()->flash('error', trans('customerdocument::app.admin.customers.upload-error')); + + return redirect()->back(); + } else { + try { + $data = request()->all(); + + if (request()->hasFile('file')) { + $dir = 'customer'; + $document['path'] = request()->file('file')->store($dir); + } + + if (isset($data['customer_id'])) { + $document['customer_id'] = $data['customer_id']; + } else { + $document['customer_id'] = 0; + } + + if (isset($data['status'])) { + $document['status'] = $data['status']; + } else { + $document['status'] = 1; + } + + $document['name'] = $data['name']; + $document['description'] = $data['description']; + $document['type'] = $data['type']; + + $this->customerDocument->create($document); + + session()->flash('success', trans('customerdocument::app.admin.customers.upload-success')); + + if (isset($data['customer_id'])) { + return redirect()->back(); + } + + return redirect()->route($this->_config['redirect']); + } catch (\Exception $e) { + session()->flash('error', $e); + + return redirect()->back(); + } + } + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $document = $this->customerDocument->findOrFail($id); + + return view($this->_config['view'], compact('document')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $excludedExtensions = core()->getConfigData('customer.settings.documents.allowed_extensions'); + $maxSize = core()->getConfigData('customer.settings.documents.size'); + + if ($excludedExtensions != '') { + $valid_extension = explode(',', $excludedExtensions); + } else { + $valid_extension = []; + } + + $originalSize = filesize(request()->file('file')) / 1000; + + if ($maxSize != null) { + $maxSize = (float) $maxSize * 1000; + } else { + $maxSize = 5 * 1024; + } + + if (! ($originalSize <= $maxSize)) { + session()->flash('error', trans('customerdocument::app.admin.customers.size-error')); + + return redirect()->back(); + } + + if (! empty($valid_extension) && (! in_array(request()->file('file')->getClientOriginalExtension(), $valid_extension))) { + session()->flash('error', trans('customerdocument::app.admin.customers.upload-error')); + + return redirect()->back(); + } else { + try { + $data = request()->all(); + + $uploaDocument = $this->customerDocument->findOrfail($id); + + if (request()->hasFile('file')) { + $dir = 'customer'; + $document['path'] = request()->file('file')->store($dir); + Storage::delete($uploaDocument['path']); + } + + $document['name'] = $data['name']; + $document['description'] = $data['description']; + $document['type'] = $data['type']; + $document['status'] = $data['status']; + + $this->customerDocument->update($document, $id); + + session()->flash('success', trans('customerdocument::app.admin.customers.upload-success')); + + return redirect()->route($this->_config['redirect']); + } catch (\Exception $e) { + session()->flash('error', $e); + + return redirect()->back(); + } + } + } + + /** + * Remove the specified resource from storage.. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + $document = $this->customerDocument->findOrfail($id); + + try { + $this->customerDocument->delete($id); + + Storage::delete($document['path']); + + session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Document'])); + + return response()->json(['message' => true], 200); + } catch (\Exception $e) { + session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Document'])); + } + + return response()->json(['message' => false], 400); + } + + /** + * download the file for the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function download($id) + { + $document = $this->customerDocument->findOrfail($id); + + $extension = explode('.', $document['path']); + + $name = $document['name'].'.'.end($extension); + + return Storage::download($document['path'], $name); + } + + /** + * Remove the specified resource from storage.. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function delete($id) + { + $document = $this->customerDocument->findOrfail($id); + + $this->customerDocument->delete($id); + + Storage::delete($document['path']); + + session()->flash('success', trans('customerdocument::app.admin.customers.delete-success')); + + return redirect()->back(); + } +} \ No newline at end of file diff --git a/packages/Webkul/CustomerDocument/src/Http/Controllers/Shop/DocumentController.php b/packages/Webkul/CustomerDocument/src/Http/Controllers/Shop/DocumentController.php new file mode 100644 index 000000000..bbc912467 --- /dev/null +++ b/packages/Webkul/CustomerDocument/src/Http/Controllers/Shop/DocumentController.php @@ -0,0 +1,83 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class DocumentController extends Controller +{ + /** + * Contains route related configuration + * + * @var array + */ + protected $_config; + + /** + * CustomerDocumentRepository object + * + * @var array + */ + protected $customerDocument; + + /** + * Create a new controller instance. + * + * @param \Webkul\Customer\Repositories\CustomerDocumentRepository $customerDocument + */ + public function __construct(CustomerDocumentRepository $customerDocument) + { + $this->_config = request('_config'); + + $this->customerDocument = $customerDocument; + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + $documents = $this->customerDocument->getDocuments(auth()->guard('customer')->user()->id); + + $productDocument = $marketingDocument = []; + + foreach($documents as $document) { + if ($document->type == 'marketing') { + $marketingDocument[] = $document; + } else if ($document->type == 'product') { + $productDocument[] = $document; + } + } + + return view($this->_config['view'], compact('productDocument', 'marketingDocument')); + } + + /** + * download the file for the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function download($id) + { + $document = $this->customerDocument->findOrfail($id); + + $extension = explode('.', $document['path']); + + $name = $document['name'].'.'.end($extension); + + return Storage::download($document['path'], $name); + } +} \ No newline at end of file diff --git a/packages/Webkul/CustomerDocument/src/Http/admin-routes.php b/packages/Webkul/CustomerDocument/src/Http/admin-routes.php index 303622754..a52e575b4 100644 --- a/packages/Webkul/CustomerDocument/src/Http/admin-routes.php +++ b/packages/Webkul/CustomerDocument/src/Http/admin-routes.php @@ -7,18 +7,33 @@ Route::group(['middleware' => ['web']], function () { Route::group(['middleware' => ['admin']], function () { //document Management Routes - Route::post('upload-document', 'Webkul\CustomerDocument\Http\Controllers\DocumentController@upload')->defaults('_config', [ - 'redirect' => 'admin.customer.index' - ])->name('admin.customer.document.upload'); + Route::get('documents', 'Webkul\CustomerDocument\Http\Controllers\Admin\DocumentController@index')->defaults('_config',[ + 'view' => 'customerdocument::admin.documents.index' + ])->name('admin.documents.index'); - Route::get('download-document/{id}', 'Webkul\CustomerDocument\Http\Controllers\DocumentController@download')->defaults('_config', [ - 'redirect' => 'admin.customer.index' - ])->name('admin.customer.document.download'); + Route::get('documents/create', 'Webkul\CustomerDocument\Http\Controllers\Admin\DocumentController@create')->defaults('_config',[ + 'view' => 'customerdocument::admin.documents.create' + ])->name('admin.documents.create'); - Route::get('delete-document/{id}', 'Webkul\CustomerDocument\Http\Controllers\DocumentController@delete')->defaults('_config', [ - 'redirect' => 'admin.customer.index' - ])->name('admin.customer.document.delete'); + Route::post('documents/create', 'Webkul\CustomerDocument\Http\Controllers\Admin\DocumentController@store')->defaults('_config',[ + 'redirect' => 'admin.documents.index' + ])->name('admin.documents.store'); + Route::get('documents/edit/{id}', 'Webkul\CustomerDocument\Http\Controllers\Admin\DocumentController@edit')->defaults('_config',[ + 'view' => 'customerdocument::admin.documents.edit' + ])->name('admin.documents.edit'); + + Route::put('documents/edit/{id}', 'Webkul\CustomerDocument\Http\Controllers\Admin\DocumentController@update')->defaults('_config',[ + 'redirect' => 'admin.documents.index' + ])->name('admin.documents.update'); + + Route::post('documents/delete/{id}', 'Webkul\CustomerDocument\Http\Controllers\Admin\DocumentController@destroy')->name('admin.documents.delete'); + + Route::get('download-document/{id}', 'Webkul\CustomerDocument\Http\Controllers\Admin\DocumentController@download')->defaults('_config', [ + 'view' => 'customerdocument::admin.documents.edit' + ])->name('admin.documents.download'); + + Route::get('customer-documents/delete/{id}', 'Webkul\CustomerDocument\Http\Controllers\Admin\DocumentController@delete')->name('admin.customer.documents.delete'); }); }); diff --git a/packages/Webkul/CustomerDocument/src/Http/front-routes.php b/packages/Webkul/CustomerDocument/src/Http/front-routes.php index 51aa04022..17510c44c 100644 --- a/packages/Webkul/CustomerDocument/src/Http/front-routes.php +++ b/packages/Webkul/CustomerDocument/src/Http/front-routes.php @@ -8,11 +8,11 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function Route::prefix('account')->group(function () { - Route::get('documents', 'Webkul\CustomerDocument\Http\Controllers\DocumentController@index')->defaults('_config', [ + Route::get('documents', 'Webkul\CustomerDocument\Http\Controllers\Shop\DocumentController@index')->defaults('_config', [ 'view' => 'customerdocument::shop.customers.document' ])->name('customer.documents.index'); - Route::get('download-document/{id}', 'Webkul\CustomerDocument\Http\Controllers\DocumentController@download')->defaults('_config', [ + Route::get('download-document/{id}', 'Webkul\CustomerDocument\Http\Controllers\Shop\DocumentController@download')->defaults('_config', [ 'redirect' => 'admin.customer.index' ])->name('customer.document.download'); }); diff --git a/packages/Webkul/CustomerDocument/src/Models/CustomerDocument.php b/packages/Webkul/CustomerDocument/src/Models/CustomerDocument.php index d95a1c4c8..f31502d1d 100644 --- a/packages/Webkul/CustomerDocument/src/Models/CustomerDocument.php +++ b/packages/Webkul/CustomerDocument/src/Models/CustomerDocument.php @@ -9,5 +9,5 @@ class CustomerDocument extends Model implements CustomerDocumentContract { protected $table = 'customer_documents'; - protected $fillable = ['name', 'path', 'customer_id', 'description']; + protected $fillable = ['name', 'path', 'customer_id', 'description', 'type', 'status']; } \ No newline at end of file diff --git a/packages/Webkul/CustomerDocument/src/Providers/CustomerDocumentServiceProvider.php b/packages/Webkul/CustomerDocument/src/Providers/CustomerDocumentServiceProvider.php index c2fe1a852..348bef1d7 100644 --- a/packages/Webkul/CustomerDocument/src/Providers/CustomerDocumentServiceProvider.php +++ b/packages/Webkul/CustomerDocument/src/Providers/CustomerDocumentServiceProvider.php @@ -47,7 +47,11 @@ class CustomerDocumentServiceProvider extends ServiceProvider protected function registerConfig() { $this->mergeConfigFrom( - dirname(__DIR__) . '/Config/menu.php', 'menu.customer' + dirname(__DIR__) . '/Config/menu.php', 'menu.admin' + ); + + $this->mergeConfigFrom( + dirname(__DIR__) . '/Config/customer-menu.php', 'menu.customer' ); $this->mergeConfigFrom( diff --git a/packages/Webkul/CustomerDocument/src/Repositories/CustomerDocumentRepository.php b/packages/Webkul/CustomerDocument/src/Repositories/CustomerDocumentRepository.php index 6e6f57124..c13c40162 100644 --- a/packages/Webkul/CustomerDocument/src/Repositories/CustomerDocumentRepository.php +++ b/packages/Webkul/CustomerDocument/src/Repositories/CustomerDocumentRepository.php @@ -17,9 +17,23 @@ class CustomerDocumentRepository extends Repository * * @return mixed */ - function model() { return 'Webkul\CustomerDocument\Contracts\CustomerDocument'; } + + /** + * get All Documents + * + * @param int $id + * @return array + */ + function getDocuments($id) + { + return $this->model + ->whereIn('customer_id', [$id, 0]) + ->where('status', '1') + ->get(); + + } } \ No newline at end of file diff --git a/packages/Webkul/CustomerDocument/src/Resources/lang/en/app.php b/packages/Webkul/CustomerDocument/src/Resources/lang/en/app.php index 30d668566..607646353 100644 --- a/packages/Webkul/CustomerDocument/src/Resources/lang/en/app.php +++ b/packages/Webkul/CustomerDocument/src/Resources/lang/en/app.php @@ -21,5 +21,20 @@ return [ 'size' => 'Max Size Allowed (MB)', 'any-type' => 'All file types are allowed' ], + + 'documents' => [ + 'title' => 'Documents', + 'add-document' => 'Add Document', + 'b2b-files' => 'B2B Files', + 'save-document' => 'Save Document', + 'type' => 'Type', + 'status' => 'Status', + 'active' => 'Active', + 'in-active' => 'Inacvtive', + 'product' => 'Product', + 'marketing' => 'Marketing', + 'add-document' => 'Add Document', + 'edit-document' => 'Edit Document' + ], ], ]; \ No newline at end of file diff --git a/packages/Webkul/CustomerDocument/src/Resources/views/admin/customers/upload.blade.php b/packages/Webkul/CustomerDocument/src/Resources/views/admin/customers/upload.blade.php index f1a5d532e..80e6d8a9c 100644 --- a/packages/Webkul/CustomerDocument/src/Resources/views/admin/customers/upload.blade.php +++ b/packages/Webkul/CustomerDocument/src/Resources/views/admin/customers/upload.blade.php @@ -2,7 +2,7 @@ $customerDocumentRepository = app('Webkul\CustomerDocument\Repositories\CustomerDocumentRepository'); -$documents = $customerDocumentRepository->findWhere(['customer_id' => $customer->id]); +$documents = $customerDocumentRepository->findWhere(['customer_id' => $customer->id, 'status' => 1]); ?> @@ -18,6 +18,7 @@ $documents = $customerDocumentRepository->findWhere(['customer_id' => $customer- {{ __('customerdocument::app.admin.customers.name') }} + {{ __('customerdocument::app.admin.documents.type') }} {{ __('customerdocument::app.admin.customers.description') }} {{ __('customerdocument::app.admin.customers.download') }} @@ -28,14 +29,15 @@ $documents = $customerDocumentRepository->findWhere(['customer_id' => $customer- @foreach ($documents as $document) {{ $document->name }} + {{ $document->type }} {{ $document->description }} - + - + @@ -52,7 +54,7 @@ $documents = $customerDocumentRepository->findWhere(['customer_id' => $customer-

{{ __('customerdocument::app.admin.customers.add-document') }}

-
+ @csrf() @@ -63,6 +65,15 @@ $documents = $customerDocumentRepository->findWhere(['customer_id' => $customer- @{{ errors.first('name') }}
+
+ + + @{{ errors.first('type') }} +
+
diff --git a/packages/Webkul/CustomerDocument/src/Resources/views/admin/documents/create.blade.php b/packages/Webkul/CustomerDocument/src/Resources/views/admin/documents/create.blade.php new file mode 100644 index 000000000..b584554f3 --- /dev/null +++ b/packages/Webkul/CustomerDocument/src/Resources/views/admin/documents/create.blade.php @@ -0,0 +1,97 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('customerdocument::app.admin.documents.add-document') }} +@stop + +@section('content') +
+ + + + +
+ +
+ @csrf() + +
+ + + @{{ errors.first('name') }} +
+ +
+ + + @{{ errors.first('type') }} +
+ +
+ + + @{{ errors.first('status') }} +
+ +
+ + + + + @{{ errors.first('description') }} +
+ +
+ + + + + @php + $allowedTypes = core()->getConfigData('customer.settings.documents.allowed_extensions'); + @endphp + +
+ {{ __('customerdocument::app.admin.customers.allowed-types-one') }} + + + @if ($allowedTypes != null) + {{ $allowedTypes }} + @else + {{ __('customerdocument::app.admin.customers.any-type') }} + @endif + + + +
+ + @{{ errors.first('file') }} +
+ +
+
+ +
+ +@stop \ No newline at end of file diff --git a/packages/Webkul/CustomerDocument/src/Resources/views/admin/documents/edit.blade.php b/packages/Webkul/CustomerDocument/src/Resources/views/admin/documents/edit.blade.php new file mode 100644 index 000000000..e483d586c --- /dev/null +++ b/packages/Webkul/CustomerDocument/src/Resources/views/admin/documents/edit.blade.php @@ -0,0 +1,105 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('customerdocument::app.admin.documents.edit-document') }} +@stop + +@section('content') +
+
+ + + +
+ +
+ @csrf() + + + +
+ + + @{{ errors.first('name') }} +
+ +
+ + + @{{ errors.first('type') }} +
+ +
+ + + @{{ errors.first('status') }} +
+ +
+ + + + + @{{ errors.first('description') }} +
+ +
+ + + + + + + + + @php + $allowedTypes = core()->getConfigData('customer.settings.documents.allowed_extensions'); + @endphp + +
+ {{ __('customerdocument::app.admin.customers.allowed-types-one') }} + + + @if ($allowedTypes != null) + {{ $allowedTypes }} + @else + {{ __('customerdocument::app.admin.customers.any-type') }} + @endif + + + +
+ + @{{ errors.first('file') }} +
+ +
+
+
+
+ +@stop \ No newline at end of file diff --git a/packages/Webkul/CustomerDocument/src/Resources/views/admin/documents/index.blade.php b/packages/Webkul/CustomerDocument/src/Resources/views/admin/documents/index.blade.php new file mode 100644 index 000000000..aace174b5 --- /dev/null +++ b/packages/Webkul/CustomerDocument/src/Resources/views/admin/documents/index.blade.php @@ -0,0 +1,29 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('customerdocument::app.admin.documents.title') }} +@stop + +@section('content') + +
+ + +
+ @inject('customerDocumentGrid','Webkul\CustomerDocument\DataGrids\CustomerDocumentDataGrid') + + {!! $customerDocumentGrid->render() !!} +
+
+ +@stop + diff --git a/packages/Webkul/CustomerDocument/src/Resources/views/shop/customers/document.blade.php b/packages/Webkul/CustomerDocument/src/Resources/views/shop/customers/document.blade.php index abbf73d19..9a19e7bda 100644 --- a/packages/Webkul/CustomerDocument/src/Resources/views/shop/customers/document.blade.php +++ b/packages/Webkul/CustomerDocument/src/Resources/views/shop/customers/document.blade.php @@ -7,6 +7,7 @@ @section('content-wrapper')
+ @include('shop::customers.account.partials.sidemenu') - -
+
-@endsection \ No newline at end of file + +@endsection + +@push('scripts') + + + +@endpush \ No newline at end of file