commit
3758c0c26d
109
README.md
109
README.md
|
|
@ -13,10 +13,9 @@
|
|||
# Topics
|
||||
1. ### [Introduction](#1-introduction-)
|
||||
2. ### [Requirements](#2-requirements-)
|
||||
3. ### [Configuration](#3-configuration-)
|
||||
4. ### [Installation](#4-installation-)
|
||||
5. ### [License](#5-license-)
|
||||
6. ### [Miscellaneous](#6-miscellaneous-)
|
||||
3. ### [Installation & Configuration](#3-installation--configuration-)
|
||||
4. ### [License](#4-license-)
|
||||
5. ### [Miscellaneous](#5-miscellaneous-)
|
||||
|
||||
### 1. Introduction <a name="#1-introduction-"></a>:
|
||||
|
||||
|
|
@ -55,24 +54,45 @@ Bagisto is using power of both of these frameworks and making best out of it out
|
|||
* **SERVER**: Apache 2 or NGINX
|
||||
* **RAM**: 2 GB or higher.
|
||||
* **PHP**: 7.1.17 or higher.
|
||||
* **Processor**: Clock Cycle 1Ghz or higher.
|
||||
* **Mysql**: 5.7.23 or higher.
|
||||
* **Processor**: Clock Cycle 1 Ghz or higher.
|
||||
* **For MySQL users**: 5.7.23 or higher.
|
||||
* **For MariaDB users**: 10.2.7 or Higher.
|
||||
* **Node**: 8.11.3 LTS or higher.
|
||||
* **Composer**: 1.6.5 or higher.
|
||||
|
||||
### 3. Configuration <a name="#configuration"></a>:
|
||||
### 3. Installation & Configuration <a name="#configuration"></a>:
|
||||
|
||||
**Run this Command** to download the project on to your local machine or server:
|
||||
**1. Try our new GUI installer to install Bagisto:**
|
||||
|
||||
> Note: If you have downloaded zip file then ignore this.
|
||||
##### a. Download zip from the link below:
|
||||
|
||||
[Download](https://github.com/bagisto/bagisto/archive/v0.1.4.zip)
|
||||
|
||||
##### b. Extract the contents of zip and execute the project in browser:
|
||||
|
||||
~~~
|
||||
composer create-project bagisto/bagisto
|
||||
http(s)://localhost/bagisto/public
|
||||
~~~
|
||||
|
||||
if the above command's process was successful, you will find directory **bagisto** and all of the code will be inside it.
|
||||
or
|
||||
|
||||
After it set your **.env** variable, especially the ones below:
|
||||
~~~
|
||||
http(s)://example.com/public
|
||||
~~~
|
||||
|
||||
**2. Try our old fashioned way to install Bagisto:**
|
||||
|
||||
##### Execute these commands below as in their order
|
||||
|
||||
~~~
|
||||
1. composer create-project bagisto/bagisto
|
||||
~~~
|
||||
|
||||
**Now configure your database:**
|
||||
|
||||
If the above command was completed successfully, then you'll find directory **bagisto** and all of the code will be inside it.
|
||||
|
||||
Find file **.env** inside **bagisto** directory and set the environment variables listed below:
|
||||
|
||||
* **APP_URL**
|
||||
* **DB_CONNECTION**
|
||||
|
|
@ -82,50 +102,61 @@ After it set your **.env** variable, especially the ones below:
|
|||
* **DB_USERNAME**
|
||||
* **DB_PASSWORD**
|
||||
|
||||
Although you have to set the mailer variables also for full functioning of your store for sending emails at various events by
|
||||
default.
|
||||
Although, mailer environment variables are also required to be set up as **Bagisto** requires emails to send to customers and admins for various functionalities that are built in.
|
||||
|
||||
|
||||
### 4. Installation <a name="#installation"></a>:
|
||||
|
||||
**Run these Commands Below**
|
||||
|
||||
> Run this command, in case installing from the zip else skip this command (no need to run this command if you are creating project through composer):
|
||||
~~~
|
||||
composer install
|
||||
2. php artisan migrate
|
||||
~~~
|
||||
|
||||
> Continue run these command below:
|
||||
~~~
|
||||
php artisan migrate
|
||||
3. php artisan db:seed
|
||||
~~~
|
||||
~~~
|
||||
php artisan db:seed
|
||||
~~~
|
||||
~~~
|
||||
php artisan vendor:publish
|
||||
|
||||
~~~
|
||||
4. php artisan vendor:publish
|
||||
-> Press 0 and then press enter to publish all assets and configurations.
|
||||
~~~
|
||||
```
|
||||
php artisan storage:link
|
||||
```
|
||||
|
||||
```
|
||||
composer dump-autoload
|
||||
```
|
||||
|
||||
> That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory.
|
||||
|
||||
> **Note: you can fetch your admin panel by follow below url:**
|
||||
~~~
|
||||
http(s)://example.com/admin/login
|
||||
5. php artisan storage:link
|
||||
~~~
|
||||
|
||||
~~~
|
||||
6. composer dump-autoload
|
||||
~~~
|
||||
|
||||
|
||||
**To execute Bagisto**:
|
||||
|
||||
##### On server:
|
||||
|
||||
~~~
|
||||
Open the specified entry point in your hosts file in browser or make entry in hosts file if not done.
|
||||
~~~
|
||||
|
||||
##### On local:
|
||||
|
||||
~~~
|
||||
php artisan serve
|
||||
~~~
|
||||
|
||||
|
||||
**How to log in as admin:**
|
||||
|
||||
> *http(s)://example.com/admin/login*
|
||||
|
||||
~~~
|
||||
email:admin@example.com
|
||||
password:admin123
|
||||
~~~
|
||||
|
||||
**How to log in as customer:**
|
||||
|
||||
*You can directly register as customer and then login.*
|
||||
|
||||
> *http(s)://example.com/customer/register*
|
||||
|
||||
|
||||
### 5. License <a name="#license"></a>:
|
||||
Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://github.com/bagisto/bagisto/blob/master/LICENSE).
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/admin.js": "/js/admin.js?id=da5ebef9c25a064e7ed6",
|
||||
"/css/admin.css": "/css/admin.css?id=7381eeebea31109e7088"
|
||||
"/css/admin.css": "/css/admin.css?id=ccc39419fee98ed8ac7b"
|
||||
}
|
||||
|
|
@ -76,6 +76,8 @@ class CustomerReviewDataGrid extends DataGrid
|
|||
return '<span class="badge badge-md badge-success">Approved</span>';
|
||||
else if ($value->product_review_status == "pending")
|
||||
return '<span class="badge badge-md badge-warning">Pending</span>';
|
||||
else if ($value->product_review_status == "disapproved")
|
||||
return '<span class="badge badge-md badge-danger">Disapproved</span>';
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
|
@ -108,8 +110,9 @@ class CustomerReviewDataGrid extends DataGrid
|
|||
'action' => route('admin.customer.review.massupdate'),
|
||||
'method' => 'PUT',
|
||||
'options' => [
|
||||
'Disapprove' => 0,
|
||||
'Approve' => 1
|
||||
'Pending' => 0,
|
||||
'Approve' => 1,
|
||||
'Disapprove' => 2
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class DashboardController extends Controller
|
|||
->addSelect(DB::raw('SUM(qty_ordered) as total_qty_ordered'))
|
||||
->addSelect(DB::raw('COUNT(products.id) as total_products'))
|
||||
->addSelect('order_items.id', 'categories.id as category_id', 'category_translations.name')
|
||||
->groupBy('category_id')
|
||||
->groupBy('categories.id')
|
||||
->orderBy('total_qty_ordered', 'DESC')
|
||||
->limit(5)
|
||||
->get();
|
||||
|
|
|
|||
|
|
@ -599,6 +599,10 @@ Route::group(['middleware' => ['web']], function () {
|
|||
])->name('admin.tax-rates.update');
|
||||
|
||||
Route::get('/tax-rates/delete/{id}', 'Webkul\Tax\Http\Controllers\TaxRateController@destroy')->name('admin.tax-rates.delete');
|
||||
|
||||
Route::post('/tax-rates/import', 'Webkul\Tax\Http\Controllers\TaxRateController@import')->defaults('_config', [
|
||||
'redirect' => 'admin.tax-rates.index'
|
||||
])->name('admin.tax-rates.import');
|
||||
//tax rate ends
|
||||
|
||||
//DataGrid Export
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Imports;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Maatwebsite\Excel\Concerns\ToCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
use Maatwebsite\Excel\Concerns\Importable;
|
||||
|
||||
|
||||
/**
|
||||
* DataGridImport class
|
||||
*
|
||||
* @author Rahul Shukla <rahulshukla.symfony517@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class DataGridImport implements ToCollection, WithHeadingRow
|
||||
{
|
||||
use Importable;
|
||||
|
||||
/**
|
||||
* @param array $row
|
||||
* @return void
|
||||
*/
|
||||
public function collection(Collection $rows)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -544,10 +544,10 @@ body {
|
|||
}
|
||||
}
|
||||
|
||||
.export {
|
||||
.export-import {
|
||||
cursor: pointer;
|
||||
|
||||
.export-icon {
|
||||
.export-icon, .import-icon {
|
||||
position: relative;
|
||||
top: 10px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -701,7 +701,8 @@ return [
|
|||
'status' => 'Status',
|
||||
'comment' => 'Comment',
|
||||
'pending' => 'Pending',
|
||||
'approved' => 'Approved'
|
||||
'approved' => 'Approve',
|
||||
'disapproved' => 'Disapprove'
|
||||
],
|
||||
|
||||
'subscribers' => [
|
||||
|
|
@ -747,11 +748,16 @@ return [
|
|||
],
|
||||
|
||||
'export' => [
|
||||
'export' => 'Export',
|
||||
'format' => 'Select Format',
|
||||
'download' => 'Download',
|
||||
'csv' => 'CSV',
|
||||
'xls' => 'XLS'
|
||||
'export' => 'Export',
|
||||
'import' => 'Import',
|
||||
'format' => 'Select Format',
|
||||
'download' => 'Download',
|
||||
'upload' => 'Upload',
|
||||
'csv' => 'CSV',
|
||||
'xls' => 'XLS',
|
||||
'file' => 'File',
|
||||
'upload-error' => 'The file must be a file of type: xls, xlsx, csv.',
|
||||
'duplicate-error' => 'Identifier must be unique, duplicate identifier :identifier at row :position.'
|
||||
],
|
||||
|
||||
'response' => [
|
||||
|
|
@ -763,6 +769,9 @@ return [
|
|||
'attribute-error' => ':name is used in configurable products.',
|
||||
'attribute-product-error' => ':name is used in products.',
|
||||
'customer-associate' => ':name can not be deleted because customer is associated with this group.',
|
||||
'currency-delete-error' => 'This currency is set as channel base currency so it can not be deleted.'
|
||||
'currency-delete-error' => 'This currency is set as channel base currency so it can not be deleted.',
|
||||
'upload-success' => ':name uploaded successfully.',
|
||||
'delete-category-root' => 'Cannot delete the root category',
|
||||
'create-root-failure' => 'Category with name root already exists'
|
||||
],
|
||||
];
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
|
||||
|
||||
|
||||
{{ __('admin::app.catalog.families.add-title') }}
|
||||
</h1>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@
|
|||
<script type="text/x-template" id="country-template">
|
||||
|
||||
<div>
|
||||
<select type="text" v-validate="'required'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" v-model="country" data-vv-as=""{{ __('admin::app.customers.customers.country') }}"" @change="someHandler">
|
||||
<select type="text" v-validate="'required'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][country]" v-model="country" data-vv-as=""{{ __('admin::app.customers.customers.country') }}"" @change="someHandler">
|
||||
<option value=""></option>
|
||||
|
||||
@foreach (core()->countries() as $country)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<h1>{{ __('admin::app.customers.customers.title') }}</h1>
|
||||
</div>
|
||||
<div class="page-action">
|
||||
<div class="export" @click="showModal('downloadDataGrid')">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
<span >
|
||||
{{ __('admin::app.export.export') }}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
|
||||
|
||||
|
||||
{{ __('admin::app.customers.reviews.edit-title') }}
|
||||
</h1>
|
||||
</div>
|
||||
|
|
@ -51,12 +51,17 @@
|
|||
<div class="control-group">
|
||||
<label for="name" class="required">{{ __('admin::app.customers.reviews.status') }}</label>
|
||||
<select class="control" name="status">
|
||||
<option value="pending" {{ $review->status == "pending" ? 'selected' : ''}}>
|
||||
{{ __('admin::app.customers.reviews.pending') }}
|
||||
</option>
|
||||
<option value="approved" {{ $review->status == "approved" ? 'selected' : '' }}>
|
||||
{{ __('admin::app.customers.reviews.approved') }}
|
||||
</option>
|
||||
|
||||
<option value="disapproved" {{ $review->status == "disapproved" ? 'selected' : ''}}>
|
||||
{{ __('admin::app.customers.reviews.disapproved') }}
|
||||
</option>
|
||||
|
||||
<option value="pending" {{ $review->status == "pending" ? 'selected' : ''}}>
|
||||
{{ __('admin::app.customers.reviews.pending') }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<div class="export" @click="showModal('downloadDataGrid')">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<div class="export" @click="showModal('downloadDataGrid')">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<div class="export" @click="showModal('downloadDataGrid')">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,19 @@
|
|||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<div class="export-import" @click="showModal('uploadDataGrid')" style="margin-right: 20px;">
|
||||
<i class="import-icon"></i>
|
||||
<span>
|
||||
{{ __('admin::app.export.import') }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
<span>
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<a href="{{ route('admin.tax-rates.show') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.settings.tax-rates.add-title') }}
|
||||
</a>
|
||||
|
|
@ -23,4 +36,81 @@
|
|||
{!! $taxrates->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
<modal id="downloadDataGrid" :is-open="modalIds.downloadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.download') }}</h3>
|
||||
<div slot="body">
|
||||
<export-form></export-form>
|
||||
</div>
|
||||
</modal>
|
||||
|
||||
<modal id="uploadDataGrid" :is-open="modalIds.uploadDataGrid">
|
||||
<h3 slot="header">{{ __('admin::app.export.upload') }}</h3>
|
||||
<div slot="body">
|
||||
|
||||
<form method="POST" action="{{ route('admin.tax-rates.import') }}" enctype="multipart/form-data" @submit.prevent="onSubmit">
|
||||
@csrf()
|
||||
<div class="control-group" :class="[errors.has('file') ? 'has-error' : '']">
|
||||
<label for="file" class="required">{{ __('admin::app.export.file') }}</label>
|
||||
<input v-validate="'required'" type="file" class="control" id="file" name="file" data-vv-as=""{{ __('admin::app.export.file') }}"" value="{{ old('file') }}"/ style="padding-top: 5px">
|
||||
<span class="control-error" v-if="errors.has('file')">@{{ errors.first('file') }}</span>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.export.import') }}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</modal>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script type="text/x-template" id="export-form-template">
|
||||
<form method="POST" action="{{ route('admin.datagrid.export') }}">
|
||||
|
||||
<div class="page-content">
|
||||
<div class="form-container">
|
||||
@csrf()
|
||||
|
||||
<?php
|
||||
$data = json_encode((array) $taxrates);
|
||||
?>
|
||||
|
||||
<input type="hidden" name="gridData" value="{{ $data }}">
|
||||
<input type="hidden" name="file_name" value="Tax rates">
|
||||
|
||||
<div class="control-group">
|
||||
<label for="format" class="required">
|
||||
{{ __('admin::app.export.format') }}
|
||||
</label>
|
||||
<select name="format" class="control" v-validate="'required'">
|
||||
<option value="xls">{{ __('admin::app.export.xls') }}</option>
|
||||
<option value="csv">{{ __('admin::app.export.csv') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-lg btn-primary" @click="closeModal">
|
||||
{{ __('admin::app.export.export') }}
|
||||
</button>
|
||||
|
||||
</form>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
Vue.component('export-form', {
|
||||
template: '#export-form-template',
|
||||
methods: {
|
||||
closeModal () {
|
||||
this.$parent.closeModal();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
|
@ -5,6 +5,7 @@ namespace Webkul\Category\Http\Controllers;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Webkul\Category\Repositories\CategoryRepository as Category;
|
||||
use Webkul\Category\Models\CategoryTranslation;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
/**
|
||||
|
|
@ -74,9 +75,21 @@ class CategoryController extends Controller
|
|||
$this->validate(request(), [
|
||||
'slug' => ['required', 'unique:category_translations,slug', new \Webkul\Core\Contracts\Validations\Slug],
|
||||
'name' => 'required',
|
||||
'image.*' => 'mimes:jpeg,jpg,bmp,png'
|
||||
'image.*' => 'mimes:jpeg, jpg, bmp, png'
|
||||
]);
|
||||
|
||||
if (strtolower(request()->input('name')) == 'root') {
|
||||
$categoryTransalation = new CategoryTranslation();
|
||||
|
||||
$result = $categoryTransalation->where('name', request()->input('name'))->get();
|
||||
|
||||
if(count($result) > 0) {
|
||||
session()->flash('error', trans('admin::app.response.create-root-failure'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
$category = $this->category->create(request()->all());
|
||||
|
||||
session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Category']));
|
||||
|
|
@ -137,11 +150,15 @@ class CategoryController extends Controller
|
|||
{
|
||||
Event::fire('catalog.category.delete.before', $id);
|
||||
|
||||
$this->category->delete($id);
|
||||
if(strtolower($this->category->find($id)->name) == "root") {
|
||||
session()->flash('warning', trans('admin::app.response.delete-category-root', ['name' => 'Category']));
|
||||
} else {
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Category']));
|
||||
|
||||
Event::fire('catalog.category.delete.after', $id);
|
||||
$this->category->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Category']));
|
||||
Event::fire('catalog.category.delete.after', $id);
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
|
@ -154,7 +171,7 @@ class CategoryController extends Controller
|
|||
public function massDestroy() {
|
||||
$suppressFlash = false;
|
||||
|
||||
if (request()->isMethod('delete')) {
|
||||
if (request()->isMethod('delete') || request()->isMethod('post')) {
|
||||
$indexes = explode(',', request()->input('indexes'));
|
||||
|
||||
foreach ($indexes as $key => $value) {
|
||||
|
|
|
|||
|
|
@ -591,6 +591,24 @@ class Core
|
|||
return $collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all grouped states by country code
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function findStateByCountryCode($countryCode = null, $stateCode = null)
|
||||
{
|
||||
$collection = array();
|
||||
|
||||
$collection = $this->countryStateRepository->findByField(['country_code' => $countryCode, 'code' => $stateCode]);
|
||||
|
||||
if(count($collection)) {
|
||||
return $collection->first();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns time intervals
|
||||
*
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -183,6 +183,8 @@ class ReviewController extends Controller
|
|||
Event::fire('customer.review.update.after', $review);
|
||||
} else if ($data['update-options'] == 0) {
|
||||
$review->update(['status' => 'pending']);
|
||||
} else if ($data['update-options'] == 2) {
|
||||
$review->update(['status' => 'disapproved']);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ class ProductRepository extends Repository
|
|||
}
|
||||
});
|
||||
|
||||
return $qb;
|
||||
return $qb->groupBy('product_flat.id');
|
||||
})->paginate(isset($params['limit']) ? $params['limit'] : 9);
|
||||
|
||||
return $results;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/shop.js": "/js/shop.js?id=e25827d4b84cbe5d76fb",
|
||||
"/css/shop.css": "/css/shop.css?id=69d51d46b4e6507c42ab"
|
||||
"/css/shop.css": "/css/shop.css?id=23e535f35bb6c1e6b9d2"
|
||||
}
|
||||
|
|
@ -3052,6 +3052,7 @@ section.review {
|
|||
border-bottom: 1px solid $border-color;
|
||||
border-top: 1px solid $border-color;
|
||||
height: 50px;
|
||||
margin-top: 10px;
|
||||
|
||||
.account-action {
|
||||
margin-top: 12px;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
@if ($cart->selected_shipping_rate)
|
||||
<div class="item-detail">
|
||||
<label>{{ __('shop::app.checkout.total.delivery-charges') }}</label>
|
||||
<label class="right">{{ core()->currency($cart->selected_shipping_rate->price) }}</label>
|
||||
<label class="right">{{ core()->currency($cart->selected_shipping_rate->base_price) }}</label>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
|
|
|||
|
|
@ -182,72 +182,19 @@
|
|||
|
||||
@foreach ($invoice->items as $item)
|
||||
<tr>
|
||||
<td>{{ $item->child ? $item->child->sku : $item->sku }}</td>
|
||||
<td>{{ $item->name }}</td>
|
||||
<td>{{ core()->formatPrice($item->price, $order->order_currency_code) }}</td>
|
||||
<td>{{ $item->qty }}</td>
|
||||
<td>{{ core()->formatPrice($item->total, $order->order_currency_code) }}</td>
|
||||
<td>{{ core()->formatPrice($item->tax_amount, $order->order_currency_code) }}</td>
|
||||
<td>{{ core()->formatPrice($item->total + $item->tax_amount, $order->order_currency_code) }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.SKU') }}">{{ $item->child ? $item->child->sku : $item->sku }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}">{{ $item->name }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.price') }}">{{ core()->formatPrice($item->price, $order->order_currency_code) }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.qty') }}">{{ $item->qty }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.subtotal') }}">{{ core()->formatPrice($item->total, $order->order_currency_code) }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.tax-amount') }}">{{ core()->formatPrice($item->tax_amount, $order->order_currency_code) }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.grand-total') }}">{{ core()->formatPrice($item->total + $item->tax_amount, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@foreach ($invoice->items as $item)
|
||||
<table class="responsive-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
{{ __('shop::app.customer.account.order.view.SKU') }}
|
||||
</td>
|
||||
<td>{{ $item->child ? $item->child->sku : $item->sku }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ __('shop::app.customer.account.order.view.product-name') }}
|
||||
</td>
|
||||
<td>{{ $item->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ __('shop::app.customer.account.order.view.price') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ core()->formatPrice($item->price, $order->order_currency_code) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ __('shop::app.customer.account.order.view.qty') }}
|
||||
</td>
|
||||
<td>{{ $item->qty }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ __('shop::app.customer.account.order.view.subtotal') }}</td>
|
||||
<td>
|
||||
{{ core()->formatPrice($item->total, $order->order_currency_code) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ __('shop::app.customer.account.order.view.tax-amount') }}
|
||||
</td>
|
||||
<td>{{ core()->formatPrice($item->tax_amount, $order->order_currency_code) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ __('shop::app.customer.account.order.view.grand-total') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ core()->formatPrice($item->total + $item->tax_amount, $order->order_currency_code) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@endforeach
|
||||
|
||||
<div class="totals">
|
||||
<table class="sale-summary">
|
||||
<tr>
|
||||
|
|
@ -310,9 +257,9 @@
|
|||
@foreach ($shipment->items as $item)
|
||||
|
||||
<tr>
|
||||
<td>{{ $item->sku }}</td>
|
||||
<td>{{ $item->name }}</td>
|
||||
<td>{{ $item->qty }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.SKU') }}">{{ $item->sku }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}">{{ $item->name }}</td>
|
||||
<td data-value="{{ __('shop::app.customer.account.order.view.qty') }}">{{ $item->qty }}</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
|
@ -320,32 +267,6 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@foreach ($shipment->items as $item)
|
||||
<table class="responsive-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
{{ __('shop::app.customer.account.order.view.SKU') }}
|
||||
</td>
|
||||
<td>{{ $item->sku }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ __('shop::app.customer.account.order.view.product-name') }}
|
||||
</td>
|
||||
<td>{{ $item->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ __('shop::app.customer.account.order.view.qty') }}
|
||||
</td>
|
||||
<td> {{ $item->qty }} </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -81,53 +81,36 @@
|
|||
@push('scripts')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var sort = document.getElementById("sort");
|
||||
var filter = document.getElementById("filter");
|
||||
var sortLimit = document.getElementsByClassName('pager')[0];
|
||||
var layerFilter = document.getElementsByClassName('responsive-layred-filter')[0];
|
||||
|
||||
layerFilter.style.display ="none";
|
||||
|
||||
if (sort && filter) {
|
||||
sort.addEventListener("click", sortFilter);
|
||||
filter.addEventListener("click", sortFilter);
|
||||
}
|
||||
|
||||
function sortFilter() {
|
||||
var className = document.getElementById(this.id).className;
|
||||
|
||||
if (className === 'icon sort-icon') {
|
||||
sort.classList.remove("sort-icon");
|
||||
sort.classList.add("icon-menu-close-adj");
|
||||
|
||||
filter.classList.remove("icon-menu-close-adj");
|
||||
filter.classList.add("filter-icon");
|
||||
|
||||
sortLimit.style.display = "flex";
|
||||
sortLimit.style.justifyContent = "space-between";
|
||||
layerFilter.style.display ="none";
|
||||
} else if (className === 'icon filter-icon') {
|
||||
filter.classList.remove("filter-icon");
|
||||
filter.classList.add("icon-menu-close-adj");
|
||||
|
||||
sort.classList.remove("icon-menu-close-adj");
|
||||
sort.classList.add("sort-icon");
|
||||
|
||||
layerFilter.style.display = "block";
|
||||
layerFilter.style.marginTop = "10px";
|
||||
|
||||
sortLimit.style.display = "none";
|
||||
$('.responsive-layred-filter').css('display','none');
|
||||
$(".sort-icon, .filter-icon").on('click', function(e){
|
||||
var currentElement = $(e.currentTarget);
|
||||
if (currentElement.hasClass('sort-icon')) {
|
||||
currentElement.removeClass('sort-icon');
|
||||
currentElement.addClass('icon-menu-close-adj');
|
||||
currentElement.next().removeClass();
|
||||
currentElement.next().addClass('icon filter-icon');
|
||||
$('.responsive-layred-filter').css('display','none');
|
||||
$('.pager').css('display','flex');
|
||||
$('.pager').css('justify-content','space-between');
|
||||
} else if (currentElement.hasClass('filter-icon')) {
|
||||
currentElement.removeClass('filter-icon');
|
||||
currentElement.addClass('icon-menu-close-adj');
|
||||
currentElement.prev().removeClass();
|
||||
currentElement.prev().addClass('icon sort-icon');
|
||||
$('.pager').css('display','none');
|
||||
$('.responsive-layred-filter').css('display','block');
|
||||
$('.responsive-layred-filter').css('margin-top','10px');
|
||||
} else {
|
||||
sort.classList.remove("icon-menu-close-adj");
|
||||
sort.classList.add("sort-icon");
|
||||
|
||||
filter.classList.remove("icon-menu-close-adj");
|
||||
filter.classList.add("filter-icon");
|
||||
|
||||
sortLimit.style.display = "none";
|
||||
layerFilter.style.display = "none";
|
||||
currentElement.removeClass('icon-menu-close-adj');
|
||||
$('.responsive-layred-filter').css('display','none');
|
||||
$('.pager').css('display','none');
|
||||
if ($(this).index() == 0) {
|
||||
currentElement.addClass('sort-icon');
|
||||
} else {
|
||||
currentElement.addClass('filter-icon');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
@ -6,7 +6,9 @@ use Illuminate\Http\Request;
|
|||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Webkul\Tax\Repositories\TaxRateRepository as TaxRate;
|
||||
|
||||
use Webkul\Admin\Imports\DataGridImport;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Excel;
|
||||
|
||||
/**
|
||||
* Tax controller
|
||||
|
|
@ -144,7 +146,7 @@ class TaxRateController extends Controller
|
|||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
|
|
@ -167,4 +169,102 @@ class TaxRateController extends Controller
|
|||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
/**
|
||||
* import function for the upload
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function import() {
|
||||
|
||||
$valid_extension = ['xlsx', 'csv', 'xls'];
|
||||
|
||||
if (!in_array(request()->file('file')->getClientOriginalExtension(), $valid_extension)) {
|
||||
session()->flash('error', trans('admin::app.export.upload-error'));
|
||||
} else {
|
||||
$excelData = (new DataGridImport)->toArray(request()->file('file'));
|
||||
|
||||
foreach ($excelData as $data) {
|
||||
foreach ($data as $column => $uploadData) {
|
||||
$validator = Validator::make($uploadData, [
|
||||
'identifier' => 'required|string',
|
||||
'state' => 'required|string',
|
||||
'country' => 'required|string',
|
||||
'tax_rate' => 'required|numeric'
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$failedRules[$column+1] = $validator->errors();
|
||||
}
|
||||
|
||||
$identiFier[$column+1] = $uploadData['identifier'];
|
||||
}
|
||||
|
||||
$identiFierCount = array_count_values($identiFier);
|
||||
|
||||
$filtered = array_filter($identiFier, function ($value) use ($identiFierCount) {
|
||||
return $identiFierCount[$value] > 1;
|
||||
});
|
||||
}
|
||||
|
||||
if ($filtered) {
|
||||
foreach ($filtered as $position => $identifier) {
|
||||
$message[] = trans('admin::app.export.duplicate-error', ['identifier' => $identifier, 'position' => $position]);
|
||||
}
|
||||
$finalMsg = implode(" ", $message);
|
||||
|
||||
session()->flash('error', $finalMsg);
|
||||
} else {
|
||||
$errorMsg = [];
|
||||
|
||||
if (isset($failedRules)) {
|
||||
foreach ($failedRules as $coulmn => $fail) {
|
||||
if ($fail->first('identifier')){
|
||||
$errorMsg[$coulmn] = $fail->first('identifier');
|
||||
} else if ($fail->first('tax_rate')) {
|
||||
$errorMsg[$coulmn] = $fail->first('tax_rate');
|
||||
} else if ($fail->first('country')) {
|
||||
$errorMsg[$coulmn] = $fail->first('country');
|
||||
} else if ($fail->first('state')) {
|
||||
$errorMsg[$coulmn] = $fail->first('state');
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($errorMsg as $key => $msg) {
|
||||
$msg = str_replace(".", "", $msg);
|
||||
$message[] = $msg. ' at Row ' .$key . '.';
|
||||
}
|
||||
|
||||
$finalMsg = implode(" ", $message);
|
||||
|
||||
session()->flash('error', $finalMsg);
|
||||
} else {
|
||||
$taxRate = $this->taxRate->get()->toArray();
|
||||
|
||||
foreach ($taxRate as $rate) {
|
||||
$rateIdentifier[$rate['id']] = $rate['identifier'];
|
||||
}
|
||||
|
||||
foreach ($excelData as $data) {
|
||||
foreach ($data as $column => $uploadData) {
|
||||
if (isset($rateIdentifier)) {
|
||||
$id = array_search($uploadData['identifier'], $rateIdentifier);
|
||||
if ($id) {
|
||||
$this->taxRate->update($uploadData, $id);
|
||||
} else {
|
||||
$this->taxRate->create($uploadData);
|
||||
}
|
||||
} else {
|
||||
$this->taxRate->create($uploadData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
session()->flash('success', trans('admin::app.response.upload-success', ['name' => 'Tax Rate']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Icon-Import</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Icon-Import" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
||||
<g transform="translate(2.000000, 6.000000)" stroke="#979797" stroke-width="2">
|
||||
<path d="M29,5.5 C29,2.78076172 29,0.947428385 29,0 L10,0 L10,20 L29,20 L29,14.5" id="Path-2" transform="translate(19.500000, 10.000000) scale(-1, 1) translate(-19.500000, -10.000000) "></path>
|
||||
<path d="M0,10 L20.068125,10" id="Path-3"></path>
|
||||
<polyline id="Path-4" points="17 5.21679688 22 10.1761378 17 15"></polyline>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 960 B |
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/ui.js": "/js/ui.js?id=8f9e12057b68b45d7046",
|
||||
"/css/ui.css": "/css/ui.css?id=54c156da88929b5a04ea"
|
||||
"/css/ui.css": "/css/ui.css?id=e4a0efc923ed917eb606"
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Icon-Import</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Icon-Import" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
||||
<g transform="translate(2.000000, 6.000000)" stroke="#979797" stroke-width="2">
|
||||
<path d="M29,5.5 C29,2.78076172 29,0.947428385 29,0 L10,0 L10,20 L29,20 L29,14.5" id="Path-2" transform="translate(19.500000, 10.000000) scale(-1, 1) translate(-19.500000, -10.000000) "></path>
|
||||
<path d="M0,10 L20.068125,10" id="Path-3"></path>
|
||||
<polyline id="Path-4" points="17 5.21679688 22 10.1761378 17 15"></polyline>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 960 B |
|
|
@ -812,6 +812,15 @@ modal {
|
|||
}
|
||||
}
|
||||
|
||||
// responsive css for model
|
||||
@media only screen and (max-width: 770px){
|
||||
.modal-container {
|
||||
max-width: 80%;
|
||||
left: 10%;
|
||||
margin-left: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
background: #E7E7E7;
|
||||
@include border-radius(2px);
|
||||
|
|
|
|||
|
|
@ -299,6 +299,11 @@
|
|||
height: 32px;
|
||||
}
|
||||
|
||||
.import-icon {
|
||||
background-image: url("../images/Icon-Import.svg");
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.star-blue-icon {
|
||||
width: 17px;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
return [
|
||||
'datagrid' => [
|
||||
'actions' => 'Actions',
|
||||
'id' => 'Index columns have value greater than zero only',
|
||||
|
||||
'massaction' => [
|
||||
'mass-delete-confirm' => 'Do you really want to delete these selected :resource?',
|
||||
|
|
|
|||
|
|
@ -21,25 +21,25 @@
|
|||
|
||||
@if (isset($column['wrapper']))
|
||||
@if (isset($column['closure']) && $column['closure'] == true)
|
||||
<td>{!! $column['wrapper']($record) !!}</td>
|
||||
<td data-value="{{ $column['label'] }}">{!! $column['wrapper']($record) !!}</td>
|
||||
@else
|
||||
<td>{{ $column['wrapper']($record) }}</td>
|
||||
<td data-value="{{ $column['label'] }}">{{ $column['wrapper']($record) }}</td>
|
||||
@endif
|
||||
@else
|
||||
@if($column['type'] == 'price')
|
||||
@if(isset($column['currencyCode']))
|
||||
<td>{{ core()->formatPrice($record->{$columnIndex}, $column['currencyCode']) }}</td>
|
||||
<td data-value="{{ $column['label'] }}">{{ core()->formatPrice($record->{$columnIndex}, $column['currencyCode']) }}</td>
|
||||
@else
|
||||
<td>{{ core()->formatBasePrice($record->{$columnIndex}) }}</td>
|
||||
<td data-value="{{ $column['label'] }}">{{ core()->formatBasePrice($record->{$columnIndex}) }}</td>
|
||||
@endif
|
||||
@else
|
||||
<td>{{ $record->{$columnIndex} }}</td>
|
||||
<td data-value="{{ $column['label'] }}">{{ $record->{$columnIndex} }}</td>
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@if ($enableActions)
|
||||
<td class="actions" style="width: 100px;">
|
||||
<td class="actions" style="width: 100px;" data-value=" {{ __('ui::app.datagrid.actions') }}">
|
||||
<div>
|
||||
@foreach ($actions as $action)
|
||||
<a href="{{ route($action['route'], $record->{$index}) }}">
|
||||
|
|
|
|||
|
|
@ -228,6 +228,7 @@
|
|||
template: '#datagrid-filters',
|
||||
|
||||
data: () => ({
|
||||
filterIndex: @json($results['index']),
|
||||
gridCurrentData: @json($results['records']),
|
||||
massActions: @json($results['massactions']),
|
||||
massActionsToggle: false,
|
||||
|
|
@ -338,7 +339,15 @@
|
|||
if (this.type == 'string') {
|
||||
this.formURL(this.columnOrAlias, this.stringCondition, this.stringValue, label)
|
||||
} else if (this.type == 'number') {
|
||||
this.formURL(this.columnOrAlias, this.numberCondition, this.numberValue, label);
|
||||
indexConditions = true;
|
||||
if (this.filterIndex == this.columnOrAlias && (this.numberValue == 0 || this.numberValue < 0)) {
|
||||
indexConditions = false;
|
||||
|
||||
alert('index columns can have values greater than zero only');
|
||||
}
|
||||
|
||||
if(indexConditions)
|
||||
this.formURL(this.columnOrAlias, this.numberCondition, this.numberValue, label);
|
||||
} else if (this.type == 'boolean') {
|
||||
this.formURL(this.columnOrAlias, this.booleanCondition, this.booleanValue, label);
|
||||
} else if (this.type == 'datetime') {
|
||||
|
|
|
|||
|
|
@ -45,11 +45,16 @@ class SessionController extends Controller
|
|||
if (auth()->guard('admin')->check()) {
|
||||
return redirect()->route('admin.dashboard.index');
|
||||
} else {
|
||||
session()->put('url.intended', url()->previous());
|
||||
|
||||
if (strpos(url()->previous(), 'admin') !== false) {
|
||||
$intendedUrl = url()->previous();
|
||||
} else {
|
||||
$intendedUrl = route('admin.dashboard.index');
|
||||
}
|
||||
|
||||
session()->put('url.intended', $intendedUrl);
|
||||
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ $data = array();
|
|||
$data = explode(PHP_EOL,$str);
|
||||
$databaseArray = ['DB_HOST', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD', 'DB_CONNECTION'];
|
||||
|
||||
$key = $value = [];
|
||||
if ($data) {
|
||||
foreach ($data as $line) {
|
||||
$rowValues = explode('=', $line);
|
||||
|
|
@ -97,7 +98,7 @@ $data = array();
|
|||
|
||||
$conn->close();
|
||||
} else {
|
||||
$data['support_error'] = 'It only support mysql Database Connection.If You still want to continue, press OK otherwise change your database connection';
|
||||
$data['support_error'] = 'Bagisto currently support MySQL only. Press OK to still continue or change you DB connection to MySQL';
|
||||
}
|
||||
|
||||
// if there are no errors process our form, then return a message
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ class Requirement {
|
|||
'JSON',
|
||||
'cURL',
|
||||
],
|
||||
'apache' => [
|
||||
'mod_rewrite',
|
||||
]
|
||||
// 'apache' => [
|
||||
// 'mod_rewrite',
|
||||
// ]
|
||||
];
|
||||
|
||||
$results = [];
|
||||
|
|
@ -43,24 +43,25 @@ class Requirement {
|
|||
$results['errors'] = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
// check apache requirements
|
||||
case 'apache':
|
||||
foreach ($requirements[$type] as $requirement) {
|
||||
// if function doesn't exist we can't check apache modules
|
||||
if(function_exists('apache_get_modules'))
|
||||
{
|
||||
$results['requirements'][$type][$requirement] = true;
|
||||
// case 'apache':
|
||||
// foreach ($requirements[$type] as $requirement) {
|
||||
// // if function doesn't exist we can't check apache modules
|
||||
// if(function_exists('apache_get_modules'))
|
||||
// {
|
||||
// $results['requirements'][$type][$requirement] = true;
|
||||
|
||||
if(!in_array($requirement,apache_get_modules()))
|
||||
{
|
||||
$results['requirements'][$type][$requirement] = false;
|
||||
// if(!in_array($requirement,apache_get_modules()))
|
||||
// {
|
||||
// $results['requirements'][$type][$requirement] = false;
|
||||
|
||||
$results['errors'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
// $results['errors'] = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
<div class="form-container" style="padding: 10%; padding-top: 35px">
|
||||
<div class="control-group" id="app_name">
|
||||
<label for="app_name" class="required">App Name</label>
|
||||
<input type="text" name="app_name" class="control"
|
||||
placeholder="Laravel"
|
||||
<input type = "text" name = "app_name" class = "control"
|
||||
value = "Bagisto_"
|
||||
data-validation="required length" data-validation-length="max50"
|
||||
>
|
||||
</div>
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
</div>
|
||||
|
||||
<div class="control-group" id="host_name">
|
||||
<label for="host_name" class="required">Databse Host</label>
|
||||
<label for="host_name" class="required">Database Host</label>
|
||||
<input type="text" name="host_name" class="control"
|
||||
placeholder="127.0.0.1"
|
||||
data-validation="required length" data-validation-length="max50">
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
<div class="control-group" id="user_name">
|
||||
<label for="user_name" class="required">User Name</label>
|
||||
<input type="text" name="user_name" class="control"
|
||||
placeholder="database user name"
|
||||
value = "bagisto_"
|
||||
data-validation="length required" data-validation-length="max50">
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -69,12 +69,12 @@
|
|||
<div class="content" id="migration-result">
|
||||
<div class="window" id="migrate">
|
||||
</div>
|
||||
<div class="window" id="key">
|
||||
</div>
|
||||
<div class="window" id="seed">
|
||||
</div>
|
||||
<div class="window" id="publish">
|
||||
</div>
|
||||
<div class="window" id="storage">
|
||||
</div>
|
||||
<div class="window" id="composer">
|
||||
</div>
|
||||
|
||||
|
|
@ -194,11 +194,11 @@
|
|||
if (data['publish']) {
|
||||
$('#publish').append('<div class="terminal">' + data['publish'] + '</div>');
|
||||
}
|
||||
if (data['storage']) {
|
||||
$('#storage').append('<div class="terminal">' + data['storage'] + '</div>');
|
||||
if (data['key']) {
|
||||
$('#key').append('<div class="terminal">' + data['key'] + '</div>');
|
||||
}
|
||||
|
||||
if ((data['key_results'] == 0) && (data['seeder_results'] == 0) && (data['publish_results'] == 0) && (data['storage_results'] == 0)) {
|
||||
if ((data['key_results'] == 0) && (data['seeder_results'] == 0) && (data['publish_results'] == 0)) {
|
||||
$('#continue').show();
|
||||
$('#migrate-seed').hide();
|
||||
$('#loader').hide();
|
||||
|
|
@ -207,6 +207,7 @@
|
|||
|
||||
} else {
|
||||
$('#migrate').show();
|
||||
$('#loader').hide();
|
||||
$('#migrate-seed').show();
|
||||
$('#migration-back').show();
|
||||
if (data['migrate']) {
|
||||
|
|
@ -231,11 +232,4 @@
|
|||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
|
@ -1,17 +1,15 @@
|
|||
<?php
|
||||
|
||||
// array to pass back data
|
||||
$data = array();
|
||||
$data = array();
|
||||
|
||||
// run command on terminal
|
||||
$key = 'cd ../.. && php artisan key:generate 2>&1';
|
||||
$seeder = 'cd ../.. && php artisan db:seed 2>&1';
|
||||
$storage = 'cd ../.. && php artisan storage:link 2>&1';
|
||||
$publish = 'cd ../.. && php artisan vendor:publish 2>&1';
|
||||
|
||||
$key_output = exec($key, $data['key'], $data['key_results']);
|
||||
$seeder_output = exec($seeder, $data['seeder'], $data['seeder_results']);
|
||||
$storage_output = exec($storage, $data['storage'], $data['storage_results']);
|
||||
$publish = exec($publish, $data['publish'], $data['publish_results']);
|
||||
|
||||
// return a response
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
$data = explode(PHP_EOL,$str);
|
||||
$databaseArray = ['DB_HOST', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD', 'DB_CONNECTION'];
|
||||
|
||||
$key = $value = [];
|
||||
if ($data) {
|
||||
foreach ($data as $line) {
|
||||
$rowValues = explode('=', $line);
|
||||
|
|
@ -82,6 +83,8 @@
|
|||
echo $requirement->render();
|
||||
echo $permission->render();
|
||||
echo $welcome->render();
|
||||
|
||||
$storage_output = exec('cd ../.. && php artisan storage:link 2>&1');
|
||||
} else {
|
||||
// getting url
|
||||
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||
|
|
|
|||
|
|
@ -11,12 +11,13 @@
|
|||
if (file_exists($envFile)) {
|
||||
|
||||
// reading env content
|
||||
$str= file_get_contents($envFile);
|
||||
$str = file_get_contents($envFile);
|
||||
|
||||
// converting env content to key/value pair
|
||||
$data = explode(PHP_EOL,$str);
|
||||
$databaseArray = ['DB_HOST', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD', 'DB_CONNECTION'];
|
||||
|
||||
$key = $value = [];
|
||||
if ($data) {
|
||||
foreach ($data as $line) {
|
||||
$rowValues = explode('=', $line);
|
||||
|
|
|
|||
Loading…
Reference in New Issue