From 69b327945cf5404aaf906e705bf402e60e1159b9 Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Wed, 14 Aug 2019 09:35:29 +0430 Subject: [PATCH 01/39] send auth token apollo --- package-lock.json | 9 +++++++ package.json | 1 + public/mix-manifest.json | 10 +++---- .../js/Global/services/storage.services.js | 2 -- resources/js/Global/utils/api/init/apollo.js | 27 ++++++++++++++++--- 5 files changed, 38 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 69998c6..3d720c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1439,6 +1439,15 @@ "zen-observable-ts": "0.8.19" } }, + "apollo-link-context": { + "version": "1.0.18", + "resolved": "https://registry.npmjs.org/apollo-link-context/-/apollo-link-context-1.0.18.tgz", + "integrity": "sha512-aG5cbUp1zqOHHQjAJXG7n/izeMQ6LApd/whEF5z6qZp5ATvcyfSNkCfy3KRJMMZZ3iNfVTs6jF+IUA8Zvf+zeg==", + "requires": { + "apollo-link": "1.2.12", + "tslib": "1.9.3" + } + }, "apollo-link-error": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/apollo-link-error/-/apollo-link-error-1.1.11.tgz", diff --git a/package.json b/package.json index 116fede..967efc6 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "apexcharts": "^3.8.3", "apollo-boost": "^0.4.3", "apollo-cache-inmemory": "^1.6.2", + "apollo-link-context": "^1.0.18", "axios": "^0.18.0", "bootstrap": "^4.1.3", "bootstrap-select": "^1.13.3", diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 614b876..6fdc41b 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=f01c1b5058842989bda8", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=2a67932b9f1c2c43df90", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=cbbc762df1ddb670242b", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=262f8b64cafdb30a40eb", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=9a0599de25555c864f98" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=edc3c72e1006f0f5c9a9", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=72ca373c83375a1dbe0b", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=03592ff04d0ec3cea27b", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=65d80bc6799294ce9444", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=e08d6d83816bb1be1a4d" } diff --git a/resources/js/Global/services/storage.services.js b/resources/js/Global/services/storage.services.js index ab236ae..7de6845 100644 --- a/resources/js/Global/services/storage.services.js +++ b/resources/js/Global/services/storage.services.js @@ -14,8 +14,6 @@ const TokenService = { }, saveToken(accessToken = null) { - console.log(accessToken); - localStorage.setItem(TOKEN_KEY, accessToken) }, diff --git a/resources/js/Global/utils/api/init/apollo.js b/resources/js/Global/utils/api/init/apollo.js index fff3d63..5d246a4 100644 --- a/resources/js/Global/utils/api/init/apollo.js +++ b/resources/js/Global/utils/api/init/apollo.js @@ -1,7 +1,26 @@ -import ApolloClient from 'apollo-boost' -import { InMemoryCache } from "apollo-cache-inmemory"; +import { ApolloClient } from 'apollo-client'; +import { createHttpLink } from 'apollo-link-http'; +import { setContext } from 'apollo-link-context'; +import { InMemoryCache } from 'apollo-cache-inmemory'; +import { TokenService } from "@Global/services/storage.services"; -export default new ApolloClient({ +const httpLink = createHttpLink({ uri: '/graphql', +}); + + +const authLink = setContext((_, { headers }) => { + // return the headers to the context so httpLink can read them + return { + headers: { + ...headers, + authorization: TokenService.getToken() ? `Bearer ${TokenService.getToken()}` : "", + } + } +}); + +export default new ApolloClient({ + link: authLink.concat(httpLink), cache: new InMemoryCache() -}); \ No newline at end of file +}); + From a6b070015120d6cfcb91a264acf0e8d600d7f267 Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Sat, 17 Aug 2019 12:23:31 +0430 Subject: [PATCH 02/39] mixin dialog and modal --- package-lock.json | 5 + package.json | 1 + public/mix-manifest.json | 10 +- .../Misc/{AlertMessage.vue => Dialog.vue} | 43 +++-- resources/js/Global/mixins/commingSoon.js | 32 ++++ resources/js/Global/mixins/hasRole.js | 6 + resources/js/Global/mixins/modal.js | 17 ++ .../js/Global/store/modules/modal/actions.js | 8 +- .../js/Global/store/modules/modal/getters.js | 4 +- .../Global/store/modules/modal/mutations.js | 10 +- .../js/Global/store/modules/modal/state.js | 6 +- resources/js/Global/utils/alert/Alert.js | 9 - .../js/Global/utils/vee-validate/locale/fa.js | 159 ++++++++++++++++++ .../js/Global/utils/vee-validate/newRules.js | 12 ++ resources/js/Home/app.js | 8 +- resources/js/Home/views/Home.vue | 6 +- 16 files changed, 281 insertions(+), 55 deletions(-) rename resources/js/Global/components/Misc/{AlertMessage.vue => Dialog.vue} (55%) create mode 100644 resources/js/Global/mixins/commingSoon.js create mode 100644 resources/js/Global/mixins/hasRole.js create mode 100644 resources/js/Global/mixins/modal.js delete mode 100644 resources/js/Global/utils/alert/Alert.js create mode 100644 resources/js/Global/utils/vee-validate/locale/fa.js create mode 100644 resources/js/Global/utils/vee-validate/newRules.js diff --git a/package-lock.json b/package-lock.json index 3d720c9..0683571 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10875,6 +10875,11 @@ "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", "dev": true }, + "vee-validate": { + "version": "2.2.15", + "resolved": "https://registry.npmjs.org/vee-validate/-/vee-validate-2.2.15.tgz", + "integrity": "sha512-4TOsI8XwVkKVLkg8Nhmy+jyoJrR6XcTRDyxBarzcCvYzU61zamipS1WsB6FlDze8eJQpgglS4NXAS6o4NDPs1g==" + }, "vendors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.2.tgz", diff --git a/package.json b/package.json index 967efc6..c4fe193 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "graphql-tag": "^2.10.1", "jalali-moment": "^3.3.3", "loadash": "^1.0.0", + "vee-validate": "^2.2.15", "vue-apexcharts": "^1.4.0", "vue-apollo": "^3.0.0-alpha.3", "vue-chartjs": "^3.4.0", diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 6fdc41b..6d16e53 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=edc3c72e1006f0f5c9a9", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=72ca373c83375a1dbe0b", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=03592ff04d0ec3cea27b", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=65d80bc6799294ce9444", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=e08d6d83816bb1be1a4d" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=75e2b3f58f212d5e8f48", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=49fd19f4521a4eb26375", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=54352e041f006e06e650", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=043db3597a61bd6c17ce", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=8d1ceb454e7e8e475706" } diff --git a/resources/js/Global/components/Misc/AlertMessage.vue b/resources/js/Global/components/Misc/Dialog.vue similarity index 55% rename from resources/js/Global/components/Misc/AlertMessage.vue rename to resources/js/Global/components/Misc/Dialog.vue index 246e022..ac4bb81 100644 --- a/resources/js/Global/components/Misc/AlertMessage.vue +++ b/resources/js/Global/components/Misc/Dialog.vue @@ -4,25 +4,25 @@ -
{{ getAlertProperties.message || defaultMessage[type].message }}
+
{{ getDialogProperties.message || defaultMessage[type].message }}
- + fas fa-times - {{getAlertProperties.cancelButtonText || defaultMessage[type].cancelButtonText}} + {{getDialogProperties.cancelButtonText || defaultMessage[type].cancelButtonText}} - + fas fa-trash-alt - {{getAlertProperties.confirmButtonText || defaultMessage[type].confirmButtonText}} + {{getDialogProperties.confirmButtonText || defaultMessage[type].confirmButtonText}} @@ -35,10 +35,10 @@ export default { data: () => ({ defaultMessage: { delete: { - onConfirm: function() { + success: function() { return ""; }, - onCancel: function() { + close: function() { return ""; }, message: @@ -55,7 +55,7 @@ export default { type: 'delete' }), watch: { - getAlertType(type) { + getDialogType(type) { if (["delete"].includes(type)) { this.type = type; } else { @@ -64,34 +64,33 @@ export default { } }, computed:{ - ...mapGetters('modal', ['getAlertType', 'getAlertProperties', 'isModal']), + ...mapGetters('modal', ['getDialogType', 'getDialogProperties', 'isModal']), modal: { get() { - return this.isModal("modal/alert"); + return this.isModal("modal/dialog"); }, set(value) { if (value) { - this.openModal("modal/alert"); + this.$_openModal("modal/dialog"); } else { - this.closeModal("modal/alert"); + this.$_closeModal("modal/dialog"); } } } }, methods: { - ...mapActions('modal', ['closeModal']), async confirm() { - if(typeof this.getAlertProperties.onConfirm == 'function') { - await this.getAlertProperties.onConfirm(); + if(typeof this.getDialogProperties.success == 'function') { + await this.getDialogProperties.success(); } - this.closeModal('modal/alert'); + this.$_closeModal('modal/dialog'); }, async cancel() { - if(typeof this.getAlertProperties.onCancel == 'function') { - await this.getAlertProperties.onCancel(); + if(typeof this.getDialogProperties.close == 'function') { + await this.getDialogProperties.close(); } - this.closeModal('modal/alert'); + this.$_closeModal('modal/dialog'); } } }; diff --git a/resources/js/Global/mixins/commingSoon.js b/resources/js/Global/mixins/commingSoon.js new file mode 100644 index 0000000..ef56edc --- /dev/null +++ b/resources/js/Global/mixins/commingSoon.js @@ -0,0 +1,32 @@ +var CommingSoonArray = [ + "document", + "discount", + "transaction", + "email", + "sms", + + + "crm-setting", + "crm-client-filter", + "crm-statistics", + "crm-myRequest", + "crm-myTasks", + + "user-list-filter", + "user-roles", + + "main-reservation", + +]; +const commingSoon = { + methods: { + $_inCommingSoon(option) { + if(process.env.MIX_PUSHER_APP_PRODUCT == 'false' || !CommingSoonArray.includes(option)) { + return true; + } + return false; + } + } +}; + +export { commingSoon }; diff --git a/resources/js/Global/mixins/hasRole.js b/resources/js/Global/mixins/hasRole.js new file mode 100644 index 0000000..81a6ae0 --- /dev/null +++ b/resources/js/Global/mixins/hasRole.js @@ -0,0 +1,6 @@ +import { mapActions } from 'vuex' +const hasRole = { + +}; + +export {hasRole} diff --git a/resources/js/Global/mixins/modal.js b/resources/js/Global/mixins/modal.js new file mode 100644 index 0000000..fd86743 --- /dev/null +++ b/resources/js/Global/mixins/modal.js @@ -0,0 +1,17 @@ +import { mapActions, mapGetters } from "vuex"; +const modal = { + methods: { + ...mapActions("modal", ["openModal", "closeModal", "dialog"]), + $_openModal(options) { + this.openModal(options); + }, + $_closeModal(options) { + this.closeModal(options); + }, + $_dialog(options) { + this.dialog(options); + } + }, +}; + +export { modal }; diff --git a/resources/js/Global/store/modules/modal/actions.js b/resources/js/Global/store/modules/modal/actions.js index b08184a..c30f23f 100644 --- a/resources/js/Global/store/modules/modal/actions.js +++ b/resources/js/Global/store/modules/modal/actions.js @@ -18,9 +18,9 @@ export default { state.properties = null; }, - openAlert:({state, commit}, properties) => { - state.modal.alert = true; - commit('SET_ALERT_TYPE', properties.type); - commit('SET_ALERT_PROPERTIES', properties); + dialog:({state, commit}, properties) => { + state.modal.dialog = true; + commit('SET_DIALOG_TYPE', properties.type); + commit('SET_DIALOG_PROPERTIES', properties); } }; diff --git a/resources/js/Global/store/modules/modal/getters.js b/resources/js/Global/store/modules/modal/getters.js index e44f181..71252f4 100644 --- a/resources/js/Global/store/modules/modal/getters.js +++ b/resources/js/Global/store/modules/modal/getters.js @@ -7,7 +7,7 @@ export default { return rootState.modal[modalArray[0]]; } }, - getAlertProperties:(state) => state.alertProperties, - getAlertType:(state) => state.alertType, + getDialogProperties:(state) => state.dialogProperties, + getDialogType:(state) => state.dialogType, }; diff --git a/resources/js/Global/store/modules/modal/mutations.js b/resources/js/Global/store/modules/modal/mutations.js index efdc04a..9d576e1 100644 --- a/resources/js/Global/store/modules/modal/mutations.js +++ b/resources/js/Global/store/modules/modal/mutations.js @@ -7,11 +7,11 @@ export default { state.properties = properties; }, - //Alert - SET_ALERT_TYPE(state, type = 'delete') { - state.alertType = type; + //Dialog + SET_DIALOG_TYPE(state, type = 'delete') { + state.dialogType = type; }, - SET_ALERT_PROPERTIES(state, properties = {}) { - state.alertProperties = properties; + SET_DIALOG_PROPERTIES(state, properties = {}) { + state.dialogProperties = properties; } }; diff --git a/resources/js/Global/store/modules/modal/state.js b/resources/js/Global/store/modules/modal/state.js index 2d8de93..63873ad 100644 --- a/resources/js/Global/store/modules/modal/state.js +++ b/resources/js/Global/store/modules/modal/state.js @@ -3,8 +3,8 @@ export default { result: null, modal:{ - alert: false, + dialog: false, }, - alertProperties: {}, - alertType: {} + dialogProperties: {}, + dialogType: {} }; diff --git a/resources/js/Global/utils/alert/Alert.js b/resources/js/Global/utils/alert/Alert.js deleted file mode 100644 index 903de42..0000000 --- a/resources/js/Global/utils/alert/Alert.js +++ /dev/null @@ -1,9 +0,0 @@ -const WMAlert = { - delete(Options) { - let text = Options.text ? Options.text : 'آیا از حذف آیتم مطمئن هستید؟ امکان بازگشت وجود نخواهد نداشت. '; - let removeCallBack = Options.remove ? Options.remove : function () {} ; - }, - success(){ - - } -} \ No newline at end of file diff --git a/resources/js/Global/utils/vee-validate/locale/fa.js b/resources/js/Global/utils/vee-validate/locale/fa.js new file mode 100644 index 0000000..81bd335 --- /dev/null +++ b/resources/js/Global/utils/vee-validate/locale/fa.js @@ -0,0 +1,159 @@ +! function(n, e) { + "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : ((n = n || self).__vee_validate_locale__fa = n.__vee_validate_locale__fa || {}, n.__vee_validate_locale__fa.js = e()) +}(this, function() { + "use strict"; + + function r(n) { + var e = { + Byte: "بايت", + KB: "كيلوبايت", + GB: "گیگابايت", + PB: "پتابايت" + }; + return function(n) { + var e = 1024, + t = 0 === (n = Number(n) * e) ? 0 : Math.floor(Math.log(n) / Math.log(e)); + return 1 * (n / Math.pow(e, t)).toFixed(2) + " " + ["Byte", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][t] + }(n).replace(/(Byte|KB|GB|PB)/, function(n) { + return e[n] + }) + } + var n, e = { + name: "fa", + messages: { + _default: function(n) { + return "مقدار " + n + " معتبر نیست" + }, + after: function(n, e) { + return n + " باید بعد از تاریخ " + e[0] + " باشد" + }, + alpha: function(n) { + return n + " فقط می تواند از حروف تشکیل شود" + }, + alpha_dash: function(n) { + return n + " فقط می تواند از حروف، اعداد، خط فاصله و زیرخط تشکیل شود" + }, + alpha_num: function(n) { + return n + " فقط میتواند از حروف و اعداد تشکیل شود" + }, + alpha_spaces: function(n) { + return n + " فقط می تواند از حروف و فاصله تشکیل شود" + }, + before: function(n, e) { + return n + " باید قبل از تاریخ " + e[0] + " باشد" + }, + between: function(n, e) { + return n + " باید بین " + e[0] + " و " + e[1] + " کارکتر باشد" + }, + confirmed: function(n) { + return n + " با تاییدیه اش مطابقت ندارد" + }, + credit_card: function(n) { + return n + " غیر معتبر است" + }, + date_between: function(n, e) { + return n + " باید بین تاریخ " + e[0] + " and " + e[1] + " باشد" + }, + date_format: function(n, e) { + return n + " باید در قالب " + e[0] + " باشد" + }, + decimal: function(n, e) { + void 0 === e && (e = []); + var t = e[0]; + return void 0 === t && (t = "*"), n + " باید یک مقدار عددی " + ("*" === t ? "" : " با حداکثر " + t + " اعشار") + " باشد" + }, + digits: function(n, e) { + return n + " باید یک مقدار عددی و دقیقاً " + e[0] + " رقم باشد" + }, + dimensions: function(n, e) { + return n + " باید در اندازه " + e[0] + " پیکسل عرض و " + e[1] + " پیکسل ارتفاع باشد" + }, + email: function(n) { + return n + " باید یک پست الکترونیک معتبر باشد" + }, + excluded: function(n) { + return n + "باید یک مقدار معتبر باشد" + }, + ext: function(n) { + return n + " باید یک فایل معتبر باشد" + }, + image: function(n) { + return n + " باید یک تصویر باشد" + }, + included: function(n) { + return n + " باید یک مقدار معتبر باشد" + }, + ip: function(n) { + return n + " باید یک آدرس آی پی معتبر باشد" + }, + max: function(n, e) { + return n + " نباید بیشتر از " + e[0] + " کارکتر باشد" + }, + max_value: function(n, e) { + return "مقدار " + n + " باید " + e[0] + " یا کمتر باشد" + }, + mimes: function(n) { + return n + " باید از نوع معتبر باشد" + }, + min: function(n, e) { + return n + " باید حداقل " + e[0] + " کارکتر باشد" + }, + min_value: function(n, e) { + return "مقدار " + n + " باید " + e[0] + " یا بیشتر باشد" + }, + numeric: function(n) { + return n + " فقط می تواند عددی باشد" + }, + regex: function(n) { + return "قالب " + n + " قابل قبول نیست" + }, + required: function(n) { + return n + " الزامی است" + }, + size: function(n, e) { + var t = e[0]; + return "حجم " + n + " کمتر از " + r(t) + " باشد" + }, + url: function(n) { + return n + " باید یک تارنمای معتبر باشد" + }, + digits_between: function(n, e) { + return n + " باید بین " + e[0] + " و " + e[1] + " کارکتر باشد" + }, + digits_between: function(n, e) { + return n + " باید بین " + e[0] + " و " + e[1] + " کارکتر باشد" + }, + }, + attributes: { + email: "ایمیل", + name: "نام", + phone: "شماره ی تلفن", + duplicatephone0: "شماره ی تلفن", + duplicatephone1: "شماره ی تلفن", + duplicatephone2: "شماره ی تلفن", + duplicatephone3: "شماره ی تلفن", + duplicatephone4: "شماره ی تلفن", + duplicatephone5: "شماره ی تلفن", + duplicatephone6: "شماره ی تلفن", + duplicatephone7: "شماره ی تلفن", + duplicatephone8: "شماره ی تلفن", + duplicatephone9: "شماره ی تلفن", + duplicatephone10: "شماره ی تلفن", + duplicateAddress0: "آدرس", + duplicateAddress1: "آدرس", + duplicateAddress2: "آدرس", + duplicateAddress3: "آدرس", + duplicateAddress4: "آدرس", + duplicateAddress5: "آدرس", + duplicateAddress6: "آدرس", + duplicateAddress7: "آدرس", + duplicateAddress8: "آدرس", + duplicateAddress9: "آدرس", + duplicateAddress10: "آدرس", + }, + custom: { + + } + }; + return "undefined" != typeof VeeValidate && VeeValidate.Validator.localize(((n = {})[e.name] = e, n)), e +}); \ No newline at end of file diff --git a/resources/js/Global/utils/vee-validate/newRules.js b/resources/js/Global/utils/vee-validate/newRules.js new file mode 100644 index 0000000..9809e10 --- /dev/null +++ b/resources/js/Global/utils/vee-validate/newRules.js @@ -0,0 +1,12 @@ +import { Validator } from "vee-validate"; + +const isBetween = (value, { min, max } = {}) => { + return Number(min) <= value.length && Number(max) >= value.length; +}; + +// The first param is called 'min', and the second is called 'max'. +const paramNames = ['min', 'max']; + +Validator.extend('digits_between', isBetween, { +paramNames // pass it in the extend options. +}); diff --git a/resources/js/Home/app.js b/resources/js/Home/app.js index 009e7aa..bf650a6 100644 --- a/resources/js/Home/app.js +++ b/resources/js/Home/app.js @@ -4,7 +4,9 @@ import router from './router' import store from './store' import VueScrollReveal from 'vue-scroll-reveal' import Vuetify from 'vuetify' -import { global } from '../Global/mixins/global'; +import { global } from "@Global/mixins/global"; +import { modal } from "@Global/mixins/modal"; +import { commingSoon } from "@Global/mixins/commingSoon"; import 'popper.js' import 'bootstrap-v4-rtl' @@ -76,7 +78,9 @@ Vue.use(VueScrollReveal, { distance: '10px', mobile: false }); -Vue.mixin(global); +Vue.mixin({ + methods: { ...global["methods"], ...modal["methods"], ...commingSoon["methods"] } +}); import { TokenService } from "@Global/services/storage.services"; import ApiService from "@Global/services/api.services"; diff --git a/resources/js/Home/views/Home.vue b/resources/js/Home/views/Home.vue index 9412bcc..3fae22c 100644 --- a/resources/js/Home/views/Home.vue +++ b/resources/js/Home/views/Home.vue @@ -20,12 +20,12 @@ --> + GradientBegin="d6e7de" GradientEnd="fff2f3" ImageURL="Members.png" ImageHeight="220px" > - + + GradientBegin="fff" GradientEnd="f7f7f7" ImageURL="Clock.png" ImageHeight="150px" > From 762fc0db72d4e6f0d5159487b09822c45dbdae34 Mon Sep 17 00:00:00 2001 From: farid saravi Date: Sat, 17 Aug 2019 18:25:48 +0430 Subject: [PATCH 03/39] add temp migrations --- ...054915_temp_append_role_name_en_column.php | 34 +++++++++++++++++ ...nd_permission_name_en_module_id_column.php | 36 ++++++++++++++++++ ...ule_virtual_activity_column_expires_at.php | 37 +++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 database/migrations/2019_08_12_054915_temp_append_role_name_en_column.php create mode 100644 database/migrations/2019_08_12_055107_temp_append_permission_name_en_module_id_column.php create mode 100644 database/migrations/2019_08_17_133716_temp_module_virtual_activity_column_expires_at.php diff --git a/database/migrations/2019_08_12_054915_temp_append_role_name_en_column.php b/database/migrations/2019_08_12_054915_temp_append_role_name_en_column.php new file mode 100644 index 0000000..e602f5c --- /dev/null +++ b/database/migrations/2019_08_12_054915_temp_append_role_name_en_column.php @@ -0,0 +1,34 @@ +string('name_en'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + if (Schema::hasColumn('tbl_roles', 'name_en')) { + Schema::table('tbl_roles', function (Blueprint $table) { + $table->dropColumn('name_en'); + }); + } + } +} diff --git a/database/migrations/2019_08_12_055107_temp_append_permission_name_en_module_id_column.php b/database/migrations/2019_08_12_055107_temp_append_permission_name_en_module_id_column.php new file mode 100644 index 0000000..2c65786 --- /dev/null +++ b/database/migrations/2019_08_12_055107_temp_append_permission_name_en_module_id_column.php @@ -0,0 +1,36 @@ +string('name_en'); + $table->unsignedInteger('module_id')->nullable(); + $table->index('module_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + if (Schema::hasColumn('tbl_permissions', 'name_en')) { + Schema::table('tbl_roles', function (Blueprint $table) { + $table->dropColumn('name_en'); + }); + } + } +} diff --git a/database/migrations/2019_08_17_133716_temp_module_virtual_activity_column_expires_at.php b/database/migrations/2019_08_17_133716_temp_module_virtual_activity_column_expires_at.php new file mode 100644 index 0000000..6f22ff8 --- /dev/null +++ b/database/migrations/2019_08_17_133716_temp_module_virtual_activity_column_expires_at.php @@ -0,0 +1,37 @@ +timestamp('expires_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + $dbName = config('core.db_name'); + if (Schema::hasColumn($dbName . '.module_virtual_activity', 'expires_at')) { + Schema::table($dbName . '.module_virtual_activity', function (Blueprint $table) { + $table->dropColumn('expires_at'); + }); + } + } +} From 99c7ea428d5357f7262e00f39a2e443d4d2e27ac Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Sat, 17 Aug 2019 18:31:09 +0430 Subject: [PATCH 04/39] apollo --- public/mix-manifest.json | 6 +++--- resources/js/Global/utils/api/init/apollo.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 6d16e53..bb011f2 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=75e2b3f58f212d5e8f48", + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=392b3d708a5cff24a101", "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=49fd19f4521a4eb26375", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=54352e041f006e06e650", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=60f4833d5f83d1046b20", "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=043db3597a61bd6c17ce", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=8d1ceb454e7e8e475706" + "/js/vue/User/app.js": "/js/vue/User/app.js?id=bf0749c9e873d048148b" } diff --git a/resources/js/Global/utils/api/init/apollo.js b/resources/js/Global/utils/api/init/apollo.js index 5d246a4..eaeb6bb 100644 --- a/resources/js/Global/utils/api/init/apollo.js +++ b/resources/js/Global/utils/api/init/apollo.js @@ -21,6 +21,6 @@ const authLink = setContext((_, { headers }) => { export default new ApolloClient({ link: authLink.concat(httpLink), - cache: new InMemoryCache() + cache: new InMemoryCache(), }); From b1ca4ee68c469b98f7d0a4bec4b658281a5acd5b Mon Sep 17 00:00:00 2001 From: farid saravi Date: Mon, 19 Aug 2019 18:53:24 +0430 Subject: [PATCH 05/39] change timezone config --- config/app.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/app.php b/config/app.php index 3fb0358..4b6def4 100644 --- a/config/app.php +++ b/config/app.php @@ -67,7 +67,7 @@ return [ | */ - 'timezone' => 'UTC', + 'timezone' => 'Iran', /* |-------------------------------------------------------------------------- From e6ddd0c5ccd4e26e945581eab5091c11518f3b55 Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Wed, 21 Aug 2019 09:38:45 +0430 Subject: [PATCH 06/39] convert gql to api --- public/mix-manifest.json | 10 +++++----- resources/js/Global/services/url.service.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index bb011f2..61f84d3 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=392b3d708a5cff24a101", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=49fd19f4521a4eb26375", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=60f4833d5f83d1046b20", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=043db3597a61bd6c17ce", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=bf0749c9e873d048148b" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=46a300281c838d8eb317", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=3b00321087e86fb5e1bf", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=10e1114fa9d3880bcd52", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=2619184b0d853d8273c1", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=03d4dbc997cf4190dd65" } diff --git a/resources/js/Global/services/url.service.js b/resources/js/Global/services/url.service.js index 472e13a..d201ffe 100644 --- a/resources/js/Global/services/url.service.js +++ b/resources/js/Global/services/url.service.js @@ -16,7 +16,7 @@ const urlGenerator = (urls) => { newPath.push(iterator); } } - return '/' + newPath.join("/"); + return '/api/' + newPath.join("/"); } }; From 986e0ad5831012012269c4fe0637750e305b03e9 Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Thu, 22 Aug 2019 10:33:47 +0430 Subject: [PATCH 07/39] delete gql --- public/mix-manifest.json | 10 ++-- resources/js/Global/mixins/api.js | 21 -------- resources/js/Global/mixins/global.js | 19 ++++++- resources/js/Global/mixins/modal.js | 17 ------- resources/js/Global/services/api.services.js | 18 +++++-- .../modules/common/actions.js} | 0 .../js/Global/store/modules/common/getters.js | 4 ++ .../Global/store/modules/common/mutations.js | 8 +++ .../js/Global/store/modules/common/state.js | 6 +++ resources/js/Global/utils/api/init/apollo.js | 26 ---------- .../js/Global/utils/api/request/apolloApi.js | 41 --------------- .../js/Global/utils/api/request/axiosApi.js | 51 ------------------- resources/js/Home/app.js | 4 +- 13 files changed, 58 insertions(+), 167 deletions(-) delete mode 100644 resources/js/Global/mixins/api.js delete mode 100644 resources/js/Global/mixins/modal.js rename resources/js/Global/{utils/api/init/axios.js => store/modules/common/actions.js} (100%) create mode 100644 resources/js/Global/store/modules/common/getters.js create mode 100644 resources/js/Global/store/modules/common/mutations.js create mode 100644 resources/js/Global/store/modules/common/state.js delete mode 100644 resources/js/Global/utils/api/init/apollo.js delete mode 100644 resources/js/Global/utils/api/request/apolloApi.js delete mode 100644 resources/js/Global/utils/api/request/axiosApi.js diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 61f84d3..857327e 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=46a300281c838d8eb317", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=3b00321087e86fb5e1bf", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=10e1114fa9d3880bcd52", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=2619184b0d853d8273c1", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=03d4dbc997cf4190dd65" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=70376fdc43efc4b13789", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=aa9935664046e6bbb8aa", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=69daf7bd7d44517ffaaf", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=8a8b1f6e787ca9a75d5b", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=815ce96ae40cc8c7560c" } diff --git a/resources/js/Global/mixins/api.js b/resources/js/Global/mixins/api.js deleted file mode 100644 index 079c2ef..0000000 --- a/resources/js/Global/mixins/api.js +++ /dev/null @@ -1,21 +0,0 @@ -import axiosApi from '@Global/utils/api/request/axiosApi' -import apolloApi from '@Global/utils/api/request/apolloApi' - -export const api = (url) => { - let apiClass; - if (url['type'] == 'apollo') { - apiClass = new apolloApi (url); - } else if (url['type'] == 'axios') { - apiClass = new axiosApi (url); - } else { - throw 'parameter "' + url['type'] + '" must be axios or apollo.'; - } - - return apiClass.init(); -} - -export default { - methods: { - $_api: api - }, -} \ No newline at end of file diff --git a/resources/js/Global/mixins/global.js b/resources/js/Global/mixins/global.js index 1b8c867..20fbf5e 100644 --- a/resources/js/Global/mixins/global.js +++ b/resources/js/Global/mixins/global.js @@ -1,8 +1,25 @@ +import { mapActions, mapMutations } from "vuex"; const global = { methods: { $_getPath(subPath) { return '/' + subPath; - } + }, + + //Modal + + ...mapActions("modal", ["openModal", "closeModal", "dialog"]), + $_openModal(options) { + this.openModal(options); + }, + $_closeModal(options) { + this.closeModal(options); + }, + + //Alert + + $_dialog(options) { + this.dialog(options); + }, } }; diff --git a/resources/js/Global/mixins/modal.js b/resources/js/Global/mixins/modal.js deleted file mode 100644 index fd86743..0000000 --- a/resources/js/Global/mixins/modal.js +++ /dev/null @@ -1,17 +0,0 @@ -import { mapActions, mapGetters } from "vuex"; -const modal = { - methods: { - ...mapActions("modal", ["openModal", "closeModal", "dialog"]), - $_openModal(options) { - this.openModal(options); - }, - $_closeModal(options) { - this.closeModal(options); - }, - $_dialog(options) { - this.dialog(options); - } - }, -}; - -export { modal }; diff --git a/resources/js/Global/services/api.services.js b/resources/js/Global/services/api.services.js index cf3ff42..9015192 100644 --- a/resources/js/Global/services/api.services.js +++ b/resources/js/Global/services/api.services.js @@ -1,16 +1,28 @@ import axios from 'axios' import { TokenService } from './storage.services' - +import commonState from '@Global/store/modules/common/state'; const ApiService = { - init(baseURL) { - axios.defaults.baseURL = baseURL; + init(baseURL = null) { + if (baseURL) { + axios.defaults.baseURL = baseURL; + } + + axios.interceptors.request.use((config) => { + config.headers = this.setModuleHeader(config.headers); + return config; + }); }, setHeader() { axios.defaults.headers.common["Accept"] = `application/json`; axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; }, + + setModuleHeader(headers = axios.defaults.headers.common) { + headers['Module'] = commonState.current_module; + return headers; + }, setAuthHeader() { axios.defaults.headers.common["Authorization"] = `Bearer ${TokenService.getToken()}`; diff --git a/resources/js/Global/utils/api/init/axios.js b/resources/js/Global/store/modules/common/actions.js similarity index 100% rename from resources/js/Global/utils/api/init/axios.js rename to resources/js/Global/store/modules/common/actions.js diff --git a/resources/js/Global/store/modules/common/getters.js b/resources/js/Global/store/modules/common/getters.js new file mode 100644 index 0000000..868629c --- /dev/null +++ b/resources/js/Global/store/modules/common/getters.js @@ -0,0 +1,4 @@ +export default { + getCurrentModule: state => state.current_module, + getCurrentModuleInfo: state => state.current_module_info, +} \ No newline at end of file diff --git a/resources/js/Global/store/modules/common/mutations.js b/resources/js/Global/store/modules/common/mutations.js new file mode 100644 index 0000000..3e1f25c --- /dev/null +++ b/resources/js/Global/store/modules/common/mutations.js @@ -0,0 +1,8 @@ +export default { + SET_CURRENT_MODULE(state, module) { + state.current_module = module; + }, + SET_CURRENT_MODULE_INFO(state, moduleInfo) { + state.current_module_info = moduleInfo; + } +}; diff --git a/resources/js/Global/store/modules/common/state.js b/resources/js/Global/store/modules/common/state.js new file mode 100644 index 0000000..6374d46 --- /dev/null +++ b/resources/js/Global/store/modules/common/state.js @@ -0,0 +1,6 @@ +export default { + current_module: "", + current_module_info: { + name: "" + } +}; diff --git a/resources/js/Global/utils/api/init/apollo.js b/resources/js/Global/utils/api/init/apollo.js deleted file mode 100644 index eaeb6bb..0000000 --- a/resources/js/Global/utils/api/init/apollo.js +++ /dev/null @@ -1,26 +0,0 @@ -import { ApolloClient } from 'apollo-client'; -import { createHttpLink } from 'apollo-link-http'; -import { setContext } from 'apollo-link-context'; -import { InMemoryCache } from 'apollo-cache-inmemory'; -import { TokenService } from "@Global/services/storage.services"; - -const httpLink = createHttpLink({ - uri: '/graphql', -}); - - -const authLink = setContext((_, { headers }) => { - // return the headers to the context so httpLink can read them - return { - headers: { - ...headers, - authorization: TokenService.getToken() ? `Bearer ${TokenService.getToken()}` : "", - } - } -}); - -export default new ApolloClient({ - link: authLink.concat(httpLink), - cache: new InMemoryCache(), -}); - diff --git a/resources/js/Global/utils/api/request/apolloApi.js b/resources/js/Global/utils/api/request/apolloApi.js deleted file mode 100644 index 53bffc8..0000000 --- a/resources/js/Global/utils/api/request/apolloApi.js +++ /dev/null @@ -1,41 +0,0 @@ -import apollo from "@Global/utils/api/init/apollo"; - -export default class apolloApi { - - constructor(urlObj) { - this.staticMethods = ["query", "mutate"]; - - this.method = urlObj.method; - this.gql = urlObj.gql; - this.variables = urlObj.data; - } - - init() { - if (this.checkMethod()) { - return this[this.method](); - } - } - - checkMethod() { - return this.staticMethods.includes(this.method); - } - - query() { - let query = this.gql; - let variables = this.variables; - - return apollo.query({ - query, - variables - }); - } - - mutate() { - const mutation = this.gql; - const variables = this.variables; - return apollo.mutate({ - mutation, - variables - }); - } -} diff --git a/resources/js/Global/utils/api/request/axiosApi.js b/resources/js/Global/utils/api/request/axiosApi.js deleted file mode 100644 index 5ed3a16..0000000 --- a/resources/js/Global/utils/api/request/axiosApi.js +++ /dev/null @@ -1,51 +0,0 @@ -import axios from "axios"; -import { urlGenerator } from '@Global/services/url.service.js'; - -export default class axiosApi { - - constructor(urlObj) { - this.staticMethods = ["get", "post", "put", "delete"]; - this.baseURL = '/'; - - this.method = urlObj.method; - this.url = urlGenerator(urlObj.url, urlObj.data); - console.log(this.url); - - this.data = urlObj.data; - } - - init() { - axios.defaults.baseURL = this.baseURL; - - if (this.checkMethod()) { - return this[this.method](); - } - } - - checkMethod() { - return this.staticMethods.includes(this.method); - } - - get() { - const params = this.data; - return axios.get(this.url, { - params - }); - } - - post() { - return axios.post(this.url, this.data); - } - - put() { - const data = this.data; - data['_method'] = 'put'; - return axios.put(this.url, data); - } - - delete() { - const data = this.data; - data['_method'] = 'delete'; - return axios.put(this.url, data); - } -} diff --git a/resources/js/Home/app.js b/resources/js/Home/app.js index bf650a6..4a3ec79 100644 --- a/resources/js/Home/app.js +++ b/resources/js/Home/app.js @@ -5,7 +5,6 @@ import store from './store' import VueScrollReveal from 'vue-scroll-reveal' import Vuetify from 'vuetify' import { global } from "@Global/mixins/global"; -import { modal } from "@Global/mixins/modal"; import { commingSoon } from "@Global/mixins/commingSoon"; import 'popper.js' @@ -79,12 +78,13 @@ Vue.use(VueScrollReveal, { mobile: false }); Vue.mixin({ - methods: { ...global["methods"], ...modal["methods"], ...commingSoon["methods"] } + methods: { ...global["methods"], ...commingSoon["methods"] } }); import { TokenService } from "@Global/services/storage.services"; import ApiService from "@Global/services/api.services"; // If token exists set Authorizion header +ApiService.init(); if (TokenService.getToken()) { ApiService.setAuthHeader(); } From 82e020dcff3ad72cb71b2a7efcab9358e89c5236 Mon Sep 17 00:00:00 2001 From: saeid Date: Thu, 22 Aug 2019 11:41:58 +0430 Subject: [PATCH 08/39] debug --- public/mix-manifest.json | 10 +++---- resources/js/Home/App.vue | 61 ++++++++++++++++++++++----------------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 857327e..31c4dd4 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=70376fdc43efc4b13789", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=aa9935664046e6bbb8aa", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=69daf7bd7d44517ffaaf", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=8a8b1f6e787ca9a75d5b", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=815ce96ae40cc8c7560c" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=134acc904eaadafa1fc7", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=3253c6931ea41afed84c", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=2139751456c29344a01f", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=f47a1673003131cc1e67", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=005df586071a65c170d0" } diff --git a/resources/js/Home/App.vue b/resources/js/Home/App.vue index cf86cec..5442bf8 100644 --- a/resources/js/Home/App.vue +++ b/resources/js/Home/App.vue @@ -1,40 +1,47 @@ From f2bb4a68addde41ecdaac2b20eb1fe6866940f89 Mon Sep 17 00:00:00 2001 From: saeid Date: Thu, 22 Aug 2019 21:28:24 +0430 Subject: [PATCH 09/39] permission --- public/mix-manifest.json | 10 +-- resources/js/Global/mixins/global.js | 5 ++ resources/js/Global/mixins/hasRole.js | 6 -- resources/js/Global/utils/Permissions/list.js | 66 +++++++++++++++++++ 4 files changed, 76 insertions(+), 11 deletions(-) delete mode 100644 resources/js/Global/mixins/hasRole.js create mode 100644 resources/js/Global/utils/Permissions/list.js diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 31c4dd4..f73db3a 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=134acc904eaadafa1fc7", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=3253c6931ea41afed84c", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=2139751456c29344a01f", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=f47a1673003131cc1e67", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=005df586071a65c170d0" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=f5fb638c433d6693293e", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=7779873442778964e2ec", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=1dfb9aebca08b2326107", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=afa817b12d26db1dd668", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=5aecdd3181f2c8ff8f34" } diff --git a/resources/js/Global/mixins/global.js b/resources/js/Global/mixins/global.js index 20fbf5e..f9792f1 100644 --- a/resources/js/Global/mixins/global.js +++ b/resources/js/Global/mixins/global.js @@ -20,6 +20,11 @@ const global = { $_dialog(options) { this.dialog(options); }, + + //Permission + $_hasPermission(premission) { + return true; + }, } }; diff --git a/resources/js/Global/mixins/hasRole.js b/resources/js/Global/mixins/hasRole.js deleted file mode 100644 index 81a6ae0..0000000 --- a/resources/js/Global/mixins/hasRole.js +++ /dev/null @@ -1,6 +0,0 @@ -import { mapActions } from 'vuex' -const hasRole = { - -}; - -export {hasRole} diff --git a/resources/js/Global/utils/Permissions/list.js b/resources/js/Global/utils/Permissions/list.js new file mode 100644 index 0000000..3364099 --- /dev/null +++ b/resources/js/Global/utils/Permissions/list.js @@ -0,0 +1,66 @@ +export default { + indexTask: 'index-task', + storeTask: 'store-task', + updateTask: 'update-task', + destroyTask: 'destroy-task', + + indexTaskCategory: 'index-task-category', + storeTaskCategory: 'store-task-category', + updateTaskCategory: 'update-task-category', + destroyTaskCategory: 'destroy-task-category', + + indexTaskStatus: 'index-task-status', + storeTaskStatus: 'store-task-status', + updateTaskStatus: 'update-task-status', + destroyTaskStatus: 'destroy-task-status', + + indexEvent: 'index-event', + storeEvent: 'store-event', + updateEvent: 'update-event', + destroyEvent: 'destroy-event', + + indexEventCategory: 'index-event-category', + storeEventCategory: 'store-event-category', + updateEventCategory: 'update-event-category', + destroyEventCategory: 'destroy-event-category', + + indexComment: 'index-comment', + storeComment: 'store-comment', + updateComment: 'update-comment', + destroyComment: 'destroy-comment', + + indexClient: 'index-client', + storeClient: 'store-client', + updateClient: 'update-client', + destroyClient: 'destroy-client', + + indexClientCategory: 'index-client-category', + storeClientCategory: 'store-client-category', + updateClientCategory: 'update-client-category', + destroyClientCategory: 'destroy-client-category', + + indexClientStatus: 'index-client-status', + storeClientStatus: 'store-client-status', + updateClientStatus: 'update-client-status', + destroyClientStatus: 'destroy-client-status', + + indexUser: 'index-user', + storeUser: 'store-user', + updateUser: 'update-user', + destroyUser: 'destroy-user', + + indexDepartment: 'index-department', + storeDepartment: 'store-department', + updateDepartment: 'update-department', + destroyDepartment: 'destroy-department', + + indexRole: 'index-role', + storeRole: 'store-role', + updateRole: 'update-role', + destroyRole: 'destroy-role', + + indexPermission: 'index-permission', + storePermission: 'store-permission', + updatePermission: 'update-permission', + destroyPermission: 'destroy-permission', +} \ No newline at end of file From a1fb1fdcb7ca2afa140df2f0175c7d6b93bcdd6c Mon Sep 17 00:00:00 2001 From: farid saravi Date: Fri, 23 Aug 2019 18:49:41 +0430 Subject: [PATCH 10/39] add user_module migration --- composer.json | 1 + .../2019_08_23_152615_create_module_user.php | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 database/migrations/2019_08_23_152615_create_module_user.php diff --git a/composer.json b/composer.json index 43c8c80..ec480fc 100755 --- a/composer.json +++ b/composer.json @@ -9,6 +9,7 @@ "license": "MIT", "require": { "php": "^7.1.3", + "doctrine/dbal": "^2.9", "fideloper/proxy": "^4.0", "laravel/framework": "5.8.*", "laravel/passport": "^7.3", diff --git a/database/migrations/2019_08_23_152615_create_module_user.php b/database/migrations/2019_08_23_152615_create_module_user.php new file mode 100644 index 0000000..5cd4a85 --- /dev/null +++ b/database/migrations/2019_08_23_152615_create_module_user.php @@ -0,0 +1,37 @@ +unsignedInteger('module_id'); + $table->unsignedInteger('user_id'); + $table->unique(['module_id', 'user_id']); + $table->index('module_id'); + $table->index('user_id'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + $dbName = config('core.db_name'); + Schema::dropIfExists("$dbName.module_user"); + } +} From 8069f82bd2057a32721dc2f6949d4eeccfd40f0c Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Sat, 24 Aug 2019 01:04:11 +0430 Subject: [PATCH 11/39] auth and checkbox and permission --- public/mix-manifest.json | 10 ++--- .../js/Global/components/Drawer/SideBar.vue | 25 ++++++----- .../js/Global/components/Inputs/Checkbox.vue | 42 +++++++++++++++---- .../js/Global/services/storage.services.js | 24 +++++++++-- resources/js/Global/utils/Permissions/list.js | 6 ++- 5 files changed, 78 insertions(+), 29 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index f73db3a..4bc7d39 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=f5fb638c433d6693293e", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=7779873442778964e2ec", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=1dfb9aebca08b2326107", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=afa817b12d26db1dd668", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=5aecdd3181f2c8ff8f34" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=dfec734f6a8269341342", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=9f7b5df53789693aae62", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=252b52bb78d06845370f", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=1fd7d081faa5afc1e968", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=caa37176d181f1cabcd1" } diff --git a/resources/js/Global/components/Drawer/SideBar.vue b/resources/js/Global/components/Drawer/SideBar.vue index bef1ee5..bd9c0ac 100644 --- a/resources/js/Global/components/Drawer/SideBar.vue +++ b/resources/js/Global/components/Drawer/SideBar.vue @@ -20,7 +20,7 @@ - علیرضا حسنی + {{ user.name }}
مدیریت
@@ -34,11 +34,10 @@ - - - - - + + @@ -49,7 +48,7 @@ import Tile from '@Global/components/Drawer/Tile'; import Notifications from '@Global/components/Drawer/Notifications'; import {mapActions} from 'vuex'; - + import {UserService} from '@Global/services/storage.services' export default { data() { return { @@ -59,10 +58,11 @@ hints: true, drawer: false, Items: [ - { TitleEn: 'My Profile', TitleFa: ' حساب کاربری من ', Icon: 'dashboard' }, - { TitleEn: ' My Messages ', TitleFa: ' پیام های من ', Icon: 'question_answer' }, - { TitleEn: ' My Users ', TitleFa: ' کاربران مجموعه ی من ', Icon: 'question_answer' } - ] + { titleEn: 'My Profile', titleFa: ' حساب کاربری من ', icon: 'dashboard', permission: "", href: '/User/List' }, + // { titleEn: ' My Messages ', titleFa: ' پیام های من ', icon: 'question_answer', permission: "", href: '/User/List' }, + { titleEn: ' My Users ', titleFa: ' کاربران مجموعه ی من ', icon: 'question_answer', permission: "", href: '/User/List' } + ], + user: {name: ''} } }, components: { @@ -71,6 +71,9 @@ }, methods:{ ...mapActions('auth', ['logout']) + }, + created() { + this.user = UserService.get(); } } diff --git a/resources/js/Global/components/Inputs/Checkbox.vue b/resources/js/Global/components/Inputs/Checkbox.vue index 5ece309..2839930 100644 --- a/resources/js/Global/components/Inputs/Checkbox.vue +++ b/resources/js/Global/components/Inputs/Checkbox.vue @@ -1,10 +1,18 @@ @@ -12,15 +20,33 @@ diff --git a/resources/js/Global/services/storage.services.js b/resources/js/Global/services/storage.services.js index 7de6845..cee1739 100644 --- a/resources/js/Global/services/storage.services.js +++ b/resources/js/Global/services/storage.services.js @@ -2,6 +2,7 @@ import qs from 'qs'; const TOKEN_KEY = 'access_token' const USER = 'user' +const PERMISSION = 'permission' /** * Manage the how Access Tokens are being stored and retreived from storage. * @@ -23,18 +24,33 @@ const TokenService = { } const UserService = { - getUser() { + get() { return qs.parse(localStorage.getItem(USER)) }, - saveUser(user = null) { + save(user = null) { user = qs.stringify(user); localStorage.setItem(USER, user) }, - removeUser() { + remove() { localStorage.removeItem(USER) }, } -export { TokenService, UserService } +const PermissionService = { + get() { + return qs.parse(localStorage.getItem(PERMISSION)) + }, + + save(permission = null) { + permission = qs.stringify(permission); + localStorage.setItem(PERMISSION, permission) + }, + + remove() { + localStorage.removeItem(PERMISSION) + }, +} + +export { TokenService, UserService, PermissionService } diff --git a/resources/js/Global/utils/Permissions/list.js b/resources/js/Global/utils/Permissions/list.js index 3364099..ad8e5ed 100644 --- a/resources/js/Global/utils/Permissions/list.js +++ b/resources/js/Global/utils/Permissions/list.js @@ -54,7 +54,8 @@ export default { updateDepartment: 'update-department', destroyDepartment: 'destroy-department', - indexRole: 'index-role', + indexRole: 'assign-role', + assignRole: 'assign-role', storeRole: 'store-role', updateRole: 'update-role', destroyRole: 'destroy-role', @@ -63,4 +64,7 @@ export default { storePermission: 'store-permission', updatePermission: 'update-permission', destroyPermission: 'destroy-permission', + + sendEmail: 'send-email', + sendSMS: 'send-sms', } \ No newline at end of file From 3624ea0f194586e25fbd0a437ff8484a501fee81 Mon Sep 17 00:00:00 2001 From: farid saravi Date: Sun, 25 Aug 2019 23:41:01 +0430 Subject: [PATCH 12/39] remove graphql --- app/Providers/AuthServiceProvider.php | 1 - composer.json | 4 - composer.lock | 446 +++++--------------------- config/lighthouse.php | 278 ---------------- graphql/schema.graphql | 19 -- 5 files changed, 89 insertions(+), 659 deletions(-) delete mode 100644 config/lighthouse.php delete mode 100644 graphql/schema.graphql diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 5ea0865..e009016 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -3,7 +3,6 @@ namespace App\Providers; use Laravel\Passport\Passport; -use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider diff --git a/composer.json b/composer.json index ec480fc..53224d4 100755 --- a/composer.json +++ b/composer.json @@ -9,14 +9,10 @@ "license": "MIT", "require": { "php": "^7.1.3", - "doctrine/dbal": "^2.9", "fideloper/proxy": "^4.0", "laravel/framework": "5.8.*", "laravel/passport": "^7.3", "laravel/tinker": "^1.0", - "mll-lab/laravel-graphql-playground": "^1.1", - "nuwave/lighthouse": "dev-master", - "nwidart/laravel-modules": "^4.0", "wm/common": "dev-master", "wm/crm": "dev-master", "wm/reservation": "dev-master" diff --git a/composer.lock b/composer.lock index bdc80d6..2314880 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "627e7d5eb4c123e990e4440f452e5b5b", + "content-hash": "bf04db5e846207e0d63b65a4f6f13d0c", "packages": [ { "name": "defuse/php-encryption", @@ -287,16 +287,16 @@ }, { "name": "egulias/email-validator", - "version": "2.1.10", + "version": "2.1.11", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "a6c8d7101b19a451c1707b1b79bbbc56e4bdb7ec" + "reference": "92dd169c32f6f55ba570c309d83f5209cefb5e23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/a6c8d7101b19a451c1707b1b79bbbc56e4bdb7ec", - "reference": "a6c8d7101b19a451c1707b1b79bbbc56e4bdb7ec", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/92dd169c32f6f55ba570c309d83f5209cefb5e23", + "reference": "92dd169c32f6f55ba570c309d83f5209cefb5e23", "shasum": "" }, "require": { @@ -315,7 +315,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -341,7 +341,7 @@ "validation", "validator" ], - "time": "2019-07-19T20:52:08+00:00" + "time": "2019-08-13T17:33:27+00:00" }, { "name": "erusev/parsedown", @@ -825,16 +825,16 @@ }, { "name": "laravel/framework", - "version": "v5.8.31", + "version": "v5.8.33", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "24cc1786bd55876fa52380306354772355345efd" + "reference": "58b81842cbdcfbbd8302790ac0f98119ea1c56e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/24cc1786bd55876fa52380306354772355345efd", - "reference": "24cc1786bd55876fa52380306354772355345efd", + "url": "https://api.github.com/repos/laravel/framework/zipball/58b81842cbdcfbbd8302790ac0f98119ea1c56e5", + "reference": "58b81842cbdcfbbd8302790ac0f98119ea1c56e5", "shasum": "" }, "require": { @@ -968,20 +968,20 @@ "framework", "laravel" ], - "time": "2019-08-06T15:09:02+00:00" + "time": "2019-08-20T15:45:17+00:00" }, { "name": "laravel/passport", - "version": "v7.3.5", + "version": "v7.4.0", "source": { "type": "git", "url": "https://github.com/laravel/passport.git", - "reference": "57937b08dc8e444b4756782a5ba172b5ba54d4f5" + "reference": "4460bd1fb5d913d75e547caf02a5a19c6d77794d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/passport/zipball/57937b08dc8e444b4756782a5ba172b5ba54d4f5", - "reference": "57937b08dc8e444b4756782a5ba172b5ba54d4f5", + "url": "https://api.github.com/repos/laravel/passport/zipball/4460bd1fb5d913d75e547caf02a5a19c6d77794d", + "reference": "4460bd1fb5d913d75e547caf02a5a19c6d77794d", "shasum": "" }, "require": { @@ -992,6 +992,7 @@ "illuminate/console": "~5.6.0|~5.7.0|~5.8.0|^6.0", "illuminate/container": "~5.6.0|~5.7.0|~5.8.0|^6.0", "illuminate/contracts": "~5.6.0|~5.7.0|~5.8.0|^6.0", + "illuminate/cookie": "~5.6.0|~5.7.0|~5.8.0|^6.0", "illuminate/database": "~5.6.0|~5.7.0|~5.8.0|^6.0", "illuminate/encryption": "~5.6.0|~5.7.0|~5.8.0|^6.0", "illuminate/http": "~5.6.0|~5.7.0|~5.8.0|^6.0", @@ -1038,20 +1039,20 @@ "oauth", "passport" ], - "time": "2019-08-06T18:10:19+00:00" + "time": "2019-08-20T18:10:43+00:00" }, { "name": "laravel/tinker", - "version": "v1.0.9", + "version": "v1.0.10", "source": { "type": "git", "url": "https://github.com/laravel/tinker.git", - "reference": "eb0075527fdeeb1cc1d68bd4ca7d50256b30a827" + "reference": "ad571aacbac1539c30d480908f9d0c9614eaf1a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/tinker/zipball/eb0075527fdeeb1cc1d68bd4ca7d50256b30a827", - "reference": "eb0075527fdeeb1cc1d68bd4ca7d50256b30a827", + "url": "https://api.github.com/repos/laravel/tinker/zipball/ad571aacbac1539c30d480908f9d0c9614eaf1a7", + "reference": "ad571aacbac1539c30d480908f9d0c9614eaf1a7", "shasum": "" }, "require": { @@ -1101,7 +1102,7 @@ "laravel", "psysh" ], - "time": "2019-07-29T18:09:25+00:00" + "time": "2019-08-07T15:10:45+00:00" }, { "name": "lcobucci/jwt", @@ -1210,16 +1211,16 @@ }, { "name": "league/flysystem", - "version": "1.0.53", + "version": "1.0.54", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "08e12b7628f035600634a5e76d95b5eb66cea674" + "reference": "c681ed22508947a941f113d6cf51bdcf4b84faf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/08e12b7628f035600634a5e76d95b5eb66cea674", - "reference": "08e12b7628f035600634a5e76d95b5eb66cea674", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/c681ed22508947a941f113d6cf51bdcf4b84faf9", + "reference": "c681ed22508947a941f113d6cf51bdcf4b84faf9", "shasum": "" }, "require": { @@ -1290,7 +1291,7 @@ "sftp", "storage" ], - "time": "2019-06-18T20:09:29+00:00" + "time": "2019-08-23T21:50:05+00:00" }, { "name": "league/oauth2-server", @@ -1369,58 +1370,6 @@ ], "time": "2019-05-05T09:22:01+00:00" }, - { - "name": "mll-lab/laravel-graphql-playground", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/mll-lab/laravel-graphql-playground.git", - "reference": "8b238625a0e432746ddada9ae87406e7cfdc326b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mll-lab/laravel-graphql-playground/zipball/8b238625a0e432746ddada9ae87406e7cfdc326b", - "reference": "8b238625a0e432746ddada9ae87406e7cfdc326b", - "shasum": "" - }, - "require": { - "laravel/framework": ">=5.1.0", - "php": ">=7" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.12" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "MLL\\GraphQLPlayground\\GraphQLPlaygroundServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "MLL\\GraphQLPlayground\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Benedikt Franke", - "email": "benedikt@franke.tech" - } - ], - "description": "Easily integrate GraphQL Playground into your Laravel project", - "keywords": [ - "graphql", - "graphql-playground", - "laravel" - ], - "time": "2019-07-05T12:09:26+00:00" - }, { "name": "monolog/monolog", "version": "1.24.0", @@ -1501,16 +1450,16 @@ }, { "name": "nesbot/carbon", - "version": "2.22.3", + "version": "2.23.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "738fbd8d80b2c5e158fda76c29c2de432fcc6f7e" + "reference": "767617a047e5b8b8b3b0b6023a2650847ed7df02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/738fbd8d80b2c5e158fda76c29c2de432fcc6f7e", - "reference": "738fbd8d80b2c5e158fda76c29c2de432fcc6f7e", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/767617a047e5b8b8b3b0b6023a2650847ed7df02", + "reference": "767617a047e5b8b8b3b0b6023a2650847ed7df02", "shasum": "" }, "require": { @@ -1557,27 +1506,27 @@ "homepage": "http://github.com/kylekatarnls" } ], - "description": "A simple API extension for DateTime.", + "description": "A API extension for DateTime that supports 281 different languages.", "homepage": "http://carbon.nesbot.com", "keywords": [ "date", "datetime", "time" ], - "time": "2019-08-07T12:36:44+00:00" + "time": "2019-08-17T13:57:34+00:00" }, { "name": "nikic/php-parser", - "version": "v4.2.2", + "version": "v4.2.3", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bd73cc04c3843ad8d6b0bfc0956026a151fc420" + "reference": "e612609022e935f3d0337c1295176505b41188c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bd73cc04c3843ad8d6b0bfc0956026a151fc420", - "reference": "1bd73cc04c3843ad8d6b0bfc0956026a151fc420", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e612609022e935f3d0337c1295176505b41188c8", + "reference": "e612609022e935f3d0337c1295176505b41188c8", "shasum": "" }, "require": { @@ -1585,7 +1534,7 @@ "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.0" + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" }, "bin": [ "bin/php-parse" @@ -1615,174 +1564,7 @@ "parser", "php" ], - "time": "2019-05-25T20:07:01+00:00" - }, - { - "name": "nuwave/lighthouse", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/nuwave/lighthouse.git", -<<<<<<< HEAD - "reference": "e0ec15573f9907a3d67321a87100448d91059631" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nuwave/lighthouse/zipball/e0ec15573f9907a3d67321a87100448d91059631", - "reference": "e0ec15573f9907a3d67321a87100448d91059631", -======= - "reference": "f7dde6641d5ba69db9d6ce239db7163ad288e4b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nuwave/lighthouse/zipball/f7dde6641d5ba69db9d6ce239db7163ad288e4b2", - "reference": "f7dde6641d5ba69db9d6ce239db7163ad288e4b2", ->>>>>>> dab2c0b5711e2d9fae5f7440da1580b4ea72b4a7 - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/contracts": "5.5.*|5.6.*|5.7.*|5.8.*", - "illuminate/http": "5.5.*|5.6.*|5.7.*|5.8.*", - "illuminate/pagination": "5.5.*|5.6.*|5.7.*|5.8.*", - "illuminate/routing": "5.5.*|5.6.*|5.7.*|5.8.*", - "illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*", - "illuminate/validation": "5.5.*|5.6.*|5.7.*|5.8.*", - "php": ">= 7.1", - "webonyx/graphql-php": "^0.13.2" - }, - "require-dev": { - "bensampo/laravel-enum": "^1.22", - "laravel/lumen-framework": "5.5.*|5.6.*|5.7.*|5.8.*", - "laravel/scout": "^4.0", - "mll-lab/graphql-php-scalars": "^2.1", - "mockery/mockery": "^1.0", - "orchestra/database": "3.5.*|3.6.*|3.7.*|3.8.*", - "orchestra/testbench": "3.5.*|3.6.*|3.7.*|3.8.*", - "phpbench/phpbench": "@dev", - "pusher/pusher-php-server": "^3.2" - }, - "suggest": { - "bensampo/laravel-enum": "Convenient enum definitions that can easily be registered in your Schema", - "laravel/scout": "Required for the @search directive", - "mll-lab/graphql-php-scalars": "Useful scalar types, required for @whereConstraints", - "mll-lab/laravel-graphql-playground": "GraphQL IDE for better development workflow - integrated with Laravel" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Nuwave\\Lighthouse\\LighthouseServiceProvider" - ], - "aliases": { - "graphql": "Nuwave\\Lighthouse\\GraphQL" - } - } - }, - "autoload": { - "psr-4": { - "Nuwave\\Lighthouse\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christopher Moore", - "email": "chris@nuwavecommerce.com", - "homepage": "https://www.nuwavecommerce.com" - }, - { - "name": "Benedikt Franke", - "email": "benedikt@franke.tech", - "homepage": "https://franke.tech" - } - ], - "description": "Lighthouse is a schema first GraphQL package for Laravel applications.", - "homepage": "https://lighthouse-php.com", - "keywords": [ - "api", - "graphql", - "laravel", - "laravel-graphql" - ], -<<<<<<< HEAD - "time": "2019-08-07T12:17:50+00:00" -======= - "time": "2019-08-08T15:18:05+00:00" ->>>>>>> dab2c0b5711e2d9fae5f7440da1580b4ea72b4a7 - }, - { - "name": "nwidart/laravel-modules", - "version": "4.1.0", - "source": { - "type": "git", - "url": "https://github.com/nWidart/laravel-modules.git", - "reference": "0efd81aef05419a9d032e5bbd7859dd8a67cb7e3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/0efd81aef05419a9d032e5bbd7859dd8a67cb7e3", - "reference": "0efd81aef05419a9d032e5bbd7859dd8a67cb7e3", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.7", - "laravel/framework": "5.7.*", - "mockery/mockery": "~1.0", - "orchestra/testbench": "^3.7", - "phpstan/phpstan": "^0.9.2", - "phpunit/phpunit": "~7.3", - "spatie/phpunit-snapshot-assertions": "^1.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Nwidart\\Modules\\LaravelModulesServiceProvider" - ], - "aliases": { - "Module": "Nwidart\\Modules\\Facades\\Module" - } - }, - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Nwidart\\Modules\\": "src" - }, - "files": [ - "src/helpers.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Widart", - "email": "n.widart@gmail.com", - "homepage": "https://nicolaswidart.com", - "role": "Developer" - } - ], - "description": "Laravel Module management", - "keywords": [ - "laravel", - "module", - "modules", - "nwidart", - "rad" - ], - "time": "2019-03-04T09:50:46+00:00" + "time": "2019-08-12T20:17:41+00:00" }, { "name": "opis/closure", @@ -4010,65 +3792,14 @@ ], "time": "2019-06-15T22:40:20+00:00" }, - { - "name": "webonyx/graphql-php", - "version": "v0.13.6", - "source": { - "type": "git", - "url": "https://github.com/webonyx/graphql-php.git", - "reference": "123af49e46d26b0cd2e7a71a387253aa01ea9a6b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/123af49e46d26b0cd2e7a71a387253aa01ea9a6b", - "reference": "123af49e46d26b0cd2e7a71a387253aa01ea9a6b", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "php": "^7.1||^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpbench/phpbench": "^0.14.0", - "phpstan/phpstan": "^0.11.4", - "phpstan/phpstan-phpunit": "^0.11.0", - "phpstan/phpstan-strict-rules": "^0.11.0", - "phpunit/phpcov": "^5.0", - "phpunit/phpunit": "^7.2", - "psr/http-message": "^1.0", - "react/promise": "2.*" - }, - "suggest": { - "psr/http-message": "To use standard GraphQL server", - "react/promise": "To leverage async resolving on React PHP platform" - }, - "type": "library", - "autoload": { - "psr-4": { - "GraphQL\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A PHP port of GraphQL reference implementation", - "homepage": "https://github.com/webonyx/graphql-php", - "keywords": [ - "api", - "graphql" - ], - "time": "2019-08-07T08:16:55+00:00" - }, { "name": "wm/common", "version": "dev-master", "dist": { "type": "path", "url": "./modules/wm-common", - "reference": "fa8225030b6ba1b6cb94bd959eb0ccdb224b726b" + "reference": "6c182b87de234466a6950ac24cc9afaca524c570", + "shasum": null }, "require": { "illuminate/support": "5.8.*", @@ -4108,7 +3839,8 @@ "dist": { "type": "path", "url": "./modules/wm-core", - "reference": "eb939430ebb1bc7f2322b4d70383ebe8f7432e0c" + "reference": "a9dcd537a7f3d2bb8b86e7c6a144bd0c4e8d10c9", + "shasum": null }, "require": { "illuminate/support": "^5.4", @@ -4152,7 +3884,8 @@ "dist": { "type": "path", "url": "./modules/wm-crm", - "reference": "a2324a5ec62209ba4f6680b1036a1ed989634ab2" + "reference": "234a0d2b3ccb4aad7cb9d0c7981705c2e70ec2d0", + "shasum": null }, "require": { "illuminate/support": "5.8.*", @@ -4193,7 +3926,8 @@ "dist": { "type": "path", "url": "./modules/wm-reservation", - "reference": "efc73be821c7a1027caa8095c21121325182627a" + "reference": "032d8c064ee8038661df316a995f908dccbe9ede", + "shasum": null }, "require": { "illuminate/support": "5.8.*", @@ -4297,22 +4031,22 @@ "packages-dev": [ { "name": "beyondcode/laravel-dump-server", - "version": "1.2.2", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/beyondcode/laravel-dump-server.git", - "reference": "8864b9efcb48e0a79e83014dd7f0a5481f5c808f" + "reference": "fcc88fa66895f8c1ff83f6145a5eff5fa2a0739a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beyondcode/laravel-dump-server/zipball/8864b9efcb48e0a79e83014dd7f0a5481f5c808f", - "reference": "8864b9efcb48e0a79e83014dd7f0a5481f5c808f", + "url": "https://api.github.com/repos/beyondcode/laravel-dump-server/zipball/fcc88fa66895f8c1ff83f6145a5eff5fa2a0739a", + "reference": "fcc88fa66895f8c1ff83f6145a5eff5fa2a0739a", "shasum": "" }, "require": { - "illuminate/console": "5.6.*|5.7.*|5.8.*", - "illuminate/http": "5.6.*|5.7.*|5.8.*", - "illuminate/support": "5.6.*|5.7.*|5.8.*", + "illuminate/console": "5.6.*|5.7.*|5.8.*|^6.0", + "illuminate/http": "5.6.*|5.7.*|5.8.*|^6.0", + "illuminate/support": "5.6.*|5.7.*|5.8.*|^6.0", "php": "^7.1", "symfony/var-dumper": "^4.1.1" }, @@ -4343,9 +4077,9 @@ "authors": [ { "name": "Marcel Pociot", + "role": "Developer", "email": "marcel@beyondco.de", - "homepage": "https://beyondcode.de", - "role": "Developer" + "homepage": "https://beyondco.de" } ], "description": "Symfony Var-Dump Server for Laravel", @@ -4354,7 +4088,7 @@ "beyondcode", "laravel-dump-server" ], - "time": "2018-10-04T07:22:24+00:00" + "time": "2019-08-11T13:17:40+00:00" }, { "name": "doctrine/instantiator", @@ -4638,16 +4372,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.9.1", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72" + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", - "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", "shasum": "" }, "require": { @@ -4682,7 +4416,7 @@ "object", "object graph" ], - "time": "2019-04-07T13:18:21+00:00" + "time": "2019-08-09T12:45:53+00:00" }, { "name": "nunomaduro/collision", @@ -5319,16 +5053,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.14", + "version": "7.5.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2834789aeb9ac182ad69bfdf9ae91856a59945ff" + "reference": "d79c053d972856b8b941bb233e39dc521a5093f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2834789aeb9ac182ad69bfdf9ae91856a59945ff", - "reference": "2834789aeb9ac182ad69bfdf9ae91856a59945ff", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d79c053d972856b8b941bb233e39dc521a5093f0", + "reference": "d79c053d972856b8b941bb233e39dc521a5093f0", "shasum": "" }, "require": { @@ -5388,8 +5122,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "role": "lead", + "email": "sebastian@phpunit.de" } ], "description": "The PHP Unit Testing framework.", @@ -5399,7 +5133,7 @@ "testing", "xunit" ], - "time": "2019-07-15T06:24:08+00:00" + "time": "2019-08-21T07:05:16+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -5621,16 +5355,16 @@ }, { "name": "sebastian/exporter", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + "reference": "06a9a5947f47b3029d76118eb5c22802e5869687" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/06a9a5947f47b3029d76118eb5c22802e5869687", + "reference": "06a9a5947f47b3029d76118eb5c22802e5869687", "shasum": "" }, "require": { @@ -5657,6 +5391,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -5665,17 +5403,13 @@ "name": "Volker Dusch", "email": "github@wallbash.com" }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, { "name": "Adam Harvey", "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], "description": "Provides the functionality to export PHP variables for visualization", @@ -5684,7 +5418,7 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2019-08-11T12:43:14+00:00" }, { "name": "sebastian/global-state", @@ -6009,16 +5743,16 @@ }, { "name": "webmozart/assert", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", "shasum": "" }, "require": { @@ -6026,8 +5760,7 @@ "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", "extra": { @@ -6056,13 +5789,12 @@ "check", "validate" ], - "time": "2018-12-25T11:19:39+00:00" + "time": "2019-08-24T08:43:50+00:00" } ], "aliases": [], "minimum-stability": "dev", "stability-flags": { - "nuwave/lighthouse": 20, "wm/common": 20, "wm/crm": 20, "wm/reservation": 20 diff --git a/config/lighthouse.php b/config/lighthouse.php deleted file mode 100644 index 97dc651..0000000 --- a/config/lighthouse.php +++ /dev/null @@ -1,278 +0,0 @@ - 'graphql', - - /* - |-------------------------------------------------------------------------- - | Enable GET Requests - |-------------------------------------------------------------------------- - | - | This setting controls if GET requests to the GraphQL endpoint are allowed. - | - */ - - 'route_enable_get' => true, - - /* - |-------------------------------------------------------------------------- - | Route Configuration - |-------------------------------------------------------------------------- - | - | Additional configuration for the route group https://lumen.laravel.com/docs/routing#route-groups - | - | Beware that middleware defined here runs before the GraphQL execution phase. - | This means that errors will cause the whole query to abort and return a - | response that is not spec-compliant. It is preferable to use directives - | to add middleware to single fields in the schema. - | Read more https://lighthouse-php.com/docs/auth.html#apply-auth-middleware - | - */ - - 'route' => [ - 'prefix' => '', - 'middleware' => [ - \Nuwave\Lighthouse\Support\Http\Middleware\AcceptJson::class, - ], - ], - - /* - |-------------------------------------------------------------------------- - | Schema Declaration - |-------------------------------------------------------------------------- - | - | This is a path that points to where your GraphQL schema is located - | relative to the app path. You should define your entire GraphQL - | schema in this file (additional files may be imported). - | - */ - - 'schema' => [ - 'register' => base_path('graphql/schema.graphql'), - ], - - /* - |-------------------------------------------------------------------------- - | Schema Cache - |-------------------------------------------------------------------------- - | - | A large part of schema generation is parsing the schema into an AST. - | This operation is pretty expensive so it is recommended to enable - | caching in production mode, especially for large schemas. - | - */ - - 'cache' => [ - 'enable' => env('LIGHTHOUSE_CACHE_ENABLE', false), - 'key' => env('LIGHTHOUSE_CACHE_KEY', 'lighthouse-schema'), - 'ttl' => env('LIGHTHOUSE_CACHE_TTL', null), - ], - - /* - |-------------------------------------------------------------------------- - | Namespaces - |-------------------------------------------------------------------------- - | - | These are the default namespaces where Lighthouse looks for classes - | that extend functionality of the schema. You may pass either a string - | or an array, they are tried in order and the first match is used. - | - */ - - 'namespaces' => [ - 'models' => ['App', 'App\\Models'], - 'queries' => 'App\\GraphQL\\Queries', - 'mutations' => 'App\\GraphQL\\Mutations', - 'subscriptions' => 'App\\GraphQL\\Subscriptions', - 'interfaces' => 'App\\GraphQL\\Interfaces', - 'unions' => 'App\\GraphQL\\Unions', - 'scalars' => 'App\\GraphQL\\Scalars', - 'directives' => ['WM\\Core\\GraphQL\\Directives', 'WM\\CRM\\GraphQL\\Directives'], - ], - - /* - |-------------------------------------------------------------------------- - | Security - |-------------------------------------------------------------------------- - | - | Control how Lighthouse handles security related query validation. - | This configures the options from http://webonyx.github.io/graphql-php/security/ - | A setting of "0" means that the validation rule is disabled. - | - */ - - 'security' => [ - 'max_query_complexity' => 0, - 'max_query_depth' => 0, - 'disable_introspection' => \GraphQL\Validator\Rules\DisableIntrospection::DISABLED, - ], - - /* - |-------------------------------------------------------------------------- - | Pagination - |-------------------------------------------------------------------------- - | - | Limits the maximum "count" that users may pass as an argument - | to fields that are paginated with the @paginate directive. - | A setting of "null" means the count is unrestricted. - | - */ - - 'paginate_max_count' => 48, - - /* - |-------------------------------------------------------------------------- - | Pagination Amount Argument - |-------------------------------------------------------------------------- - | - | Set the name to use for the generated argument on paginated fields - | that controls how many results are returned. - | This will default to "first" in v4. - | - */ - - 'pagination_amount_argument' => 'count', - - /* - |-------------------------------------------------------------------------- - | Debug - |-------------------------------------------------------------------------- - | - | Control the debug level as described in http://webonyx.github.io/graphql-php/error-handling/ - | Debugging is only applied if the global Laravel debug config is set to true. - | - */ - - 'debug' => \GraphQL\Error\Debug::INCLUDE_DEBUG_MESSAGE | \GraphQL\Error\Debug::INCLUDE_TRACE, - - /* - |-------------------------------------------------------------------------- - | Error Handlers - |-------------------------------------------------------------------------- - | - | Register error handlers that receive the Errors that occur during execution - | and handle them. You may use this to log, filter or format the errors. - | The classes must implement \Nuwave\Lighthouse\Execution\ErrorHandler - | - */ - - 'error_handlers' => [ - \Nuwave\Lighthouse\Execution\ExtensionErrorHandler::class, - ], - - /* - |-------------------------------------------------------------------------- - | DEPRECATED GraphQL Controller - |-------------------------------------------------------------------------- - | - | Specify which controller (and method) you want to handle GraphQL requests. - | This option will be removed in v4. - | - */ - - 'controller' => \Nuwave\Lighthouse\Support\Http\Controllers\GraphQLController::class.'@query', - - /* - |-------------------------------------------------------------------------- - | Global ID - |-------------------------------------------------------------------------- - | - | The name that is used for the global id field on the Node interface. - | When creating a Relay compliant server, this must be named "id". - | - */ - - 'global_id_field' => 'id', - - /* - |-------------------------------------------------------------------------- - | Batched Queries - |-------------------------------------------------------------------------- - | - | GraphQL query batching means sending multiple queries to the server in one request, - | You may set this flag to either process or deny batched queries. - | - */ - - 'batched_queries' => true, - - /* - |-------------------------------------------------------------------------- - | Transactional Mutations - |-------------------------------------------------------------------------- - | - | Sets default setting for transactional mutations. - | You may set this flag to have @create|@update mutations transactional or not. - | - */ - - 'transactional_mutations' => true, - - /* - |-------------------------------------------------------------------------- - | New Between Directives - |-------------------------------------------------------------------------- - | - | Use the new @whereBetween and @whereBetween directives that will - | replace their current implementation in v4 by setting this to true. - | As the old versions are removed, this will not have an effect anymore. - | - */ - - 'new_between_directives' => false, - - /* - |-------------------------------------------------------------------------- - | GraphQL Subscriptions - |-------------------------------------------------------------------------- - | - | Here you can define GraphQL subscription "broadcasters" and "storage" drivers - | as well their required configuration options. - | - */ - - 'subscriptions' => [ - /* - * Determines if broadcasts should be queued by default. - */ - 'queue_broadcasts' => env('LIGHTHOUSE_QUEUE_BROADCASTS', true), - - /* - * Default subscription storage. - * - * Any Laravel supported cache driver options are available here. - */ - 'storage' => env('LIGHTHOUSE_SUBSCRIPTION_STORAGE', 'redis'), - - /* - * Default subscription broadcaster. - */ - 'broadcaster' => env('LIGHTHOUSE_BROADCASTER', 'pusher'), - - /* - * Subscription broadcasting drivers with config options. - */ - 'broadcasters' => [ - 'log' => [ - 'driver' => 'log', - ], - 'pusher' => [ - 'driver' => 'pusher', - 'routes' => \Nuwave\Lighthouse\Subscriptions\SubscriptionRouter::class.'@pusher', - 'connection' => 'pusher', - ], - ], - ], - -]; diff --git a/graphql/schema.graphql b/graphql/schema.graphql deleted file mode 100644 index ed0b051..0000000 --- a/graphql/schema.graphql +++ /dev/null @@ -1,19 +0,0 @@ -"A datetime string with format `Y-m-d H:i:s`, e.g. `2018-01-01 13:00:00`." -scalar DateTime @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") - -"A date string with format `Y-m-d`, e.g. `2011-05-23`." -scalar Date @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Date") - -input DateRange { - from: Date! - to: Date! -} - -type Mutation -type Query - - -#import ../modules/wm-crm/graphql/CRM.graphql -#import ../modules/wm-core/graphql/Core.graphql -#import ../modules/wm-common/graphql/Common.graphql - From 79982a185c8f3b5796011f5e0d5753f8a9cbf66a Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Mon, 26 Aug 2019 00:08:05 +0430 Subject: [PATCH 13/39] permission and aut --- public/mix-manifest.json | 10 +-- .../js/Global/components/Drawer/SideBar.vue | 11 ++- resources/js/Global/components/Misc/Alert.vue | 19 ++++ resources/js/Global/mixins/global.js | 33 +++++-- resources/js/Global/plugins/auth.js | 18 ++++ .../js/Global/services/storage.services.js | 10 ++- resources/js/Global/utils/Permissions/list.js | 6 +- resources/js/Home/app.js | 8 +- resources/js/Home/views/Home.vue | 89 ++++++++++++------- 9 files changed, 143 insertions(+), 61 deletions(-) create mode 100644 resources/js/Global/components/Misc/Alert.vue create mode 100644 resources/js/Global/plugins/auth.js diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 4bc7d39..1186af9 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=dfec734f6a8269341342", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=9f7b5df53789693aae62", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=252b52bb78d06845370f", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=1fd7d081faa5afc1e968", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=caa37176d181f1cabcd1" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=9d41bd8d991d67dc5aca", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=66508c2fd5ce92d2e1fa", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=1c06e1143737f86f5941", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=6ad848b6a54b25f9f62e", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=58adfc6b944d170b62eb" } diff --git a/resources/js/Global/components/Drawer/SideBar.vue b/resources/js/Global/components/Drawer/SideBar.vue index bd9c0ac..c2087f7 100644 --- a/resources/js/Global/components/Drawer/SideBar.vue +++ b/resources/js/Global/components/Drawer/SideBar.vue @@ -20,7 +20,7 @@ - {{ user.name }} + {{ getAuthUser.name }}
مدیریت
@@ -47,8 +47,7 @@ diff --git a/resources/js/Global/components/Misc/Alert.vue b/resources/js/Global/components/Misc/Alert.vue new file mode 100644 index 0000000..41e8e5d --- /dev/null +++ b/resources/js/Global/components/Misc/Alert.vue @@ -0,0 +1,19 @@ + + \ No newline at end of file diff --git a/resources/js/Global/mixins/global.js b/resources/js/Global/mixins/global.js index f9792f1..af91663 100644 --- a/resources/js/Global/mixins/global.js +++ b/resources/js/Global/mixins/global.js @@ -1,12 +1,15 @@ -import { mapActions, mapMutations } from "vuex"; +import { mapActions } from "vuex"; +import globalStore from "@Global/store"; +import authStore from "@Core/store"; +import permissionList from "@Global/utils/Permissions/list"; const global = { methods: { $_getPath(subPath) { - return '/' + subPath; + return "/" + subPath; }, //Modal - + ...mapActions("modal", ["openModal", "closeModal", "dialog"]), $_openModal(options) { this.openModal(options); @@ -22,10 +25,28 @@ const global = { }, //Permission - $_hasPermission(premission) { + $_hasPermission(permission, owner = false) { return true; - }, + let currentModule = globalStore.state.common.current_module; + let permissions = authStore.state.auth.permissions; + let multiPermission = permission.split("|"); + for (const iterator of multiPermission) { + if (iterator == '') { + return true; + } + permission = permissionList[iterator]; + if ( + owner || + (permission && + permissions[currentModule] && + permissions[currentModule].includes(permission)) + ) { + return true; + } + } + return false; + } } }; -export {global} +export { global }; diff --git a/resources/js/Global/plugins/auth.js b/resources/js/Global/plugins/auth.js new file mode 100644 index 0000000..534555e --- /dev/null +++ b/resources/js/Global/plugins/auth.js @@ -0,0 +1,18 @@ +import { TokenService, PermissionService, UserService } from "@Global/services/storage.services"; +import ApiService from "@Global/services/api.services"; +import store from "@Core/store/index"; +ApiService.init(); +// If token exists set Authorizion header +if (TokenService.getToken()) { + ApiService.setAuthHeader(); +} + +if (PermissionService.get()) { + store.commit('auth/SET_AUTH_PERMISSIONS', PermissionService.get()) +} else { + store.dispatch('auth/loadAuthPermissions'); +} + +if (UserService.get()) { + store.commit('auth/SET_AUTH_USER', UserService.get()) +} \ No newline at end of file diff --git a/resources/js/Global/services/storage.services.js b/resources/js/Global/services/storage.services.js index cee1739..bea4c34 100644 --- a/resources/js/Global/services/storage.services.js +++ b/resources/js/Global/services/storage.services.js @@ -25,7 +25,10 @@ const TokenService = { const UserService = { get() { - return qs.parse(localStorage.getItem(USER)) + if (localStorage.getItem(USER)) { + return qs.parse(localStorage.getItem(USER)) + } + return null; }, save(user = null) { @@ -40,7 +43,10 @@ const UserService = { const PermissionService = { get() { - return qs.parse(localStorage.getItem(PERMISSION)) + if (localStorage.getItem(PERMISSION)) { + return qs.parse(localStorage.getItem(PERMISSION)) + } + return null; }, save(permission = null) { diff --git a/resources/js/Global/utils/Permissions/list.js b/resources/js/Global/utils/Permissions/list.js index ad8e5ed..e609438 100644 --- a/resources/js/Global/utils/Permissions/list.js +++ b/resources/js/Global/utils/Permissions/list.js @@ -1,6 +1,7 @@ export default { indexTask: 'index-task', storeTask: 'store-task', + receiveTask: 'receive-task', updateTask: 'update-task', destroyTask: 'destroy-task', @@ -60,11 +61,6 @@ export default { updateRole: 'update-role', destroyRole: 'destroy-role', - indexPermission: 'index-permission', - storePermission: 'store-permission', - updatePermission: 'update-permission', - destroyPermission: 'destroy-permission', - sendEmail: 'send-email', sendSMS: 'send-sms', } \ No newline at end of file diff --git a/resources/js/Home/app.js b/resources/js/Home/app.js index 4a3ec79..588f625 100644 --- a/resources/js/Home/app.js +++ b/resources/js/Home/app.js @@ -81,13 +81,7 @@ Vue.mixin({ methods: { ...global["methods"], ...commingSoon["methods"] } }); -import { TokenService } from "@Global/services/storage.services"; -import ApiService from "@Global/services/api.services"; -// If token exists set Authorizion header -ApiService.init(); -if (TokenService.getToken()) { - ApiService.setAuthHeader(); -} +import '@Global/plugins/auth' diff --git a/resources/js/Home/views/Home.vue b/resources/js/Home/views/Home.vue index 3fae22c..fbb5d20 100644 --- a/resources/js/Home/views/Home.vue +++ b/resources/js/Home/views/Home.vue @@ -1,36 +1,28 @@ @@ -38,11 +30,48 @@ From b1a33ac3c4aa914826732bda1d653a7f4b7e0407 Mon Sep 17 00:00:00 2001 From: farid saravi Date: Mon, 26 Aug 2019 16:23:23 +0430 Subject: [PATCH 14/39] add multiple user --- config/auth.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/config/auth.php b/config/auth.php index 09bde06..9cea72a 100644 --- a/config/auth.php +++ b/config/auth.php @@ -45,6 +45,11 @@ return [ 'driver' => 'passport', 'provider' => 'users', ], + + 'apicore' => [ + 'driver' => 'passport', + 'provider' => 'users-core', + ], ], /* @@ -67,13 +72,13 @@ return [ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => WM\Core\Models\User::class, + 'model' => App\User::class, ], - // 'users' => [ - // 'driver' => 'database', - // 'table' => 'users', - // ], + 'users-core' => [ + 'driver' => 'eloquent', + 'model' => WM\Core\Models\User::class, + ], ], /* From 08404cee66e2893449d394c668bdc536dddf1d8d Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Mon, 26 Aug 2019 17:22:53 +0430 Subject: [PATCH 15/39] add permission --- public/mix-manifest.json | 10 +- resources/js/Global/mixins/global.js | 3 +- resources/js/Global/utils/Permissions/list.js | 108 +++++++++--------- 3 files changed, 60 insertions(+), 61 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 1186af9..f1fbc12 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=9d41bd8d991d67dc5aca", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=66508c2fd5ce92d2e1fa", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=1c06e1143737f86f5941", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=6ad848b6a54b25f9f62e", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=58adfc6b944d170b62eb" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=e917cec88302ac6e7538", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=a7e19db897af3390eb04", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=a3cdb90cf4d1d0922a9d", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=25ab416183e2c4cc0213", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=1357eb15c5132a364515" } diff --git a/resources/js/Global/mixins/global.js b/resources/js/Global/mixins/global.js index af91663..61ab213 100644 --- a/resources/js/Global/mixins/global.js +++ b/resources/js/Global/mixins/global.js @@ -26,7 +26,6 @@ const global = { //Permission $_hasPermission(permission, owner = false) { - return true; let currentModule = globalStore.state.common.current_module; let permissions = authStore.state.auth.permissions; let multiPermission = permission.split("|"); @@ -39,7 +38,7 @@ const global = { owner || (permission && permissions[currentModule] && - permissions[currentModule].includes(permission)) + Object.values(permissions[currentModule]).includes(permission)) ) { return true; } diff --git a/resources/js/Global/utils/Permissions/list.js b/resources/js/Global/utils/Permissions/list.js index e609438..b3b670a 100644 --- a/resources/js/Global/utils/Permissions/list.js +++ b/resources/js/Global/utils/Permissions/list.js @@ -1,66 +1,66 @@ export default { - indexTask: 'index-task', - storeTask: 'store-task', - receiveTask: 'receive-task', - updateTask: 'update-task', - destroyTask: 'destroy-task', + indexTask: "index-task", + storeTask: "store-task", + receiveTask: "receive-task", + updateTask: "update-task", + destroyTask: "destroy-task", - indexTaskCategory: 'index-task-category', - storeTaskCategory: 'store-task-category', - updateTaskCategory: 'update-task-category', - destroyTaskCategory: 'destroy-task-category', + indexTaskCategory: "index-task-category", + storeTaskCategory: "store-task-category", + updateTaskCategory: "update-task-category", + destroyTaskCategory: "destroy-task-category", - indexTaskStatus: 'index-task-status', - storeTaskStatus: 'store-task-status', - updateTaskStatus: 'update-task-status', - destroyTaskStatus: 'destroy-task-status', + indexTaskStatus: "index-task-status", + storeTaskStatus: "store-task-status", + updateTaskStatus: "update-task-status", + destroyTaskStatus: "destroy-task-status", - indexEvent: 'index-event', - storeEvent: 'store-event', - updateEvent: 'update-event', - destroyEvent: 'destroy-event', + indexEvent: "index-event", + storeEvent: "store-event", + updateEvent: "update-event", + destroyEvent: "destroy-event", - indexEventCategory: 'index-event-category', - storeEventCategory: 'store-event-category', - updateEventCategory: 'update-event-category', - destroyEventCategory: 'destroy-event-category', + indexEventCategory: "index-event-category", + storeEventCategory: "store-event-category", + updateEventCategory: "update-event-category", + destroyEventCategory: "destroy-event-category", - indexComment: 'index-comment', - storeComment: 'store-comment', - updateComment: 'update-comment', - destroyComment: 'destroy-comment', + indexComment: "index-comment", + storeComment: "store-comment", + updateComment: "update-comment", + destroyComment: "destroy-comment", - indexClient: 'index-client', - storeClient: 'store-client', - updateClient: 'update-client', - destroyClient: 'destroy-client', - - indexClientCategory: 'index-client-category', - storeClientCategory: 'store-client-category', - updateClientCategory: 'update-client-category', - destroyClientCategory: 'destroy-client-category', + indexClient: "index-client", + storeClient: "store-client", + updateClient: "update-client", + destroyClient: "destroy-client", - indexClientStatus: 'index-client-status', - storeClientStatus: 'store-client-status', - updateClientStatus: 'update-client-status', - destroyClientStatus: 'destroy-client-status', + indexClientCategory: "index-client-category", + storeClientCategory: "store-client-category", + updateClientCategory: "update-client-category", + destroyClientCategory: "destroy-client-category", - indexUser: 'index-user', - storeUser: 'store-user', - updateUser: 'update-user', - destroyUser: 'destroy-user', + indexClientStatus: "index-client-status", + storeClientStatus: "store-client-status", + updateClientStatus: "update-client-status", + destroyClientStatus: "destroy-client-status", - indexDepartment: 'index-department', - storeDepartment: 'store-department', - updateDepartment: 'update-department', - destroyDepartment: 'destroy-department', + indexUser: "index-user", + storeUser: "store-user", + updateUser: "update-user", + destroyUser: "destroy-user", - indexRole: 'assign-role', - assignRole: 'assign-role', - storeRole: 'store-role', - updateRole: 'update-role', - destroyRole: 'destroy-role', + indexDepartment: "index-department", + storeDepartment: "store-department", + updateDepartment: "update-department", + destroyDepartment: "destroy-department", - sendEmail: 'send-email', - sendSMS: 'send-sms', -} \ No newline at end of file + indexRole: "assign-role", + assignRole: "assign-role", + storeRole: "store-role", + updateRole: "update-role", + destroyRole: "destroy-role", + + sendEmail: "send-email", + sendSMS: "send-sms" +}; From 7926f611f3fb8f5198114cef3bf67eed0464a4ff Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Mon, 26 Aug 2019 20:41:13 +0430 Subject: [PATCH 16/39] debug name permission --- public/mix-manifest.json | 10 +++---- resources/js/Global/utils/Permissions/list.js | 25 +++++++++-------- resources/js/Home/views/Home.vue | 28 +------------------ 3 files changed, 19 insertions(+), 44 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index f1fbc12..13a7f62 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=e917cec88302ac6e7538", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=a7e19db897af3390eb04", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=a3cdb90cf4d1d0922a9d", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=25ab416183e2c4cc0213", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=1357eb15c5132a364515" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=7eb5970dedabdeeb82ff", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=313676bbd1a2d3e3603e", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=eaf0b0cf4dce5f9e40ae", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=cd88e1d41255e646c6f5", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=977febd311dbdc7edfd0" } diff --git a/resources/js/Global/utils/Permissions/list.js b/resources/js/Global/utils/Permissions/list.js index b3b670a..4ea4c70 100644 --- a/resources/js/Global/utils/Permissions/list.js +++ b/resources/js/Global/utils/Permissions/list.js @@ -3,63 +3,64 @@ export default { storeTask: "store-task", receiveTask: "receive-task", updateTask: "update-task", - destroyTask: "destroy-task", + deleteTask: "delete-task", indexTaskCategory: "index-task-category", storeTaskCategory: "store-task-category", updateTaskCategory: "update-task-category", - destroyTaskCategory: "destroy-task-category", + deleteTaskCategory: "delete-task-category", indexTaskStatus: "index-task-status", storeTaskStatus: "store-task-status", updateTaskStatus: "update-task-status", - destroyTaskStatus: "destroy-task-status", + deleteTaskStatus: "delete-task-status", indexEvent: "index-event", storeEvent: "store-event", updateEvent: "update-event", - destroyEvent: "destroy-event", + deleteEvent: "delete-event", indexEventCategory: "index-event-category", storeEventCategory: "store-event-category", updateEventCategory: "update-event-category", - destroyEventCategory: "destroy-event-category", + deleteEventCategory: "delete-event-category", indexComment: "index-comment", storeComment: "store-comment", updateComment: "update-comment", - destroyComment: "destroy-comment", + deleteComment: "delete-comment", indexClient: "index-client", storeClient: "store-client", updateClient: "update-client", - destroyClient: "destroy-client", + deleteClient: "delete-client", indexClientCategory: "index-client-category", storeClientCategory: "store-client-category", updateClientCategory: "update-client-category", - destroyClientCategory: "destroy-client-category", + deleteClientCategory: "delete-client-category", indexClientStatus: "index-client-status", storeClientStatus: "store-client-status", updateClientStatus: "update-client-status", - destroyClientStatus: "destroy-client-status", + deleteClientStatus: "delete-client-status", indexUser: "index-user", + showUser: "show-user", storeUser: "store-user", updateUser: "update-user", - destroyUser: "destroy-user", + deleteUser: "delete-user", indexDepartment: "index-department", storeDepartment: "store-department", updateDepartment: "update-department", - destroyDepartment: "destroy-department", + deleteDepartment: "delete-department", indexRole: "assign-role", assignRole: "assign-role", storeRole: "store-role", updateRole: "update-role", - destroyRole: "destroy-role", + deleteRole: "delete-role", sendEmail: "send-email", sendSMS: "send-sms" diff --git a/resources/js/Home/views/Home.vue b/resources/js/Home/views/Home.vue index fbb5d20..b62d9ae 100644 --- a/resources/js/Home/views/Home.vue +++ b/resources/js/Home/views/Home.vue @@ -4,7 +4,7 @@ ({ - modules: [ - { - href: "/CRM/Home", - title_class: "Inline LTR Padd10", - main_class: "lg8 xs12", - title_en: "CRM", - title_fa: " مدیریت ارتباط با مشتری ", - description: " کالاها، خدمات، تخفیفات، فروش وِیژه و ... ", - gradient_begin: "d6e7de", - gradient_end: "fff2f3", - img_url: "Members.png", - img_height: "220px" - }, - { - href: "/Reservation/Home", - title_class: "Padd10", - main_class: "lg4 xs12", - title_en: "Reservations", - title_fa: " سیستم رزرو وقت ", - description: " کالاها، خدمات، تخفیفات، فروش وِیژه و ... ", - gradient_begin: "fff", - gradient_end: "f7f7f7", - img_url: "Clock.png", - img_height: "150px" - } - ] }), components: { "wm-tile": Tile From 862291eaac7f16255b9d3404fff28de7e7e50138 Mon Sep 17 00:00:00 2001 From: farid saravi Date: Tue, 27 Aug 2019 05:59:35 +0430 Subject: [PATCH 17/39] back to one gaurd --- config/auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/auth.php b/config/auth.php index 9cea72a..770cdcb 100644 --- a/config/auth.php +++ b/config/auth.php @@ -72,7 +72,7 @@ return [ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\User::class, + 'model' => WM\Core\Models\User::class, ], 'users-core' => [ From 294fb7217d211720353e684d43874d4c86610bf9 Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Tue, 27 Aug 2019 21:59:33 +0430 Subject: [PATCH 18/39] willaengine.ir --- public/mix-manifest.json | 10 +++++----- resources/js/Global/mixins/commingSoon.js | 4 ---- resources/js/Global/services/api.services.js | 1 + 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 13a7f62..26dd847 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=7eb5970dedabdeeb82ff", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=313676bbd1a2d3e3603e", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=eaf0b0cf4dce5f9e40ae", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=cd88e1d41255e646c6f5", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=977febd311dbdc7edfd0" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=022986fe9318c541fc95", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=7aedd72f9c922ce08f63", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=ca238d7a381b8955ace8", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=602ed63b5f2e33b4736c", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=031f8137aea8f6ed9714" } diff --git a/resources/js/Global/mixins/commingSoon.js b/resources/js/Global/mixins/commingSoon.js index ef56edc..3acfc88 100644 --- a/resources/js/Global/mixins/commingSoon.js +++ b/resources/js/Global/mixins/commingSoon.js @@ -9,14 +9,10 @@ var CommingSoonArray = [ "crm-setting", "crm-client-filter", "crm-statistics", - "crm-myRequest", - "crm-myTasks", "user-list-filter", "user-roles", - "main-reservation", - ]; const commingSoon = { methods: { diff --git a/resources/js/Global/services/api.services.js b/resources/js/Global/services/api.services.js index 9015192..5ce3900 100644 --- a/resources/js/Global/services/api.services.js +++ b/resources/js/Global/services/api.services.js @@ -5,6 +5,7 @@ const ApiService = { init(baseURL = null) { if (baseURL) { + baseURL = 'https://www.willaengine.ir' axios.defaults.baseURL = baseURL; } From b45403d5281e7cf7d897fd71345c1084e8771159 Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Tue, 27 Aug 2019 22:13:51 +0430 Subject: [PATCH 19/39] set base api willaengine --- public/mix-manifest.json | 10 +++++----- resources/js/Global/services/api.services.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 26dd847..22a8e15 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=022986fe9318c541fc95", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=7aedd72f9c922ce08f63", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=ca238d7a381b8955ace8", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=602ed63b5f2e33b4736c", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=031f8137aea8f6ed9714" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=9a37db475466d99dccb4", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=4cc352a5dce9309e6923", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=4d4bf3210e69752f9350", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=14839e4a84905b030f1c", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=f6a527bb680091f72668" } diff --git a/resources/js/Global/services/api.services.js b/resources/js/Global/services/api.services.js index 5ce3900..8162070 100644 --- a/resources/js/Global/services/api.services.js +++ b/resources/js/Global/services/api.services.js @@ -4,10 +4,10 @@ import commonState from '@Global/store/modules/common/state'; const ApiService = { init(baseURL = null) { - if (baseURL) { + // if (baseURL) { baseURL = 'https://www.willaengine.ir' axios.defaults.baseURL = baseURL; - } + // } axios.interceptors.request.use((config) => { config.headers = this.setModuleHeader(config.headers); From 4c9c026ef027d1c31301ab980949193e3ad9b3d2 Mon Sep 17 00:00:00 2001 From: Saeid Date: Thu, 29 Aug 2019 18:32:24 +0430 Subject: [PATCH 20/39] edit permission --- public/mix-manifest.json | 10 +++++----- resources/js/Global/utils/Permissions/list.js | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 13a7f62..7d04b53 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=7eb5970dedabdeeb82ff", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=313676bbd1a2d3e3603e", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=eaf0b0cf4dce5f9e40ae", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=cd88e1d41255e646c6f5", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=977febd311dbdc7edfd0" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=470239d86abd12529522", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=0174603f5db8cf129ef6", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=4121b95dcdd6cfac96a8", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=0e5a051cf27216440d3b", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=87e209dae9d9c4176280" } diff --git a/resources/js/Global/utils/Permissions/list.js b/resources/js/Global/utils/Permissions/list.js index 4ea4c70..f15b104 100644 --- a/resources/js/Global/utils/Permissions/list.js +++ b/resources/js/Global/utils/Permissions/list.js @@ -32,6 +32,7 @@ export default { indexClient: "index-client", storeClient: "store-client", + showClient: "show-client", updateClient: "update-client", deleteClient: "delete-client", From cc7c34733423c57d83fe9a5ffb4b8997e299de66 Mon Sep 17 00:00:00 2001 From: Saeid Date: Sat, 31 Aug 2019 19:18:03 +0430 Subject: [PATCH 21/39] common app. in plugin --- public/mix-manifest.json | 8 +- resources/js/Global/plugins/apexchart.js | 4 + resources/js/Global/plugins/ckeditor.js | 4 + .../js/Global/plugins/globalComponent.js | 42 +++++++++++ resources/js/Global/plugins/veeValidate.js | 8 ++ resources/js/Home/app.js | 74 +++---------------- 6 files changed, 71 insertions(+), 69 deletions(-) create mode 100644 resources/js/Global/plugins/apexchart.js create mode 100644 resources/js/Global/plugins/ckeditor.js create mode 100644 resources/js/Global/plugins/globalComponent.js create mode 100644 resources/js/Global/plugins/veeValidate.js diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 062e4eb..5a6f86b 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=358ba0b10884670e333e", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=eda0f66d5dc672be683e", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=84b16cc0f70dd3593e50", + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=a3c38711b09aaedc50dc", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=356f66fbb3cb99f5c596", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=de9e6779f1bb079ba1a1", "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=302a5f0d2c4cc7dbbfb5", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=37c7c87ec9eaa744d95b" + "/js/vue/User/app.js": "/js/vue/User/app.js?id=31d333a3b4b73ad2aed9" } diff --git a/resources/js/Global/plugins/apexchart.js b/resources/js/Global/plugins/apexchart.js new file mode 100644 index 0000000..11f0e14 --- /dev/null +++ b/resources/js/Global/plugins/apexchart.js @@ -0,0 +1,4 @@ +import Vue from "vue"; + +import VueApexCharts from "vue-apexcharts"; +Vue.component("apexchart", VueApexCharts); diff --git a/resources/js/Global/plugins/ckeditor.js b/resources/js/Global/plugins/ckeditor.js new file mode 100644 index 0000000..0437037 --- /dev/null +++ b/resources/js/Global/plugins/ckeditor.js @@ -0,0 +1,4 @@ +import Vue from 'vue'; +import CKEditor from "@ckeditor/ckeditor5-vue"; +import "@ckeditor/ckeditor5-build-classic/build/translations/fa.js"; +Vue.use(CKEditor); diff --git a/resources/js/Global/plugins/globalComponent.js b/resources/js/Global/plugins/globalComponent.js new file mode 100644 index 0000000..19351ac --- /dev/null +++ b/resources/js/Global/plugins/globalComponent.js @@ -0,0 +1,42 @@ +import Vue from 'vue'; + + +import VueScrollReveal from "vue-scroll-reveal"; +import Vuetify from 'vuetify' + + +import "popper.js"; +import "bootstrap-v4-rtl"; +import "bootstrap-v4-rtl/scss/bootstrap-rtl.scss"; +import "bootstrap-select"; +import "bootstrap-select/dist/css/bootstrap-select.css"; +import "vuetify/dist/vuetify.min.css"; // Ensure you are using css-loader +import "@Global/assets/Font-Icons/css/fontello.css"; +import "@Global/scss/style.scss"; + +// components +import PartTitle from "@Global/components/Dividers/PartTitle.vue"; +import PageTitle from "@Global/components/Dividers/PageTitle.vue"; +import Checkbox from "@Global/components/Inputs/Checkbox.vue"; +import InfoBlock from "@Global/components/Misc/InfoBlock.vue"; +import Breadcrumbs from "@Global/components/Misc/Breadcrumbs"; + + +Vue.use(VueScrollReveal, { + class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides. + duration: 800, + scale: 1, + distance: '10px', + mobile: false +}); + +Vue.use(Vuetify, { + iconfont: "fa", + rtl: true +}); + +Vue.component("WM-PartTitle", PartTitle); +Vue.component("WM-PageTitle", PageTitle); +Vue.component("WM-Checkbox", Checkbox); +Vue.component("WM-InfoBlock", InfoBlock); +Vue.component("wm-breadcrumbs", Breadcrumbs); \ No newline at end of file diff --git a/resources/js/Global/plugins/veeValidate.js b/resources/js/Global/plugins/veeValidate.js new file mode 100644 index 0000000..538cea8 --- /dev/null +++ b/resources/js/Global/plugins/veeValidate.js @@ -0,0 +1,8 @@ +import Vue from 'vue'; +//validateion +import VeeValidate, { Validator } from "vee-validate"; +import fa from "@Global/utils/vee-validate/locale/fa"; +import "@Global/utils/vee-validate/newRules"; +Vue.use(VeeValidate); + +Validator.localize("fa", fa); \ No newline at end of file diff --git a/resources/js/Home/app.js b/resources/js/Home/app.js index 588f625..17fe196 100644 --- a/resources/js/Home/app.js +++ b/resources/js/Home/app.js @@ -2,87 +2,31 @@ import Vue from 'vue' import App from './App.vue' import router from './router' import store from './store' -import VueScrollReveal from 'vue-scroll-reveal' -import Vuetify from 'vuetify' -import { global } from "@Global/mixins/global"; -import { commingSoon } from "@Global/mixins/commingSoon"; - -import 'popper.js' -import 'bootstrap-v4-rtl' -import 'bootstrap-v4-rtl/scss/bootstrap-rtl.scss' -import 'bootstrap-select' -import 'bootstrap-select/dist/css/bootstrap-select.css' -import 'vuetify/dist/vuetify.min.css' // Ensure you are using css-loader -import '@Global/assets/Font-Icons/css/fontello.css' -import "@Global/scss/style.scss" - - -// components -import PartTitle from "@Global/components/Dividers/PartTitle.vue"; -Vue.component('WM-PartTitle', PartTitle) -import PageTitle from "@Global/components/Dividers/PageTitle.vue"; -Vue.component('WM-PageTitle', PageTitle) -import Checkbox from "@Global/components/Inputs/Checkbox.vue"; -Vue.component('WM-Checkbox', Checkbox) +//components +import '@Global/plugins/globalComponent.js' -import InfoBlock from "@Global/components/Misc/InfoBlock.vue"; -Vue.component('WM-InfoBlock', InfoBlock) - -import Breadcrumbs from '@Global/components/Misc/Breadcrumbs'; -Vue.component('wm-breadcrumbs', Breadcrumbs) +//hint text import HintText from "@Global/components/Texts/Hint.vue"; Vue.component('wm-hint-text', HintText) -/** - * First we will load all of this project's JavaScript dependencies which - * includes Vue and other libraries. It is a great starting point when - * building robust, powerful web applications using Vue and Laravel. - */ - - +//vue window.Vue = require('vue'); -/** - * The following block of code may be used to automatically register your - * Vue components. It will recursively scan this directory for the Vue - * components and automatically register them with their "basename". - * - * Eg. ./components/ExampleComponent.vue -> - */ - -// const files = require.context('./', true, /\.vue$/i) -// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)) -/** - * Next, we will create a fresh Vue application instance and attach it to - * the page. Then, you may begin adding components to this application - * or customize the JavaScript scaffolding to fit your unique needs. - */ - - -Vue.use(Vuetify, { - iconfont: 'fa', - rtl: true, -}); - -// Vue.config.productionTip = false; -Vue.use(VueScrollReveal, { - class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides. - duration: 800, - scale: 1, - distance: '10px', - mobile: false -}); +//mixin +import { global } from "@Global/mixins/global"; +import { commingSoon } from "@Global/mixins/commingSoon"; Vue.mixin({ methods: { ...global["methods"], ...commingSoon["methods"] } }); -import '@Global/plugins/auth' +//auth +import '@Global/plugins/auth' const app = new Vue({ From ca0a7f70aae97cba3e8ad5fbbd3e85952e1a4b2f Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Sun, 1 Sep 2019 22:18:46 +0430 Subject: [PATCH 22/39] commit --- public/mix-manifest.json | 10 +++++----- resources/js/Global/services/api.services.js | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 5a6f86b..e59dd88 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=a3c38711b09aaedc50dc", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=356f66fbb3cb99f5c596", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=de9e6779f1bb079ba1a1", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=302a5f0d2c4cc7dbbfb5", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=31d333a3b4b73ad2aed9" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=c9ebdffec50d82145867", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=e2cd567ef427a1285194", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=21ca2c0fd50704c54125", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=ecddb140ee87bb6dfc7c", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=ba20da8154c5c04c0dd6" } diff --git a/resources/js/Global/services/api.services.js b/resources/js/Global/services/api.services.js index 8162070..120c465 100644 --- a/resources/js/Global/services/api.services.js +++ b/resources/js/Global/services/api.services.js @@ -4,10 +4,10 @@ import commonState from '@Global/store/modules/common/state'; const ApiService = { init(baseURL = null) { - // if (baseURL) { - baseURL = 'https://www.willaengine.ir' + if (baseURL) { + // baseURL = 'https://www.willaengine.ir' axios.defaults.baseURL = baseURL; - // } + } axios.interceptors.request.use((config) => { config.headers = this.setModuleHeader(config.headers); From 9388bf4eaad9b4b8ec9cf3fcfab94fb4375f3804 Mon Sep 17 00:00:00 2001 From: farid saravi Date: Fri, 6 Sep 2019 19:45:10 +0430 Subject: [PATCH 23/39] some cleanup --- app/Address.php | 26 -- app/Attribute.php | 34 --- app/AttributeValue.php | 18 -- app/Auction.php | 23 -- app/BatchShoppingCart.php | 27 -- app/Blog.php | 74 ----- app/BlogCategory.php | 30 -- app/Brand.php | 29 -- app/Business.php | 279 ------------------ app/BusinessItem.php | 186 ------------ app/BusinessItemVariation.php | 51 ---- app/BusinessTitle.php | 38 --- app/Category.php | 122 -------- app/CategoryTempBusiness.php | 12 - app/ChatMessage.php | 10 - app/City.php | 68 ----- app/Client.php | 38 --- app/Comment.php | 25 -- app/ContactMessage.php | 25 -- app/Conversation.php | 30 -- app/Cooperation.php | 38 --- app/CooperationData.php | 34 --- app/CrmEvent.php | 41 --- app/Data.php | 21 -- app/District.php | 30 -- app/EmplQuestion.php | 21 -- app/EmplResults.php | 29 -- app/Event.php | 45 --- app/Faq.php | 25 -- app/FaqCategory.php | 15 - app/Feedback.php | 27 -- app/Finance.php | 15 - app/Gallery.php | 99 ------- app/GalleryLast.php | 90 ------ app/GalleryNew.php | 90 ------ app/Gift.php | 14 - app/Help.php | 24 -- app/HelpCategory.php | 16 - app/Language.php | 13 - app/Like.php | 18 -- app/Message.php | 40 --- app/News.php | 90 ------ app/Offer.php | 19 -- app/Option.php | 24 -- app/Order.php | 66 ----- app/OrderItem.php | 51 ---- app/Payment.php | 13 - app/Permission.php | 14 - app/Portfolio.php | 62 ---- app/Post.php | 32 -- app/Product.php | 98 ------ app/ProductDetail.php | 16 - app/Project.php | 98 ------ app/Promotion.php | 15 - app/Reservation.php | 22 -- app/Role.php | 18 -- app/RollCall.php | 18 -- app/Section.php | 21 -- app/ShippingGroup.php | 26 -- app/ShippingMethod.php | 22 -- app/ShippingRule.php | 30 -- app/ShoppingCart.php | 48 --- app/SimpleMessage.php | 11 - app/Site.php | 29 -- app/SiteConfig.php | 82 ----- app/SmsPanel.php | 31 -- app/SocialMedia.php | 17 -- app/SpFacility.php | 24 -- app/SpFacilityType.php | 14 - app/SpFrame.php | 96 ------ app/SpFrameType.php | 25 -- app/SpLink.php | 22 -- app/SpMasterTemplate.php | 18 -- app/SpPage.php | 26 -- app/SpPageType.php | 16 - app/SpSection.php | 31 -- app/SpTemplate.php | 80 ----- app/SpUserElement.php | 53 ---- app/SpUserFacility.php | 21 -- app/SpUserFrame.php | 134 --------- app/SpUserPage.php | 90 ------ app/SpUserTemplate.php | 78 ----- app/SpecialContent.php | 20 -- app/SpecialContentOption.php | 56 ---- app/Staff.php | 19 -- app/Strategy.php | 24 -- app/Tag.php | 47 --- app/TagGroup.php | 23 -- app/Task.php | 78 ----- app/TempBusiness.php | 76 ----- app/Transaction.php | 32 -- app/TransactionLog.php | 18 -- app/Upload.php | 24 -- app/Uploadable.php | 26 -- app/UploadableLast.php | 26 -- app/UploadableNew.php | 26 -- app/User.php | 210 ------------- app/UserTransaction.php | 19 -- app/WmItem.php | 40 --- app/WmItemsCategory.php | 25 -- app/WmPackage.php | 24 -- composer.json | 1 + composer.lock | 261 ++++++++-------- config/modules.php | 188 ------------ ...9_09_05_192945_add_load_in_home_column.php | 31 ++ database/seeds/DatabaseSeeder.php | 3 +- routes/api.php | 3 - 107 files changed, 172 insertions(+), 4719 deletions(-) delete mode 100644 app/Address.php delete mode 100644 app/Attribute.php delete mode 100644 app/AttributeValue.php delete mode 100644 app/Auction.php delete mode 100644 app/BatchShoppingCart.php delete mode 100644 app/Blog.php delete mode 100644 app/BlogCategory.php delete mode 100644 app/Brand.php delete mode 100644 app/Business.php delete mode 100644 app/BusinessItem.php delete mode 100644 app/BusinessItemVariation.php delete mode 100644 app/BusinessTitle.php delete mode 100644 app/Category.php delete mode 100644 app/CategoryTempBusiness.php delete mode 100644 app/ChatMessage.php delete mode 100644 app/City.php delete mode 100644 app/Client.php delete mode 100644 app/Comment.php delete mode 100644 app/ContactMessage.php delete mode 100644 app/Conversation.php delete mode 100644 app/Cooperation.php delete mode 100644 app/CooperationData.php delete mode 100644 app/CrmEvent.php delete mode 100644 app/Data.php delete mode 100644 app/District.php delete mode 100644 app/EmplQuestion.php delete mode 100644 app/EmplResults.php delete mode 100644 app/Event.php delete mode 100644 app/Faq.php delete mode 100644 app/FaqCategory.php delete mode 100644 app/Feedback.php delete mode 100644 app/Finance.php delete mode 100644 app/Gallery.php delete mode 100644 app/GalleryLast.php delete mode 100644 app/GalleryNew.php delete mode 100644 app/Gift.php delete mode 100644 app/Help.php delete mode 100644 app/HelpCategory.php delete mode 100644 app/Language.php delete mode 100644 app/Like.php delete mode 100644 app/Message.php delete mode 100644 app/News.php delete mode 100644 app/Offer.php delete mode 100644 app/Option.php delete mode 100644 app/Order.php delete mode 100644 app/OrderItem.php delete mode 100644 app/Payment.php delete mode 100644 app/Permission.php delete mode 100644 app/Portfolio.php delete mode 100644 app/Post.php delete mode 100644 app/Product.php delete mode 100644 app/ProductDetail.php delete mode 100644 app/Project.php delete mode 100644 app/Promotion.php delete mode 100644 app/Reservation.php delete mode 100644 app/Role.php delete mode 100644 app/RollCall.php delete mode 100644 app/Section.php delete mode 100644 app/ShippingGroup.php delete mode 100644 app/ShippingMethod.php delete mode 100644 app/ShippingRule.php delete mode 100644 app/ShoppingCart.php delete mode 100644 app/SimpleMessage.php delete mode 100644 app/Site.php delete mode 100644 app/SiteConfig.php delete mode 100644 app/SmsPanel.php delete mode 100644 app/SocialMedia.php delete mode 100644 app/SpFacility.php delete mode 100644 app/SpFacilityType.php delete mode 100644 app/SpFrame.php delete mode 100644 app/SpFrameType.php delete mode 100644 app/SpLink.php delete mode 100644 app/SpMasterTemplate.php delete mode 100644 app/SpPage.php delete mode 100644 app/SpPageType.php delete mode 100644 app/SpSection.php delete mode 100644 app/SpTemplate.php delete mode 100644 app/SpUserElement.php delete mode 100644 app/SpUserFacility.php delete mode 100644 app/SpUserFrame.php delete mode 100644 app/SpUserPage.php delete mode 100644 app/SpUserTemplate.php delete mode 100644 app/SpecialContent.php delete mode 100644 app/SpecialContentOption.php delete mode 100644 app/Staff.php delete mode 100644 app/Strategy.php delete mode 100644 app/Tag.php delete mode 100644 app/TagGroup.php delete mode 100644 app/Task.php delete mode 100644 app/TempBusiness.php delete mode 100644 app/Transaction.php delete mode 100644 app/TransactionLog.php delete mode 100644 app/Upload.php delete mode 100644 app/Uploadable.php delete mode 100644 app/UploadableLast.php delete mode 100644 app/UploadableNew.php delete mode 100644 app/User.php delete mode 100644 app/UserTransaction.php delete mode 100644 app/WmItem.php delete mode 100644 app/WmItemsCategory.php delete mode 100644 app/WmPackage.php delete mode 100644 config/modules.php create mode 100644 database/migrations/2019_09_05_192945_add_load_in_home_column.php diff --git a/app/Address.php b/app/Address.php deleted file mode 100644 index 4576114..0000000 --- a/app/Address.php +++ /dev/null @@ -1,26 +0,0 @@ -morphTo(); - } - - public function city () - { - return $this->belongsTo('App\City'); - } - -} diff --git a/app/Attribute.php b/app/Attribute.php deleted file mode 100644 index 6798aa6..0000000 --- a/app/Attribute.php +++ /dev/null @@ -1,34 +0,0 @@ -hasMany('App\AttributeValue'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function businesses() - { - return $this->belongsToMany('App\Business'); - } - - public function products() - { - return $this->belongsToMany('App\Product'); - } - -} diff --git a/app/AttributeValue.php b/app/AttributeValue.php deleted file mode 100644 index edaf73c..0000000 --- a/app/AttributeValue.php +++ /dev/null @@ -1,18 +0,0 @@ -belongsTo('App\Attribute'); - } - -} diff --git a/app/Auction.php b/app/Auction.php deleted file mode 100644 index 22df269..0000000 --- a/app/Auction.php +++ /dev/null @@ -1,23 +0,0 @@ -hasMany('App\Order'); - } - - public function business_item_variation () - { - return $this->belongsTo('App\BusinessItemVariation'); - } - -} diff --git a/app/BatchShoppingCart.php b/app/BatchShoppingCart.php deleted file mode 100644 index 51c79b2..0000000 --- a/app/BatchShoppingCart.php +++ /dev/null @@ -1,27 +0,0 @@ -attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - public function shopping_carts() - { - return $this->hasMany('App\ShoppingCart'); - } - -} diff --git a/app/Blog.php b/app/Blog.php deleted file mode 100644 index 98769a1..0000000 --- a/app/Blog.php +++ /dev/null @@ -1,74 +0,0 @@ -morphToMany('App\Gallery', 'uploadable'); - } - - public function category() - { - return $this->belongsTo('App\BlogCategory', 'blog_category_id'); - } - - public function categories() - { - return $this->belongsToMany('App\BlogCategory', 'blog_blog_category'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - public function likes() - { - return $this->morphMany('App\Like', 'likeable'); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable'); - } - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function tiny_images() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TinyImages')->where('parent_id', null); - } - - public function getTotalLikesAttribute() - { - return $this->morphMany('App\Like', 'likeable')->count(); - } - - public function setUserIdAttribute($value) - { - $this->attributes['user_id'] = \Auth::user()->id; - } -} diff --git a/app/BlogCategory.php b/app/BlogCategory.php deleted file mode 100644 index 125fae2..0000000 --- a/app/BlogCategory.php +++ /dev/null @@ -1,30 +0,0 @@ -belongsTo('App\BlogCategory', 'parent_id'); - } - - public function children() - { - return $this->hasMany('App\BlogCategory', 'parent_id'); - } - - public function blogs() - { - return $this->belongsToMany('App\Blog','blog_blog_category'); - } - -} diff --git a/app/Brand.php b/app/Brand.php deleted file mode 100644 index 0b4b508..0000000 --- a/app/Brand.php +++ /dev/null @@ -1,29 +0,0 @@ -belongsToMany('App\Category'); - } - - public function business_items() - { - return $this->hasMany('App\BusinessItem'); - } - - public function products() - { - return $this->hasMany('App\Product'); - } - -} diff --git a/app/Business.php b/app/Business.php deleted file mode 100644 index f46eb65..0000000 --- a/app/Business.php +++ /dev/null @@ -1,279 +0,0 @@ -check() && $this->likes()->get()) { - foreach ($this->likes()->get() as $like) { - if (auth()->user()->id === $like->user_id) - return true; - } - return false; - } - return false; - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function setFeaturesAttribute($value) - { - $this->attributes['features'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function setPhonesAttribute($value) - { - $this->attributes['phones'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - - public function getPhonesAttribute() - { - return json_decode($this->attributes['phones']); - } - - public function getDetailsAttribute() - { - $details = json_decode($this->attributes['details']); - if ($details and isset($details->PaymentMethods)) { - $configMethods = config('SPconf.PaymentMethods'); - $methods = []; - foreach ($details->PaymentMethods as $PaymentMethod) { - if (array_has($configMethods, $PaymentMethod)) { - $methods[$PaymentMethod] = $configMethods[$PaymentMethod]; - } - } - $details->PaymentMethods = $methods; - } - return $details; - } - - public function getFeaturesAttribute() - { - return json_decode($this->attributes['features']); - } - - public function business_items() - { - return $this->hasMany('App\BusinessItem'); - } - - public function verified_business_items() - { - return $this->hasMany('App\BusinessItem')->where('verification', 1); - } - - public function portfolios() - { - return $this->hasMany('App\Portfolio'); - } - - public function contact_messages() - { - return $this->hasMany('App\ContactMessage'); - } - - public function reservations() - { - return $this->hasMany('App\Reservation'); - } - - public function business_title() - { - return $this->belongsTo('App\BusinessTitle'); - } - - public function addresses() - { - return $this->morphMany('App\Address', 'addressable'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - public function categories() - { - return $this->belongsToMany('App\Category')->withTimestamps(); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function shopping_carts() - { - return $this->hasMany('App\ShoppingCart'); - } - - public function orders() - { - return $this->hasMany('App\Order'); - } - - public function city() - { - return $this->belongsTo('App\City'); - } - - public function district() - { - return $this->belongsTo('App\District'); - } - - public function data() - { - return $this->hasMany('App\Data'); - } - - public function template() - { - return $this->hasMany('App\SpUserTemplate'); - } - - public function user_templates() - { - return $this->hasMany('App\SpUserTemplate'); - } - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function news() - { - return $this->hasMany('App\News'); - } - - public function likes() - { - return $this->morphMany('App\Like', 'likeable'); - } - - public function toSearchableArray() - { - return [ - 'id' => $this->id, - 'brand_en' => $this->brand_en, - 'brand_fa' => $this->brand_fa, - 'city_id' => $this->city_id, - ]; - } - - /** - * Get all of the post's comments. - */ - public function comments() - { - return $this->morphMany('App\Comment', 'commentable')->orderBy('updated_at', 'desc'); - } - - public function feedbacks() - { - return $this->morphMany('App\Feedback', 'feedbackable')->orderBy('updated_at', 'desc'); - } - - public function members() - { - return $this->belongsToMany('App\user', 'business_has_user', 'business_id', 'user_id'); - } - - public function orginalImages() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function files() - { - return $this->hasMany('App\Gallery')->where('parent_id', null); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'logo')->where('parent_id', null); - } - - public function orginalLogo() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'logo')->where('parent_id', null); - } - - public function logo() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'logo')->where('parent_id', null); - } - - public function orginalBanner() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null); - } - - public function banner() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null); - } - - public function special_content_options() - { - return $this->morphMany('App\SpecialContentOption', 'special_content_optionable'); - } - - public function social_media() - { - return $this->hasOne('App\SocialMedia'); - } - - public function events() - { - return $this->hasMany('App\Event'); - } - - public function attributes() - { - return $this->belongsToMany('App\Attribute'); - } - -} diff --git a/app/BusinessItem.php b/app/BusinessItem.php deleted file mode 100644 index 60931ff..0000000 --- a/app/BusinessItem.php +++ /dev/null @@ -1,186 +0,0 @@ -belongsTo('App\Category'); - } - - public function brand() - { - return $this->belongsTo('App\Brand'); - } - - public function city() - { - return $this->belongsTo('App\City'); - } - - public function district() - { - return $this->belongsTo('App\District'); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - - public function product() - { - return $this->belongsTo('App\Product'); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable'); - } - - public function feedbacks() - { - return $this->morphMany('App\Feedback', 'feedbackable')->orderBy('updated_at', 'desc'); - } - - - public function offer() - { - return $this->hasMany('App\Offer'); - } - - public function first_variation() - { - return $this->hasOne('App\BusinessItemVariation'); - } - - public function business_item_variations() - { - return $this->hasMany('App\BusinessItemVariation'); - } - - public function user_frames() - { - return $this->morphToMany('App\\SpUserFrame', 'element', 'sp_user_elements'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function likes() - { - return $this->morphMany('App\Like', 'likeable'); - } - - public function gifts() - { - return $this->hasMany('App\Gift', 'business_item_self_id'); - } - - public function special_content_options() - { - return $this->morphMany('App\SpecialContentOption', 'special_content_optionable'); - } - - public function getDescriptionAttribute() - { - if ($this->product && $this->product->detail && $this->product->detail->description) { - return $this->product->detail->description . "\n" . $this->attributes['description']; - } else { - return $this->attributes['description']; - } - } - - public function getThumbnailAttribute() - { - if ($this->title_image->isNotEmpty()) { - return $this->title_image->first()->path; - } elseif ($this->product() && $this->product && $this->product->title_image->first()) { - return $this->product->title_image->first()->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function getImagePathAttribute() - { - if ($this->title_image->isNotEmpty()) { - return $this->title_image->first()->path; - } elseif ($this->product() && $this->product && $this->product->title_image->first()) { - return $this->product->title_image->first()->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function setDetailLink($value) - { - $this->linkToDetail = "{$value}/{$this->id}"; - } - - public function options() - { - return $this->belongsToMany('App\Option'); - } -} diff --git a/app/BusinessItemVariation.php b/app/BusinessItemVariation.php deleted file mode 100644 index 80802f4..0000000 --- a/app/BusinessItemVariation.php +++ /dev/null @@ -1,51 +0,0 @@ -belongsTo('App\BusinessItem'); - } - - public function shopping_carts () - { - return $this->morphMany('App\ShoppingCart', 'payable'); - } - - public function offers () - { - return $this->hasMany('App\Offer'); - } - - public function orders () - { - return $this->hasMany('App\Order'); - } - - public function auction () - { - return $this->hasOne('App\Auction'); - } - - public function business () - { - return $this->belongsTo('App\Business'); - } - - public function getDescriptionAttribute () - { - return json_decode($this->attributes['description']); - } - - public function setDescriptionAttribute ($value) - { - $this->attributes['description'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } -} diff --git a/app/BusinessTitle.php b/app/BusinessTitle.php deleted file mode 100644 index c3d69fb..0000000 --- a/app/BusinessTitle.php +++ /dev/null @@ -1,38 +0,0 @@ -hasMany('App\Business'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - protected function clearCacheItems(){ - Cache::forget('business_title'); - } -} diff --git a/app/Category.php b/app/Category.php deleted file mode 100644 index bd7b352..0000000 --- a/app/Category.php +++ /dev/null @@ -1,122 +0,0 @@ -belongsTo('App\Category', 'parent_id'); - } - - public function business_title() - { - return $this->hasMany('App\BusinessTitle'); - } - - public function attributes() - { - return $this->hasMany('App\Attribute'); - } - - public function order_variation() - { - return $this->belongsToMany('App\Attribute')->where('for_section', 'Order'); - } - - public function children() - { - return $this->hasMany('App\Category', 'parent_id'); - } - - public function products() - { - return $this->hasMany('App\Product'); - } - - public function brands() - { - return $this->belongsToMany('App\Brand'); - } - - public function business_categories() - { - return $this->belongsToMany('App\Business'); - } - - public function business() - { - return $this->hasMany('App\Business'); - } - - public function business_items() - { - return $this->hasMany('App\BusinessItem'); - } - - public function templates() - { - return $this->hasMany('App\SpTemplate'); - } - - public function user_templates() - { - return $this->hasManyThrough('App\SpUserTemplate', 'App\SpTemplate', 'category_id', 'sp_template_id', 'id', 'id'); - } - - - ////////////// - public function c_attributes() - { - return $this->belongsToMany('App\Attribute', 'attribute_category'); - } - - public function news() - { - return $this->belongsToMany('App\News'); - } - - public function businesses() - { - return $this->belongsToMany('App\Business'); - } - - public function portfolios() - { - return $this->hasMany('App\Portfolio'); - } - - public function shipping_groups() - { - return $this->belongsToMany('App\ShippingGroup'); - } - public function shipping_group_business() - { - return $this->belongsToMany('App\ShippingGroup')->where('business_id', session('ActiveBusiness')); - } - - //override action methods and delete caches - - - protected function clearCacheItems() - { -// dd('rrrr/rrrrun'); - Cache::forget('main_categories'); - } - - protected function updateRelatedFiles() - { - - } -} diff --git a/app/CategoryTempBusiness.php b/app/CategoryTempBusiness.php deleted file mode 100644 index 7ff36c6..0000000 --- a/app/CategoryTempBusiness.php +++ /dev/null @@ -1,12 +0,0 @@ -hasMany('App\Address'); - } - - public function business_items () - { - return $this->hasMany('App\BusinessItem'); - } - - public function businesss () - { - return $this->hasMany('App\Business'); - } - - public function districts () - { - return $this->hasMany('App\District'); - } - - public function destination_orders () - { - return $this->hasMany('App\Orders', 'destination_city_id'); - } - - public function source_orders () - { - return $this->hasMany('App\Orders', 'source_city_id'); - } - - public function parent() - { - return $this->belongsTo('App\City', 'parent_id'); - } - public function children() - { - return $this->hasMany('App\City', 'parent_id'); - } - - public function cities () - { - return $this->hasMany('App\City', 'parent_id'); - } - - public function province () - { - return $this->belongsTo('App\City', 'parent_id'); - } - protected function clearCacheItems(){ - Cache::forget('cities'); - } - -} diff --git a/app/Client.php b/app/Client.php deleted file mode 100644 index 603c6d1..0000000 --- a/app/Client.php +++ /dev/null @@ -1,38 +0,0 @@ -created_at = $model->freshTimestamp(); - }); - } - - public function setBirthDateAttribute($value) - { - if ($value) { - $this->attributes['birth_date'] = \Carbon\Carbon::createFromFormat('Y-m-d', $value)->toDateTimeString(); - } - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - -} diff --git a/app/Comment.php b/app/Comment.php deleted file mode 100644 index 53c772a..0000000 --- a/app/Comment.php +++ /dev/null @@ -1,25 +0,0 @@ -belongsTo('App\User')->select(['id','name']); - } - - public function commentable() - { - return $this->morphTo(); - } - -} diff --git a/app/ContactMessage.php b/app/ContactMessage.php deleted file mode 100644 index 10a0d80..0000000 --- a/app/ContactMessage.php +++ /dev/null @@ -1,25 +0,0 @@ -attributes['data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getDataAttribute() - { - return json_decode($this->attributes['data']); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } -} diff --git a/app/Conversation.php b/app/Conversation.php deleted file mode 100644 index 80f4b3f..0000000 --- a/app/Conversation.php +++ /dev/null @@ -1,30 +0,0 @@ -hasMany('App\Message'); - } - - public function userone() - { - return $this->belongsTo('App\User', 'user_one_id')->select('id', 'name', 'last_activity'); - } - - public function usertwo() - { - return $this->belongsTo('App\User', 'user_two_id')->select('id', 'name', 'last_activity'); - } -} diff --git a/app/Cooperation.php b/app/Cooperation.php deleted file mode 100644 index e2e5616..0000000 --- a/app/Cooperation.php +++ /dev/null @@ -1,38 +0,0 @@ -belongsTo('App\User')->select(['name','id','detail','birthday','cell_number','email']); - } - public function FormData() - { - return $this->hasMany('App\CooperationData', 'type_id') - ->where('model_type' , 'App\Cooperation'); - } - public function UserData() - { - return $this->hasMany('App\CooperationData', 'type_id')->where('model_type' , 'App\\User'); - } - - public function setAppointmentAttribute($value) - { - $carbon = new Carbon(); - $date = substr($value, 0, -3); - $date = $carbon->timestamp($date)->timezone('Asia/Tehran')->toDateString(); - $this->attributes['appointment'] = $date; - } - - } -?> diff --git a/app/CooperationData.php b/app/CooperationData.php deleted file mode 100644 index de9facd..0000000 --- a/app/CooperationData.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes['data']); - } - - public function setDataAttribute($value) - { - $this->attributes['data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public static function getFormData($model_id,$model_type){ - $coop = CooperationData::where('model_type' , $model_type)->where('type_id' , $model_id); - if ($coop->get()){ - return $coop->get(); - }return []; - } - public static function lgn($value){ - $ex = explode ('Common_',$value); - if (count ($ex) > 1){ - return trans ("validation.attributes.{$ex[1]}"); - } - return trans ("validation.attributes.{$value}"); - } - } diff --git a/app/CrmEvent.php b/app/CrmEvent.php deleted file mode 100644 index d35202f..0000000 --- a/app/CrmEvent.php +++ /dev/null @@ -1,41 +0,0 @@ -belongsTo('App\User')->select(['id', 'name']); - } - - public function getDateAttribute() - { - $carbon = new Carbon($this->attributes['date']); - return $carbon; - } - public function setDateAttribute($value) - { - $carbon = new Carbon(); - $date = substr($value, 0, -3); - $date = $carbon->timestamp($date)->timezone('Asia/Tehran')->toDateString(); - $this->attributes['date'] = $date; - } - public function setPropertyAttribute($value){ - $this->attributes['property'] = json_encode($value); - } - public function getPropertyAttribute(){ - return json_decode($this->attributes['property']); - } - public function setUserIdAttribute(){ - $this->attributes['user_id'] = auth()->user()->id; - } -} diff --git a/app/Data.php b/app/Data.php deleted file mode 100644 index d8a3ac0..0000000 --- a/app/Data.php +++ /dev/null @@ -1,21 +0,0 @@ -hasOne('App\Element'); - } - public function business() - { - return $this->belongsTo('App\Business'); - } - -} diff --git a/app/District.php b/app/District.php deleted file mode 100644 index 9b3cc4b..0000000 --- a/app/District.php +++ /dev/null @@ -1,30 +0,0 @@ -belongsTo('App\City'); - } - - public function business_items () - { - return $this->hasMany('App\BusinessItem'); - } - - public function businesss () - { - return $this->hasMany('App\Business'); - } - -} diff --git a/app/EmplQuestion.php b/app/EmplQuestion.php deleted file mode 100644 index c05af38..0000000 --- a/app/EmplQuestion.php +++ /dev/null @@ -1,21 +0,0 @@ -attributes['questions_list']); - } - - public function setQuestionsListAttribute($value) - { - $this->attributes['questions_list'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } -} diff --git a/app/EmplResults.php b/app/EmplResults.php deleted file mode 100644 index 8056b28..0000000 --- a/app/EmplResults.php +++ /dev/null @@ -1,29 +0,0 @@ -attributes['result']); - } - - public function setResultAttribute($value) - { - $this->attributes['result'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function Question() - { - return $this->belongsTo('App\EmplQuestion','question_id'); - } - public function User() - { - return $this->belongsTo('App\User','user_id')->select(['name','id','detail','birthday','cell_number','email']); - } -} diff --git a/app/Event.php b/app/Event.php deleted file mode 100644 index 84bba67..0000000 --- a/app/Event.php +++ /dev/null @@ -1,45 +0,0 @@ -morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - -} diff --git a/app/Faq.php b/app/Faq.php deleted file mode 100644 index 97a1355..0000000 --- a/app/Faq.php +++ /dev/null @@ -1,25 +0,0 @@ -belongsTo('App\FaqCategory'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function tiny_images() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TinyImages')->where('parent_id', null); - } - -} diff --git a/app/FaqCategory.php b/app/FaqCategory.php deleted file mode 100644 index 2280dce..0000000 --- a/app/FaqCategory.php +++ /dev/null @@ -1,15 +0,0 @@ -hasMany('App\Faq'); - } - -} diff --git a/app/Feedback.php b/app/Feedback.php deleted file mode 100644 index bfb16fc..0000000 --- a/app/Feedback.php +++ /dev/null @@ -1,27 +0,0 @@ -morphTo(); - } - - public function author() - { - /// Select ID , Name , ProfilePhoto - /// Change By Saleh - return $this->belongsTo('App\User','author_id')->select(['id','name']); - } - -} diff --git a/app/Finance.php b/app/Finance.php deleted file mode 100644 index 5c25f91..0000000 --- a/app/Finance.php +++ /dev/null @@ -1,15 +0,0 @@ - 'array']; - - public function usages() - { - return $this->hasMany('App\Uploadable', 'gallery_id', 'id'); - } - - public function roles() - { - return $this->hasMany('App\Uploadable', 'gallery_id', 'id'); - } - - public function parent() - { - return $this->belongsTo('App\Gallery', 'parent_id'); - } - - public function children() - { - return $this->hasMany('App\Gallery', 'parent_id', 'id'); - } - - public function businessitem() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_item() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_items() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function businessRole($role = 'Gallery') - { - return $this->morphedByMany('App\Business', 'uploadable')->wherePivot('image_role', $role); - } - - public function portfolios() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - - public function portfolio() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - public function projects() - { - return $this->morphedByMany('App\Project', 'uploadable'); - } - - public function project() - { - return $this->morphedByMany('App\Project', 'uploadable'); - } - - public function product() - { - return $this->morphedByMany('App\Product', 'uploadable'); - } - - public function frames() - { - return $this->morphedByMany('App\SpUserFrame', 'uploadable'); - } - - public function elements() - { - return $this->morphedByMany('App\SpUserElement', 'uploadable'); - } - - public function business() - { - return $this->belongsTo('App\Business', 'business_id', 'id'); - } - - public function getImageRoleAttribute() - { - return $this->pivot->image_role; - } - -} diff --git a/app/GalleryLast.php b/app/GalleryLast.php deleted file mode 100644 index cb8e20f..0000000 --- a/app/GalleryLast.php +++ /dev/null @@ -1,90 +0,0 @@ - 'array']; - - public function usages() - { - return $this->hasMany('App\UploadableLast', 'gallery_id', 'id'); - } - - public function roles() - { - return $this->hasMany('App\UploadableLast', 'gallery_id', 'id'); - } - - public function parent() - { - return $this->belongsTo('App\GalleryLast', 'parent_id'); - } - - public function children() - { - return $this->hasMany('App\GalleryLast', 'parent_id', 'id'); - } - - public function businessitem() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_item() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_items() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function businessRole($role = 'Gallery') - { - return $this->morphedByMany('App\Business', 'uploadable')->wherePivot('image_role', $role); - } - - public function portfolios() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - - public function portfolio() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - - public function product() - { - return $this->morphedByMany('App\Product', 'uploadable'); - } - - public function frames() - { - return $this->morphedByMany('App\SpUserFrame', 'uploadable'); - } - - public function elements() - { - return $this->morphedByMany('App\SpUserElement', 'uploadable'); - } - - public function business() - { - return $this->belongsTo('App\Business', 'business_id', 'id'); - } - - public function getImageRoleAttribute() - { - return $this->pivot->image_role; - } - -} diff --git a/app/GalleryNew.php b/app/GalleryNew.php deleted file mode 100644 index 9984999..0000000 --- a/app/GalleryNew.php +++ /dev/null @@ -1,90 +0,0 @@ - 'array']; - - public function usages() - { - return $this->hasMany('App\UploadableNew', 'gallery_id', 'id'); - } - - public function roles() - { - return $this->hasMany('App\UploadableNew', 'gallery_id', 'id'); - } - - public function parent() - { - return $this->belongsTo('App\GalleryNew', 'parent_id'); - } - - public function children() - { - return $this->hasMany('App\GalleryNew', 'parent_id', 'id'); - } - - public function businessitem() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_item() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_items() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function businessRole($role = 'Gallery') - { - return $this->morphedByMany('App\Business', 'uploadable')->wherePivot('image_role', $role); - } - - public function portfolios() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - - public function portfolio() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - - public function product() - { - return $this->morphedByMany('App\Product', 'uploadable'); - } - - public function frames() - { - return $this->morphedByMany('App\SpUserFrame', 'uploadable'); - } - - public function elements() - { - return $this->morphedByMany('App\SpUserElement', 'uploadable'); - } - - public function business() - { - return $this->belongsTo('App\Business', 'business_id', 'id'); - } - - public function getImageRoleAttribute() - { - return $this->pivot->image_role; - } - -} diff --git a/app/Gift.php b/app/Gift.php deleted file mode 100644 index 6d9b853..0000000 --- a/app/Gift.php +++ /dev/null @@ -1,14 +0,0 @@ -belongsTo('App\BusinessItem'); - } -} diff --git a/app/Help.php b/app/Help.php deleted file mode 100644 index 0abf1c2..0000000 --- a/app/Help.php +++ /dev/null @@ -1,24 +0,0 @@ -belongsTo('App\HelpCategory','help_category_id'); - } - public function tiny_images() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TinyImages')->where('parent_id', null); - } - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable')->where('parent_id', null); - } -} diff --git a/app/HelpCategory.php b/app/HelpCategory.php deleted file mode 100644 index be15c82..0000000 --- a/app/HelpCategory.php +++ /dev/null @@ -1,16 +0,0 @@ -hasMany('App\Help'); - } -} diff --git a/app/Language.php b/app/Language.php deleted file mode 100644 index 8d409da..0000000 --- a/app/Language.php +++ /dev/null @@ -1,13 +0,0 @@ -hasMany('App\\SpUserTemplate','default_language_id'); - } - -} diff --git a/app/Like.php b/app/Like.php deleted file mode 100644 index d348523..0000000 --- a/app/Like.php +++ /dev/null @@ -1,18 +0,0 @@ -morphTo(); - } - -} diff --git a/app/Message.php b/app/Message.php deleted file mode 100644 index ea539ef..0000000 --- a/app/Message.php +++ /dev/null @@ -1,40 +0,0 @@ -created_at; - $now = $date->now(); - - return $date->diffForHumans($now, true); - } - - - public function conversation() - { - return $this->belongsTo('App\Conversation'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } -} diff --git a/app/News.php b/app/News.php deleted file mode 100644 index c41a453..0000000 --- a/app/News.php +++ /dev/null @@ -1,90 +0,0 @@ -belongsToMany('App\Category'); - return $this->belongsToMany('App\Category', 'category_news', 'news_id', 'category_id'); - - } - - public function user_frames() - { - return $this->morphToMany('App\\SpUserFrame', 'element', 'sp_user_elements'); - } - - public function business() - { - return $this->belongsTo('App\Business'); -// return $this->belongsToMany('App\Category','category_news','news_id','category_id'); - - } - - public function files() - { - return $this->morphMany('App\Upload', 'uploadable')->select('id', 'uploadable_id', 'uploadable_type', 'user_id', 'path'); - } - - - public function gallery() - { - return $this->morphMany('App\Upload', 'uploadable')->where('file_role', 1); - } - - /** - * Get all of the post's comments. - */ - public function comments() - { - return $this->morphMany('App\Comment', 'commentable'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function tiny_images() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TinyImages')->where('parent_id', null); - } - - public function getThumbnailAttribute() - { - if ($this->title_image->isNotEmpty()) { - return $this->title_image->first()->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function setDetailLink($value) - { - $this->linkToDetail = "{$value}/{$this->id}"; - } -} diff --git a/app/Offer.php b/app/Offer.php deleted file mode 100644 index fa5c415..0000000 --- a/app/Offer.php +++ /dev/null @@ -1,19 +0,0 @@ -belongsTo('App\User','proposer_id'); - } - public function business_item_variation() - { - return $this->belongsTo('App\BusinessItemVariation'); - } - -} diff --git a/app/Option.php b/app/Option.php deleted file mode 100644 index fe33ac3..0000000 --- a/app/Option.php +++ /dev/null @@ -1,24 +0,0 @@ -belongsToMany('App\BusinessItem'); - } - - public function values() - { - return $this->hasMany('App\Option', 'parent_id'); - } - -} diff --git a/app/Order.php b/app/Order.php deleted file mode 100644 index 89b0352..0000000 --- a/app/Order.php +++ /dev/null @@ -1,66 +0,0 @@ -belongsTo('App\Address'); - } - - public function buyer () - { - return $this->belongsTo('App\User', 'buyer_id'); - } - - public function business () - { - return $this->belongsTo('App\Business', 'business_id'); - } - - public function transactions () - { - return $this->belongsTo('App\Transaction'); - } - - public function order_items() - { - return $this->hasMany('App\OrderItem'); - } - - public function setStatusLogsAttribute($value) - { - $this->attributes['status_logs'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getStatusLogsAttribute() - { - return json_decode($this->attributes['status_logs']); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - -// public function getCreatedAtAttribute($date) -// { -// return \Morilog\Jalali\jDate::forge($date)->format('datetime'); -// } -} diff --git a/app/OrderItem.php b/app/OrderItem.php deleted file mode 100644 index dfb20a1..0000000 --- a/app/OrderItem.php +++ /dev/null @@ -1,51 +0,0 @@ -belongsTo('App\Auction'); - } - - public function business_item_variation() - { - return $this->belongsTo('App\BusinessItemVariation'); - } - - public function order() - { - return $this->belongsTo('App\Order'); - } - - public function getCreatedAtAttribute($date) - { - return \Morilog\Jalali\jDate::forge($date)->format('datetime'); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - public function getAllPriceAttribute() - { - return $this->attributes['price'] * $this->attributes['quantity']; - } - - public function payable() - { - return $this->morphTo(); - } -} diff --git a/app/Payment.php b/app/Payment.php deleted file mode 100644 index 1c78c7b..0000000 --- a/app/Payment.php +++ /dev/null @@ -1,13 +0,0 @@ -belongsToMany('App\Role'); -// } -} diff --git a/app/Portfolio.php b/app/Portfolio.php deleted file mode 100644 index e2ab95f..0000000 --- a/app/Portfolio.php +++ /dev/null @@ -1,62 +0,0 @@ -belongsTo('App\Business'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function getThumbnailAttribute() - { - if ($this->title_image->isNotEmpty()) { - return $this->title_image->first()->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function setDetailLink($value) - { - $this->linkToDetail = "{$value}/{$this->id}"; - } - -} diff --git a/app/Post.php b/app/Post.php deleted file mode 100644 index aa816d7..0000000 --- a/app/Post.php +++ /dev/null @@ -1,32 +0,0 @@ -belongsTo('App\User'); - } - public function business_item () - { - return $this->belongsTo('App\BusinessItem'); - } - public function product () - { - return $this->belongsTo('App\Product'); - } - public function user_frames() - { - return $this->morphToMany('App\\SpUserFrame', 'element', 'sp_user_elements'); - } - - -} diff --git a/app/Product.php b/app/Product.php deleted file mode 100644 index 6d5b5a1..0000000 --- a/app/Product.php +++ /dev/null @@ -1,98 +0,0 @@ -belongsTo('App\ProductDetail', 'product_detail_id'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable'); - } - - public function feedbacks() - { - return $this->morphMany('App\Feedback', 'feedbackable')->orderBy('updated_at', 'desc'); - } - - - public function brand() - { - return $this->belongsTo('App\Brand'); - } - - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function files() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function likes() - { - return $this->morphMany('App\Like', 'likeable'); - } - - public function toSearchableArray() - { - return [ - 'id' => $this->id, - 'model_en' => $this->model_en, - 'model_fa' => $this->model_fa, - 'description' => $this->description, - 'author_id' => $this->author_id, - 'brand_id' => $this->brand_id, - 'slug' => $this->slug, - 'category_id' => $this->category_id, - ]; - } - - public function special_content_options() - { - return $this->morphMany('App\SpecialContentOption', 'special_content_optionable'); - } -} diff --git a/app/ProductDetail.php b/app/ProductDetail.php deleted file mode 100644 index 70fc3a3..0000000 --- a/app/ProductDetail.php +++ /dev/null @@ -1,16 +0,0 @@ -hasMany( 'App\Product' ); - } -} diff --git a/app/Project.php b/app/Project.php deleted file mode 100644 index ceefb26..0000000 --- a/app/Project.php +++ /dev/null @@ -1,98 +0,0 @@ -belongsToMany('App\User')->wherePivot('type', 'Responsible'); - } - - public function marketer() - { - return $this->belongsToMany('App\User')->wherePivot('type', 'Marketer'); - } - - public function users() - { - return $this->belongsToMany('App\User'); - } - - public function temp_business() - { - return $this->belongsTo('App\TempBusiness', 'temp_business_id', 'id')->select(['id', 'brand_fa', 'brand_en', 'details', 'phones', 'created_at', 'business_id']); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable')->with('user')->select(["id", "text", "commentable_id", "commentable_type", "user_id", "created_at"]); - } - public function Events() - { - return $this->morphMany('App\CrmEvent', 'eventable')->with('user') - ->select(["id", "title", "text", "date", "user_id" ,"property", "created_at"]); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function setSpecialFeaturesAttribute($value) - { - $this->attributes['special_features'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getSpecialFeaturesAttribute() - { - return json_decode($this->attributes['special_features']); - } - - public function setBeginDateAttribute($value) - { - $carbon = new Carbon(); - $date = substr($value, 0, -3); - $date = $carbon->timestamp($date)->timezone('Asia/Tehran')->toDateString(); - $this->attributes['begin_date'] = $date; - } - - public function setEndDateAttribute($value) - { - if (!is_null($value)){ - $carbon = new Carbon(); - $date = substr($value, 0, -3); - $date = $carbon->timestamp($date)->timezone('Asia/Tehran')->toDateString(); - $this->attributes['end_date'] = $date; - }else{ - $this->attributes['end_date'] = $value; - } - } - - // public function getBeginDateAttribute() - // { - // return jdate( $this->attributes['begin_date'])->format('y/m/d').' | '.jdate( $this->attributes['begin_date']) - // ->ago(); - // } - // public function getEndDateAttribute() - // { - // return jdate( $this->attributes['end_date'])->format('y/m/d'); - // } -} diff --git a/app/Promotion.php b/app/Promotion.php deleted file mode 100644 index 00a1746..0000000 --- a/app/Promotion.php +++ /dev/null @@ -1,15 +0,0 @@ -morphToMany('App\Gallery', 'uploadable'); - } - -} diff --git a/app/Reservation.php b/app/Reservation.php deleted file mode 100644 index 11ce2b3..0000000 --- a/app/Reservation.php +++ /dev/null @@ -1,22 +0,0 @@ -belongsTo('App\Business'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - -} diff --git a/app/Role.php b/app/Role.php deleted file mode 100644 index f6533d7..0000000 --- a/app/Role.php +++ /dev/null @@ -1,18 +0,0 @@ -belongsToMany('App\Permission'); -// } - -} diff --git a/app/RollCall.php b/app/RollCall.php deleted file mode 100644 index 2ef6acb..0000000 --- a/app/RollCall.php +++ /dev/null @@ -1,18 +0,0 @@ -attributes['date'])); - } - -} diff --git a/app/Section.php b/app/Section.php deleted file mode 100644 index 7742a6c..0000000 --- a/app/Section.php +++ /dev/null @@ -1,21 +0,0 @@ -hasMany('App\Element'); - } - public function template() -{ - return $this->belongsTo('App\Template'); -} - -} diff --git a/app/ShippingGroup.php b/app/ShippingGroup.php deleted file mode 100644 index 9533f80..0000000 --- a/app/ShippingGroup.php +++ /dev/null @@ -1,26 +0,0 @@ -hasMany('App\ShippingRule'); - } - - public function categories() - { - return $this->belongsToMany('App\Category'); - } - - public function shipping_methods() - { - return $this->belongsToMany('App\ShippingMethod'); - } -} diff --git a/app/ShippingMethod.php b/app/ShippingMethod.php deleted file mode 100644 index 7d664f5..0000000 --- a/app/ShippingMethod.php +++ /dev/null @@ -1,22 +0,0 @@ -belongsToMany('App\ShippingGroup'); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - -} diff --git a/app/ShippingRule.php b/app/ShippingRule.php deleted file mode 100644 index ead1602..0000000 --- a/app/ShippingRule.php +++ /dev/null @@ -1,30 +0,0 @@ -belongsTo('App\ShippingGroup'); - } - - public function getExceptionsAttribute() - { - return json_decode($this->attributes['exceptions']); - } - - public function setExceptionsAttribute($value) - { - if ($value !== null) { - $this->attributes['exceptions'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } else { - $this->attributes['exceptions'] = null; - } - } - -} diff --git a/app/ShoppingCart.php b/app/ShoppingCart.php deleted file mode 100644 index 75bf7f0..0000000 --- a/app/ShoppingCart.php +++ /dev/null @@ -1,48 +0,0 @@ -belongsTo('App\BatchShoppingCart'); - } - public function getDetailsAttribute() - { - return json_decode($this->attributes['details'], true); - } - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - public function business_item_variation() - { - return $this->belongsTo('App\BusinessItemVariation'); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - - public function payable() - { - return $this->morphTo(); - } - -} diff --git a/app/SimpleMessage.php b/app/SimpleMessage.php deleted file mode 100644 index 6b1f336..0000000 --- a/app/SimpleMessage.php +++ /dev/null @@ -1,11 +0,0 @@ -belongsTo('App\SpUserTemplate', 'sp_user_template_id'); - } - - public function site_config() - { - return $this->hasOne('App\SiteConfig'); - } - - public function getSiteConfigDefaultOtherAttribute() - { - if (isset($this->site_config->other)) { - return $this->site_config->other; - } else { - return \App\SiteConfig::whereNull('other')->first()->other; - } - } -} diff --git a/app/SiteConfig.php b/app/SiteConfig.php deleted file mode 100644 index 73487db..0000000 --- a/app/SiteConfig.php +++ /dev/null @@ -1,82 +0,0 @@ -belongsTo('App\Site'); - } - - public function getGatewayDataAttribute() - { - return json_decode($this->attributes['gateway_data']); - } - public function setGatewayDataAttribute($value) - { - $this->attributes['gateway_data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function getSmsAttribute() - { - return json_decode($this->attributes['sms']); - } - public function getENamadDataAttribute() - { - return json_decode($this->attributes['e_namad_data']); - } - public function setENamadDataAttribute($value) - { - $this->attributes['e_namad_data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function setSmsAttribute($value) - { - $this->attributes['sms'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function getSeoAttribute() - { - return json_decode($this->attributes['seo']); - } - public function setSeoAttribute($value) - { - $this->attributes['seo'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function getContactUsAttribute() - { - return json_decode($this->attributes['contact_us']); - } - public function setContactUsAttribute($value) - { - $this->attributes['contact_us'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function getOtherAttribute() - { - $other = json_decode($this->attributes['other']); - $other = ($other) ? $other : collect() ; - - $other->LoginColor = (isset($other->LoginColor)) ? $other->LoginColor : 'Cyan'; - $other->LoginImage = (isset($other->LoginImage)) ? $other->LoginImage : 'WM-WebBuilder/Assets/Images/LoginPage.jpg'; - $other->RegisterationColor = (isset($other->RegisterationColor)) ? $other->RegisterationColor : 'Red'; - $other->SMSValidationColor = (isset($other->SMSValidationColor)) ? $other->SMSValidationColor : 'Orange'; - $other->ForgotPasswordColor = (isset($other->ForgotPasswordColor)) ? $other->ForgotPasswordColor : 'Purple'; - $other->ResetPasswordVerificationColor = (isset($other->ResetPasswordVerificationColor)) ? $other->ResetPasswordVerificationColor : 'Black'; - $other->ResetPasswordColor = (isset($other->ResetPasswordColor)) ? $other->ResetPasswordColor : 'Black'; - $other->ManagementHeaderImg = (isset($other->ManagementHeaderImg)) ? $other->ManagementHeaderImg : 'WM-Main/Assets/Uploads/Backgrounds/Admin-BG1.jpg'; - $other->LoaderAddress = (isset($other->LoaderAddress)) ? $other->LoaderAddress : null; - $other->EmptyShoppingCart = (isset($other->EmptyShoppingCart)) ? $other->EmptyShoppingCart : (object) ['URL' => 'WM-Common/Assets/AnimatedIcons/Flower-Once.gif', 'Class' => '']; - $other->EmptyBusinessItem = (isset($other->EmptyBusinessItem)) ? $other->EmptyBusinessItem : (object) ['URL' => 'WM-Common/Assets/AnimatedIcons/Flower-Once.gif', 'Class' => '']; - return $other; - } - public function setOtherAttribute($value) - { - $this->attributes['other'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } -} diff --git a/app/SmsPanel.php b/app/SmsPanel.php deleted file mode 100644 index ee5019e..0000000 --- a/app/SmsPanel.php +++ /dev/null @@ -1,31 +0,0 @@ -belongsTo('App\User'); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - - public function getTypeFaAttribute() - { - $type = config('WM-Conf.SMSPanelType'); - return isset($type[$this->attributes['type']]) ? $type[$this->attributes['type']] : 'دیگر'; - } - -} diff --git a/app/SocialMedia.php b/app/SocialMedia.php deleted file mode 100644 index fba5908..0000000 --- a/app/SocialMedia.php +++ /dev/null @@ -1,17 +0,0 @@ -hasOne('App\Business'); - } -} - diff --git a/app/SpFacility.php b/app/SpFacility.php deleted file mode 100644 index 5f9fb1a..0000000 --- a/app/SpFacility.php +++ /dev/null @@ -1,24 +0,0 @@ -belongsToMany('App\SpTemplate','facility_template','facility_id','template_id'); - } - - public function user_facilities() - { - return $this->hasMany('App\\SpUserFacility'); - } - - public function facility_type() - { - return $this->belongsTo('App\\SpFacilityType', 'sp_facility_type_id'); - } - -} diff --git a/app/SpFacilityType.php b/app/SpFacilityType.php deleted file mode 100644 index 54d39b9..0000000 --- a/app/SpFacilityType.php +++ /dev/null @@ -1,14 +0,0 @@ -hasMany('App\SpFacility'); - } - -} diff --git a/app/SpFrame.php b/app/SpFrame.php deleted file mode 100644 index fff2f46..0000000 --- a/app/SpFrame.php +++ /dev/null @@ -1,96 +0,0 @@ -belongsTo('App\SpTemplate', 'sp_template_id'); - } - - public function user_pages() - { - return $this->belongsToMany('App\SpUserPage', 'sp_user_frames', 'sp_user_page_id', 'sp_frame_id'); - } - - public function page() - { - return $this->belongsTo('App\SpPage', 'sp_page_id'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function files() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function frame_type() - { - return $this->belongsTo('App\SpFrameType', 'sp_frame_type_id'); - } - - public function getThumbnailAttribute() - { - if ($this->title_image->isNotEmpty()) { - return $this->title_image[0]->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function getTypeAttribute() - { - return $this->frame_type->type; - } - - public function scopeSection($query, $frameTypeId, $masterPageId) - { - return $query->where('sp_page_id', $masterPageId)->where('sp_frame_type_id', $frameTypeId); - } - - public function getFrameInfoAttribute($value) - { - return json_decode($value, true); - } - - public function setFrameInfoAttribute($value) - { - $this->attributes['frame_info'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function users() - { - return $this->belongsToMany('App\User', 'sp_frame_user')->withPivot('action')->withTimestamps(); - } - - public function user_frames() - { - return $this->hasMany('App\\SpUserFrame', 'sp_frame_id'); - } - -} diff --git a/app/SpFrameType.php b/app/SpFrameType.php deleted file mode 100644 index bc47bc7..0000000 --- a/app/SpFrameType.php +++ /dev/null @@ -1,25 +0,0 @@ -belongsTo('App\\SpPageType', 'dependent_page_type_id'); - } - - public function getFrameInfoFormAttribute($value) - { - return json_decode($value, true); - } - - public function setFrameInfoFormAttribute($value) - { - $this->attributes['frame_info_form'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } -} diff --git a/app/SpLink.php b/app/SpLink.php deleted file mode 100644 index fa4fac9..0000000 --- a/app/SpLink.php +++ /dev/null @@ -1,22 +0,0 @@ -morphTo(); - } - - public function page() - { - return $this->belongsTo('App\\SpUserPage', 'page_id'); - } - -} diff --git a/app/SpMasterTemplate.php b/app/SpMasterTemplate.php deleted file mode 100644 index 25c5d8c..0000000 --- a/app/SpMasterTemplate.php +++ /dev/null @@ -1,18 +0,0 @@ -hasMany('App\\SpTemplate'); - } - -} diff --git a/app/SpPage.php b/app/SpPage.php deleted file mode 100644 index 1c3441d..0000000 --- a/app/SpPage.php +++ /dev/null @@ -1,26 +0,0 @@ -belongsTo('App\SpTemplate'); - } - - public function frames() - { - return $this->hasMany('App\SpFrame', 'sp_page_id'); - } - - public function user_pages() - { - return $this->hasMany('App\SpUserPage'); - } - -} diff --git a/app/SpPageType.php b/app/SpPageType.php deleted file mode 100644 index 4a6e352..0000000 --- a/app/SpPageType.php +++ /dev/null @@ -1,16 +0,0 @@ -belongsToMany('App\SpFrameType', 'page_type_has_frame_type', 'sp_page_type_id', 'sp_frame_type_id'); - } - -} diff --git a/app/SpSection.php b/app/SpSection.php deleted file mode 100644 index 6d1253f..0000000 --- a/app/SpSection.php +++ /dev/null @@ -1,31 +0,0 @@ -belongsTo('App\SpPage','sp_page_id','id'); - } - - public function allowed_frames() - { - return $this->hasMany('App\SpFrame','sp_section_id','id'); - } - - public function frames() - { - return $this->belongsToMany('App\SpFrame','sp_user_frames','sp_section_id','sp_frame_id'); - } - - public function user_frames() - { - return $this->hasMany('App\SpUserFrame','sp_section_id','id'); - } - -} diff --git a/app/SpTemplate.php b/app/SpTemplate.php deleted file mode 100644 index b040ef8..0000000 --- a/app/SpTemplate.php +++ /dev/null @@ -1,80 +0,0 @@ -hasMany('App\SpPage'); - } - - public function first_page() - { - return $this->hasOne('App\SpPage'); - } - - public function frames() - { - return $this->hasMany('App\SpFrame'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function user_templates() - { - return $this->hasMany('App\SpUserTemplate'); - } - - - public function facilities() - { - return $this->belongsToMany('App\SpFacility', 'facility_template', 'template_id', 'facility_id'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function files() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function master_template() - { - return $this->belongsTo('App\\SpMasterTemplate', 'sp_master_template_id'); - } - - public function getRtlAttribute($value) { - return json_decode($value, true); - } - - public function getLtrAttribute($value) { - return json_decode($value, true); - } -// public function files() -// { -// return $this->morphToMany('App\Gallery', 'uploadable'); -// } - -} diff --git a/app/SpUserElement.php b/app/SpUserElement.php deleted file mode 100644 index 2f83cf4..0000000 --- a/app/SpUserElement.php +++ /dev/null @@ -1,53 +0,0 @@ -belongsTo('App\BusinessItem', 'element_id')->where('element_type', '=', 'App\BusinessItem'); - } - - public function categories() - { - return $this->belongsTo('App\BusinessItem', 'element_id')->where('element_type', '=', 'App\Category'); - } - - public function userFrame() { - return $this->belongsTo('App\SpUserFrame', 'sp_user_frame_id'); - } - - public function images() { - return $this->morphToMany('App\Gallery', 'uploadable')->withPivot('id', 'image_role'); - } - - public function links() - { - return $this->morphMany('App\SpLink', 'linkable'); - } - - public function getDataAttribute($value) - { - return json_decode($value, true); - } - - public function getLanguageIdAttribute() { - return $this->userFrame->language_id; - } - - public function setDataAttribute($value) - { - $this->attributes['data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - -} diff --git a/app/SpUserFacility.php b/app/SpUserFacility.php deleted file mode 100644 index cf6eff8..0000000 --- a/app/SpUserFacility.php +++ /dev/null @@ -1,21 +0,0 @@ -belongsTo('App\\SpFacility'); - } - - public function user_template() - { - return $this->belongsTo('App\\SpUserTemplate'); - } - -} diff --git a/app/SpUserFrame.php b/app/SpUserFrame.php deleted file mode 100644 index 23cdae0..0000000 --- a/app/SpUserFrame.php +++ /dev/null @@ -1,134 +0,0 @@ -belongsTo('App\\Business'); - } - - public function frame() - { - return $this->belongsTo('App\\SpFrame','sp_frame_id'); - } - - public function parent() - { - return $this->belongsTo('App\\SpUserFrame', 'parent_id'); - } - public function children() - { - return $this->hasMany('App\\SpUserFrame', 'parent_id'); - } - - public function user_pages() - { - return $this->belongsToMany('App\SpUserPage', 'user_page_frame')->withPivot('frame_order'); - } - - public function business_items() - { - return $this->morphedByMany('App\\BusinessItem', 'element', 'sp_user_elements'); - } - public function news() - { - return $this->morphedByMany('App\\News', 'element', 'sp_user_elements'); - } - public function categories() - { - return $this->morphedByMany('App\\Category', 'element', 'sp_user_elements'); - } - public function posts() - { - return $this->morphedByMany('App\\Post', 'element', 'sp_user_elements'); - } - - public function products() - { - return $this->morphedByMany('App\\Product', 'element', 'sp_user_elements'); - } - - public function elements() - { - return $this->hasMany('App\\SpUserElement', 'sp_user_frame_id')->orderBy('element_order'); - } - - public function links() - { - return $this->morphMany('App\SpLink', 'linkable'); - } - - public function images() - { - return $this->morphToMany('App\Gallery','uploadable')->withPivot('image_role'); - } - - public function scopeSection($query, $frameTypeId, $userTemplateId, $masterPageId, $languageId) - { - return $query->where('language_id', $languageId)->where('sp_user_template_id', $userTemplateId) - ->whereHas('frame', function ($q1) use ($frameTypeId, $masterPageId) { - $q1->where('sp_page_id', $masterPageId)->where('sp_frame_type_id', $frameTypeId); - }); - } - - public function language() - { - return $this->belongsTo('App\\Language', 'language_id'); - } - - /******************************************************* - accessors and mutators - *******************************************************/ - - public function getDataAttribute($value) - { - return json_decode($value, true); - } - - public function setDataAttribute($value) - { - $this->attributes['data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getFrameOrderAttribute() - { - return $this->pivot->frame_order; - } - - public function getThumbnailAttribute() - { - if ($this->frame->title_image->isNotEmpty()) { - return $this->frame->title_image[0]->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function getTypeAttribute() - { - return $this->frame->frame_type->type; - } - - public function getNameEnAttribute() - { - return $this->frame->name_en; - } - - public function getNameFaAttribute() - { - return $this->frame->name_fa; - } -} diff --git a/app/SpUserPage.php b/app/SpUserPage.php deleted file mode 100644 index 00e4db2..0000000 --- a/app/SpUserPage.php +++ /dev/null @@ -1,90 +0,0 @@ -belongsTo('App\SpUserTemplate','sp_user_template_id'); - - } - - - - public function page() - - { - - return $this->belongsTo('App\SpPage', 'sp_page_id'); - - } - - - public function frames() - { - return $this->belongsToMany('App\SpFrame','sp_user_frames'); - } - - - - public function user_frames() - - { - - return $this->belongsToMany('App\SpUserFrame', 'user_page_frame')->withPivot('frame_order'); - - } - - - - public function business() - - { - - return $this->belongsTo('App\Business'); - - } - - public function page_type() - { - - return $this->belongsTo('App\SpPageType', 'sp_page_type_id'); - - } - - public function language() - { - - return $this->belongsTo('App\Language', 'language_id'); - - } - - public function scopePageType($query, $templateId, $languageId, $pageResponsibility, $pageType = '') - { - - return $query->select('id', 'name_en', 'name_fa', 'sp_page_type_id', 'description') - ->where('sp_user_template_id', $templateId) - ->where('language_id', $languageId) - ->whereHas('page_type', function($q) use ($pageType, $pageResponsibility) { - $q->where('responsibility', $pageResponsibility)->where('type', $pageType); - }); - - } - -} diff --git a/app/SpUserTemplate.php b/app/SpUserTemplate.php deleted file mode 100644 index 9b8005f..0000000 --- a/app/SpUserTemplate.php +++ /dev/null @@ -1,78 +0,0 @@ -belongsTo('App\SpUserTemplate', 'parent_id'); - } - public function children() - { - return $this->hasMany('App\SpUserTemplate', 'parent_id'); - } - - public function template() - { - return $this->belongsTo('App\SpTemplate', 'sp_template_id'); - } - - public function pages() - { - return $this->belongsToMany('App\SpPage','sp_user_pages'); - } - - public function user_pages() - { - return $this->hasMany('App\SpUserPage'); - } - - public function home_page() - { - return $this->hasOne('App\SpUserPage')->where('name_en', 'Home'); - } - - public function business() - { - return $this->belongsTo('WM\\Core\\Models\\VirtualActivity'); - } - - public function user_facilities() - { - return $this->hasMany('App\SpUserFacility'); - } - - public function facilities() - { - return $this->belongsToMany('App\\SpFacility', 'sp_user_facilities', 'sp_user_template_id', 'sp_facility_id'); - } - - - public function images() { - return $this->morphToMany( 'App\Gallery', 'uploadable' ); - } - - public function title_image() { - return $this->morphToMany( 'App\Gallery', 'uploadable' )->wherePivot( 'image_role', 'TitleImage' )->where('parent_id', null);; - } - - public function gallery() { - return $this->morphToMany( 'App\Gallery', 'uploadable' )->wherePivot( 'image_role', 'Gallery' )->where('parent_id', null);; - } - public function language() - { - return $this->belongsTo('App\Language', 'default_language_id'); - } - public function sites() - { - return $this->hasMany('App\Site'); - } - -} diff --git a/app/SpecialContent.php b/app/SpecialContent.php deleted file mode 100644 index d901769..0000000 --- a/app/SpecialContent.php +++ /dev/null @@ -1,20 +0,0 @@ -hasMany('App\SpecialContentOption', 'special_content_id'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } -} diff --git a/app/SpecialContentOption.php b/app/SpecialContentOption.php deleted file mode 100644 index 1ac9e96..0000000 --- a/app/SpecialContentOption.php +++ /dev/null @@ -1,56 +0,0 @@ -belongsTo('App\SpecialContent'); - } - // public function getDetailsAttribute() - // { - // return json_decode($this->attributes['details']); - // } - // public function setDetailsAttribute($value) - // { - // $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - // } - - public function optionable() - { - return $this->morphTo(); - } - - public function files() - { - return $this->morphMany('App\Upload', 'uploadable')->select('id', 'uploadable_id', 'uploadable_type', 'user_id', 'path'); - } - - public function gallery() - { - return $this->morphMany('App\Upload', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - -} diff --git a/app/Staff.php b/app/Staff.php deleted file mode 100644 index caf14ed..0000000 --- a/app/Staff.php +++ /dev/null @@ -1,19 +0,0 @@ -hasMany('App\RollCall'); - } - -} diff --git a/app/Strategy.php b/app/Strategy.php deleted file mode 100644 index 7c3d3c9..0000000 --- a/app/Strategy.php +++ /dev/null @@ -1,24 +0,0 @@ -belongsTo('App\Category'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - -} diff --git a/app/Tag.php b/app/Tag.php deleted file mode 100644 index ee9b01f..0000000 --- a/app/Tag.php +++ /dev/null @@ -1,47 +0,0 @@ -morphedByMany('App\Business', 'taggable'); - } - - public function business_items() - { - return $this->morphedByMany('App\BusinessItem', 'taggable'); - } - - public function products() - { - return $this->morphedByMany('App\Product', 'taggable'); - } - - public function news() - { - return $this->morphedByMany('App\News', 'taggable'); - } - - public function events() - { - return $this->morphedByMany('App\Event', 'taggable'); - } - - public function toSearchableArray() - { - return [ - 'id' => $this->id, - 'name' => $this->name, - ]; - } -} diff --git a/app/TagGroup.php b/app/TagGroup.php deleted file mode 100644 index 63e780e..0000000 --- a/app/TagGroup.php +++ /dev/null @@ -1,23 +0,0 @@ -taggingUtility->tagModelString(); - return $this->hasMany($model, 'tag_group_id'); - } - -} diff --git a/app/Task.php b/app/Task.php deleted file mode 100644 index f8feaa5..0000000 --- a/app/Task.php +++ /dev/null @@ -1,78 +0,0 @@ -attributes['activity'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function setDateAttribute($value) - { - $carbon = new Carbon(); - $this->attributes['date'] = $carbon->timestamp($value)->timezone('Asia/Tehran')->toDateTimeString(); - } - - - public function finances() - { - return $this->morphMany('App\Finance', 'financable'); - } - - public function uploadables() - { - return $this->morphMany('App\Uploadable', 'uploadable'); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null);; - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function logo() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'logo')->where('parent_id', null);; - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - public function owner() - { - return $this->belongsTo('App\User', 'owned_id'); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable')->orderBy('updated_at', 'desc'); - } - - public function taskable() - { - return $this->morphTo(); - } -} diff --git a/app/TempBusiness.php b/app/TempBusiness.php deleted file mode 100644 index e03448e..0000000 --- a/app/TempBusiness.php +++ /dev/null @@ -1,76 +0,0 @@ -attributes['details']); - } - - public function getPhonesAttribute() - { - return json_decode($this->attributes['phones']); - } - - public function addresses() - { - return $this->morphMany('App\Address', 'addressable'); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable')->orderBy('updated_at', 'desc'); - } - - public function categories() - { - return $this->belongsToMany('App\Category'); - } - - public function uploadables() - { - return $this->morphMany('App\Uploadable', 'uploadable'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function logo() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'logo')->where('parent_id', null);; - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - - public function tasks() - { - return $this->morphMany('App\Task', 'taskable'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - public function marketer() - { - return $this->belongsTo('App\User','marketer_id'); - } -} diff --git a/app/Transaction.php b/app/Transaction.php deleted file mode 100644 index 6dce3a7..0000000 --- a/app/Transaction.php +++ /dev/null @@ -1,32 +0,0 @@ -hasMany('App\Order', 'transaction_id'); - } - - public function order() - { - return $this->hasOne('App\Order', 'transaction_id'); - } - - public function user_transaction() - { - return $this->hasMany('App\UserTransaction', 'transaction_id'); - } - - public function transaction_logs() - { - return $this->hasMany('App\TransactionLog'); - } - -} diff --git a/app/TransactionLog.php b/app/TransactionLog.php deleted file mode 100644 index db94ec8..0000000 --- a/app/TransactionLog.php +++ /dev/null @@ -1,18 +0,0 @@ -belongsTo('App\Transaction'); - } - -} diff --git a/app/Upload.php b/app/Upload.php deleted file mode 100644 index 4340e9a..0000000 --- a/app/Upload.php +++ /dev/null @@ -1,24 +0,0 @@ -morphTo(); - } - - public function creator () - { - return $this->belongsTo('App\User'); - } - -} diff --git a/app/Uploadable.php b/app/Uploadable.php deleted file mode 100644 index d12b69c..0000000 --- a/app/Uploadable.php +++ /dev/null @@ -1,26 +0,0 @@ -belongsTo('App\Gallery')->where('parent_id' , null); - } - public function ThumbGallery() - { - return $this->belongsTo('App\Gallery')->where('parent_id' , '!=' , null); - } - public function gallery() - { - return $this->belongsTo('App\Gallery'); - } - -} diff --git a/app/UploadableLast.php b/app/UploadableLast.php deleted file mode 100644 index 91c8dcc..0000000 --- a/app/UploadableLast.php +++ /dev/null @@ -1,26 +0,0 @@ -belongsTo('App\GalleryLast')->where('parent_id' , null); - } - public function ThumbGallery() - { - return $this->belongsTo('App\GalleryLast')->where('parent_id' , '!=' , null); - } - public function gallery() - { - return $this->belongsTo('App\GalleryLast'); - } - -} diff --git a/app/UploadableNew.php b/app/UploadableNew.php deleted file mode 100644 index e207d57..0000000 --- a/app/UploadableNew.php +++ /dev/null @@ -1,26 +0,0 @@ -belongsTo('App\GalleryNew')->where('parent_id' , null); - } - public function ThumbGallery() - { - return $this->belongsTo('App\GalleryNew')->where('parent_id' , '!=' , null); - } - public function gallery() - { - return $this->belongsTo('App\GalleryNew'); - } - -} diff --git a/app/User.php b/app/User.php deleted file mode 100644 index 65f21a0..0000000 --- a/app/User.php +++ /dev/null @@ -1,210 +0,0 @@ -primaryKey; - // - // return Cache::remember($cacheKey, 10, function () { - // return $this->roles()->get(); - // }*/ - // return $this->roles()->get(); - // - // } - // - public function canDo($permission, $requireAll = false) - { - if (is_array($permission)) { - foreach ($permission as $permName) { - $hasPerm = $this->canDo($permName); - if ($hasPerm && !$requireAll) { - return true; - } elseif (!$hasPerm && $requireAll) { - return false; - } - } - - return $requireAll; - } else { - foreach ($this->cachedRoles() as $role) { - // Validate against the Permission table - foreach ($role->cachedPermissions() as $perm) { - if (strtolower($permission) == strtolower($perm->title)) { - return true; - } - } - } - } - return false; - } - // - // public function hasRole($name) - // { - // foreach ($this->roles()->get() as $role) - // { - // if (strtolower($role->title)===strtolower($name)) - // { - // return true; - // } - // } - // return false; - // } - -/////////////////////////////////////////////////////////////////// - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function offers() - { - return $this->hasMany('App\Offer'); - } - - public function shopping_carts() - { - return $this->hasMany('App\ShoppingCart'); - } - - public function businesses() - { - return $this->hasMany('App\Business'); - } - - public function business_items() - { - return $this->hasMany('App\BusinessItem'); - } - - public function feedbacks() - { - return $this->hasMany('App\Feedback'); - } - - - public function active_business() - { - return $this->belongsTo('App\Business', 'last_used_business'); - } - - public function buys() - { - return $this->hasMany('App\Order', 'buyer_id'); - } - - public function sells() - { - return $this->hasMany('App\Order', 'seller_id'); - } - - public function files() - { - return $this->hasMany('App\Gallery')->where('business_id', null); - } - - public function orginalProfile() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Profile')->where('parent_id', null); - } - - public function Profile() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Profile')->where('parent_id', null); - } - - public function addresses() - { - return $this->morphMany('App\Address', 'addressable'); - } - - public function introducer() - { - return $this->belongsTo('App\User', 'introducer_id', 'id'); - } - - public function send_conversations() - { - return $this->hasMany('App\Conversation', 'sender_id'); - } - - public function recieve_conversations() - { - return $this->hasMany('App\Conversation', 'receiver_id'); - } - - public function reservations() - { - return $this->hasMany('App\Reservation'); - } - - public function likes() - { - return $this->hasMany('App\Like'); - } -// public function files() -// { -// return $this->hasMany() -// } - public static function MakeDetail(){ - return json_encode (['NationalCode' , 'ParentName' , 'Educational' , 'PlaceBirth']); - } - public function setBirthdayAttribute($value) - { - $carbon = new Carbon(); - $date = substr($value, 0, -3); - $date = $carbon->timestamp($date)->timezone('Asia/Tehran')->toDateString(); - $this->attributes['birthday'] = $date; - } - - public function frames() - { - return $this->belongsToMany('App\\SpFrame', 'sp_frame_user')->withPivot('action')->withTimestamps(); - } -} diff --git a/app/UserTransaction.php b/app/UserTransaction.php deleted file mode 100644 index 1078940..0000000 --- a/app/UserTransaction.php +++ /dev/null @@ -1,19 +0,0 @@ -belongsTo('App\Transaction','transaction_id','id'); - } - - public function order() - { -// return $this - } -} \ No newline at end of file diff --git a/app/WmItem.php b/app/WmItem.php deleted file mode 100644 index 1c281a4..0000000 --- a/app/WmItem.php +++ /dev/null @@ -1,40 +0,0 @@ -morphMany('App\ShoppingCart', 'payable'); - } - - public function WmItemsCategory() - { - return $this->belongsTo('App\WmItemsCategory'); - } - - public function getDetailsAttribute($value) - { - return json_decode($value); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getPivotDetailsAttribute() - { - return json_decode($this->pivot->details); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - -} diff --git a/app/WmItemsCategory.php b/app/WmItemsCategory.php deleted file mode 100644 index e8a7aa8..0000000 --- a/app/WmItemsCategory.php +++ /dev/null @@ -1,25 +0,0 @@ -hasMany('App\WmItem'); - } - - public function getDetailsAttribute($value) - { - return json_decode($value); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - -} diff --git a/app/WmPackage.php b/app/WmPackage.php deleted file mode 100644 index 16e10bd..0000000 --- a/app/WmPackage.php +++ /dev/null @@ -1,24 +0,0 @@ -belongsToMany('App\WmItem')->withPivot('quantity','details'); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - -} diff --git a/composer.json b/composer.json index 53224d4..3c59624 100755 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ "laravel/passport": "^7.3", "laravel/tinker": "^1.0", "wm/common": "dev-master", + "wm/core": "dev-master", "wm/crm": "dev-master", "wm/reservation": "dev-master" }, diff --git a/composer.lock b/composer.lock index 2314880..acd9a80 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bf04db5e846207e0d63b65a4f6f13d0c", + "content-hash": "749057a96bf87d2a7b15a2b9aa64e371", "packages": [ { "name": "defuse/php-encryption", @@ -391,25 +391,25 @@ }, { "name": "fideloper/proxy", - "version": "4.2.0", + "version": "4.2.1", "source": { "type": "git", "url": "https://github.com/fideloper/TrustedProxy.git", - "reference": "39a4c2165e578bc771f5dc031c273210a3a9b6d2" + "reference": "03085e58ec7bee24773fa5a8850751a6e61a7e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/39a4c2165e578bc771f5dc031c273210a3a9b6d2", - "reference": "39a4c2165e578bc771f5dc031c273210a3a9b6d2", + "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/03085e58ec7bee24773fa5a8850751a6e61a7e8a", + "reference": "03085e58ec7bee24773fa5a8850751a6e61a7e8a", "shasum": "" }, "require": { - "illuminate/contracts": "~5.0|~6.0", + "illuminate/contracts": "^5.0|^6.0|^7.0", "php": ">=5.4.0" }, "require-dev": { - "illuminate/http": "~5.6|~6.0", - "mockery/mockery": "~1.0", + "illuminate/http": "^5.0|^6.0|^7.0", + "mockery/mockery": "^1.0", "phpunit/phpunit": "^6.0" }, "type": "library", @@ -441,7 +441,7 @@ "proxy", "trusted proxy" ], - "time": "2019-07-29T16:49:45+00:00" + "time": "2019-09-03T16:45:42+00:00" }, { "name": "firebase/php-jwt", @@ -825,16 +825,16 @@ }, { "name": "laravel/framework", - "version": "v5.8.33", + "version": "v5.8.35", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "58b81842cbdcfbbd8302790ac0f98119ea1c56e5" + "reference": "5a9e4d241a8b815e16c9d2151e908992c38db197" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/58b81842cbdcfbbd8302790ac0f98119ea1c56e5", - "reference": "58b81842cbdcfbbd8302790ac0f98119ea1c56e5", + "url": "https://api.github.com/repos/laravel/framework/zipball/5a9e4d241a8b815e16c9d2151e908992c38db197", + "reference": "5a9e4d241a8b815e16c9d2151e908992c38db197", "shasum": "" }, "require": { @@ -917,6 +917,7 @@ "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (^3.0).", "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).", + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", "ext-pcntl": "Required to use all features of the queue worker.", "ext-posix": "Required to use all features of the queue worker.", "filp/whoops": "Required for friendly error pages in development (^2.1.4).", @@ -968,7 +969,7 @@ "framework", "laravel" ], - "time": "2019-08-20T15:45:17+00:00" + "time": "2019-09-03T16:44:30+00:00" }, { "name": "laravel/passport", @@ -1211,16 +1212,16 @@ }, { "name": "league/flysystem", - "version": "1.0.54", + "version": "1.0.55", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "c681ed22508947a941f113d6cf51bdcf4b84faf9" + "reference": "33c91155537c6dc899eacdc54a13ac6303f156e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/c681ed22508947a941f113d6cf51bdcf4b84faf9", - "reference": "c681ed22508947a941f113d6cf51bdcf4b84faf9", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/33c91155537c6dc899eacdc54a13ac6303f156e6", + "reference": "33c91155537c6dc899eacdc54a13ac6303f156e6", "shasum": "" }, "require": { @@ -1291,7 +1292,7 @@ "sftp", "storage" ], - "time": "2019-08-23T21:50:05+00:00" + "time": "2019-08-24T11:17:19+00:00" }, { "name": "league/oauth2-server", @@ -1372,16 +1373,16 @@ }, { "name": "monolog/monolog", - "version": "1.24.0", + "version": "1.25.1", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" + "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/70e65a5470a42cfec1a7da00d30edb6e617e8dcf", + "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf", "shasum": "" }, "require": { @@ -1446,20 +1447,20 @@ "logging", "psr-3" ], - "time": "2018-11-05T09:00:11+00:00" + "time": "2019-09-06T13:49:17+00:00" }, { "name": "nesbot/carbon", - "version": "2.23.1", + "version": "2.24.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "767617a047e5b8b8b3b0b6023a2650847ed7df02" + "reference": "934459c5ac0658bc765ad1e53512c7c77adcac29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/767617a047e5b8b8b3b0b6023a2650847ed7df02", - "reference": "767617a047e5b8b8b3b0b6023a2650847ed7df02", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/934459c5ac0658bc765ad1e53512c7c77adcac29", + "reference": "934459c5ac0658bc765ad1e53512c7c77adcac29", "shasum": "" }, "require": { @@ -1513,20 +1514,20 @@ "datetime", "time" ], - "time": "2019-08-17T13:57:34+00:00" + "time": "2019-08-31T16:37:55+00:00" }, { "name": "nikic/php-parser", - "version": "v4.2.3", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "e612609022e935f3d0337c1295176505b41188c8" + "reference": "97e59c7a16464196a8b9c77c47df68e4a39a45c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e612609022e935f3d0337c1295176505b41188c8", - "reference": "e612609022e935f3d0337c1295176505b41188c8", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/97e59c7a16464196a8b9c77c47df68e4a39a45c4", + "reference": "97e59c7a16464196a8b9c77c47df68e4a39a45c4", "shasum": "" }, "require": { @@ -1564,20 +1565,20 @@ "parser", "php" ], - "time": "2019-08-12T20:17:41+00:00" + "time": "2019-09-01T07:51:21+00:00" }, { "name": "opis/closure", - "version": "3.3.1", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "92927e26d7fc3f271efe1f55bdbb073fbb2f0722" + "reference": "60a97fff133b1669a5b1776aa8ab06db3f3962b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/92927e26d7fc3f271efe1f55bdbb073fbb2f0722", - "reference": "92927e26d7fc3f271efe1f55bdbb073fbb2f0722", + "url": "https://api.github.com/repos/opis/closure/zipball/60a97fff133b1669a5b1776aa8ab06db3f3962b7", + "reference": "60a97fff133b1669a5b1776aa8ab06db3f3962b7", "shasum": "" }, "require": { @@ -1625,7 +1626,7 @@ "serialization", "serialize" ], - "time": "2019-07-09T21:58:11+00:00" + "time": "2019-09-02T21:07:33+00:00" }, { "name": "paragonie/random_compat", @@ -2320,16 +2321,16 @@ }, { "name": "symfony/console", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9" + "reference": "de63799239b3881b8a08f8481b22348f77ed7b36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9", - "reference": "8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9", + "url": "https://api.github.com/repos/symfony/console/zipball/de63799239b3881b8a08f8481b22348f77ed7b36", + "reference": "de63799239b3881b8a08f8481b22348f77ed7b36", "shasum": "" }, "require": { @@ -2391,20 +2392,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-07-24T17:13:59+00:00" + "time": "2019-08-26T08:26:39+00:00" }, { "name": "symfony/css-selector", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "105c98bb0c5d8635bea056135304bd8edcc42b4d" + "reference": "c6e5e2a00db768c92c3ae131532af4e1acc7bd03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/105c98bb0c5d8635bea056135304bd8edcc42b4d", - "reference": "105c98bb0c5d8635bea056135304bd8edcc42b4d", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/c6e5e2a00db768c92c3ae131532af4e1acc7bd03", + "reference": "c6e5e2a00db768c92c3ae131532af4e1acc7bd03", "shasum": "" }, "require": { @@ -2444,20 +2445,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-01-16T21:53:39+00:00" + "time": "2019-08-20T14:07:54+00:00" }, { "name": "symfony/debug", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "527887c3858a2462b0137662c74837288b998ee3" + "reference": "afcdea44a2e399c1e4b52246ec8d54c715393ced" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/527887c3858a2462b0137662c74837288b998ee3", - "reference": "527887c3858a2462b0137662c74837288b998ee3", + "url": "https://api.github.com/repos/symfony/debug/zipball/afcdea44a2e399c1e4b52246ec8d54c715393ced", + "reference": "afcdea44a2e399c1e4b52246ec8d54c715393ced", "shasum": "" }, "require": { @@ -2500,20 +2501,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-07-23T11:21:36+00:00" + "time": "2019-08-20T14:27:59+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "212b020949331b6531250584531363844b34a94e" + "reference": "429d0a1451d4c9c4abe1959b2986b88794b9b7d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/212b020949331b6531250584531363844b34a94e", - "reference": "212b020949331b6531250584531363844b34a94e", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/429d0a1451d4c9c4abe1959b2986b88794b9b7d2", + "reference": "429d0a1451d4c9c4abe1959b2986b88794b9b7d2", "shasum": "" }, "require": { @@ -2570,7 +2571,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-06-27T06:42:14+00:00" + "time": "2019-08-26T08:55:16+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2632,16 +2633,16 @@ }, { "name": "symfony/finder", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2" + "reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9638d41e3729459860bb96f6247ccb61faaa45f2", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2", + "url": "https://api.github.com/repos/symfony/finder/zipball/86c1c929f0a4b24812e1eb109262fc3372c8e9f2", + "reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2", "shasum": "" }, "require": { @@ -2677,20 +2678,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-06-28T13:16:30+00:00" + "time": "2019-08-14T12:26:46+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "8b778ee0c27731105fbf1535f51793ad1ae0ba2b" + "reference": "d804bea118ff340a12e22a79f9c7e7eb56b35adc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/8b778ee0c27731105fbf1535f51793ad1ae0ba2b", - "reference": "8b778ee0c27731105fbf1535f51793ad1ae0ba2b", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d804bea118ff340a12e22a79f9c7e7eb56b35adc", + "reference": "d804bea118ff340a12e22a79f9c7e7eb56b35adc", "shasum": "" }, "require": { @@ -2732,20 +2733,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-07-23T11:21:36+00:00" + "time": "2019-08-26T08:55:16+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "a414548d236ddd8fa3df52367d583e82339c5e95" + "reference": "5e0fc71be03d52cd00c423061cfd300bd6f92a52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/a414548d236ddd8fa3df52367d583e82339c5e95", - "reference": "a414548d236ddd8fa3df52367d583e82339c5e95", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/5e0fc71be03d52cd00c423061cfd300bd6f92a52", + "reference": "5e0fc71be03d52cd00c423061cfd300bd6f92a52", "shasum": "" }, "require": { @@ -2824,20 +2825,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2019-07-28T07:10:23+00:00" + "time": "2019-08-26T16:47:42+00:00" }, { "name": "symfony/mime", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "6b7148029b1dd5eda1502064f06d01357b7b2d8b" + "reference": "987a05df1c6ac259b34008b932551353f4f408df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/6b7148029b1dd5eda1502064f06d01357b7b2d8b", - "reference": "6b7148029b1dd5eda1502064f06d01357b7b2d8b", + "url": "https://api.github.com/repos/symfony/mime/zipball/987a05df1c6ac259b34008b932551353f4f408df", + "reference": "987a05df1c6ac259b34008b932551353f4f408df", "shasum": "" }, "require": { @@ -2846,7 +2847,7 @@ "symfony/polyfill-mbstring": "^1.0" }, "require-dev": { - "egulias/email-validator": "^2.0", + "egulias/email-validator": "^2.1.10", "symfony/dependency-injection": "~3.4|^4.1" }, "type": "library", @@ -2883,7 +2884,7 @@ "mime", "mime-type" ], - "time": "2019-07-19T16:21:19+00:00" + "time": "2019-08-22T08:16:11+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3238,16 +3239,16 @@ }, { "name": "symfony/process", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c" + "reference": "e89969c00d762349f078db1128506f7f3dcc0d4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/856d35814cf287480465bb7a6c413bb7f5f5e69c", - "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c", + "url": "https://api.github.com/repos/symfony/process/zipball/e89969c00d762349f078db1128506f7f3dcc0d4a", + "reference": "e89969c00d762349f078db1128506f7f3dcc0d4a", "shasum": "" }, "require": { @@ -3283,7 +3284,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-05-30T16:10:05+00:00" + "time": "2019-08-26T08:26:39+00:00" }, { "name": "symfony/psr-http-message-bridge", @@ -3352,16 +3353,16 @@ }, { "name": "symfony/routing", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "a88c47a5861549f5dc1197660818084c3b67d773" + "reference": "ff1049f6232dc5b6023b1ff1c6de56f82bcd264f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/a88c47a5861549f5dc1197660818084c3b67d773", - "reference": "a88c47a5861549f5dc1197660818084c3b67d773", + "url": "https://api.github.com/repos/symfony/routing/zipball/ff1049f6232dc5b6023b1ff1c6de56f82bcd264f", + "reference": "ff1049f6232dc5b6023b1ff1c6de56f82bcd264f", "shasum": "" }, "require": { @@ -3424,20 +3425,20 @@ "uri", "url" ], - "time": "2019-07-23T14:43:56+00:00" + "time": "2019-08-26T08:26:39+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.5", + "version": "v1.1.6", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d" + "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d", - "reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ea7263d6b6d5f798b56a45a5b8d686725f2719a3", + "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3", "shasum": "" }, "require": { @@ -3482,26 +3483,26 @@ "interoperability", "standards" ], - "time": "2019-06-13T11:15:36+00:00" + "time": "2019-08-20T14:44:19+00:00" }, { "name": "symfony/translation", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "4e3e39cc485304f807622bdc64938e4633396406" + "reference": "28498169dd334095fa981827992f3a24d50fed0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/4e3e39cc485304f807622bdc64938e4633396406", - "reference": "4e3e39cc485304f807622bdc64938e4633396406", + "url": "https://api.github.com/repos/symfony/translation/zipball/28498169dd334095fa981827992f3a24d50fed0f", + "reference": "28498169dd334095fa981827992f3a24d50fed0f", "shasum": "" }, "require": { "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^1.1.2" + "symfony/translation-contracts": "^1.1.6" }, "conflict": { "symfony/config": "<3.4", @@ -3558,20 +3559,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2019-07-18T10:34:59+00:00" + "time": "2019-08-26T08:55:16+00:00" }, { "name": "symfony/translation-contracts", - "version": "v1.1.5", + "version": "v1.1.6", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "cb4b18ad7b92a26e83b65dde940fab78339e6f3c" + "reference": "325b17c24f3ee23cbecfa63ba809c6d89b5fa04a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/cb4b18ad7b92a26e83b65dde940fab78339e6f3c", - "reference": "cb4b18ad7b92a26e83b65dde940fab78339e6f3c", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/325b17c24f3ee23cbecfa63ba809c6d89b5fa04a", + "reference": "325b17c24f3ee23cbecfa63ba809c6d89b5fa04a", "shasum": "" }, "require": { @@ -3615,20 +3616,20 @@ "interoperability", "standards" ], - "time": "2019-06-13T11:15:36+00:00" + "time": "2019-08-02T12:15:04+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e4110b992d2cbe198d7d3b244d079c1c58761d07" + "reference": "641043e0f3e615990a0f29479f9c117e8a6698c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e4110b992d2cbe198d7d3b244d079c1c58761d07", - "reference": "e4110b992d2cbe198d7d3b244d079c1c58761d07", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/641043e0f3e615990a0f29479f9c117e8a6698c6", + "reference": "641043e0f3e615990a0f29479f9c117e8a6698c6", "shasum": "" }, "require": { @@ -3691,7 +3692,7 @@ "debug", "dump" ], - "time": "2019-07-27T06:42:46+00:00" + "time": "2019-08-26T08:26:39+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -3742,16 +3743,16 @@ }, { "name": "vlucas/phpdotenv", - "version": "v3.4.0", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "5084b23845c24dbff8ac6c204290c341e4776c92" + "reference": "95cb0fa6c025f7f0db7fc60f81e9fb231eb2d222" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/5084b23845c24dbff8ac6c204290c341e4776c92", - "reference": "5084b23845c24dbff8ac6c204290c341e4776c92", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/95cb0fa6c025f7f0db7fc60f81e9fb231eb2d222", + "reference": "95cb0fa6c025f7f0db7fc60f81e9fb231eb2d222", "shasum": "" }, "require": { @@ -3765,7 +3766,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.5-dev" } }, "autoload": { @@ -3778,10 +3779,15 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "homepage": "https://gjcampbell.co.uk/" + }, { "name": "Vance Lucas", "email": "vance@vancelucas.com", - "homepage": "http://www.vancelucas.com" + "homepage": "https://vancelucas.com/" } ], "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", @@ -3790,7 +3796,7 @@ "env", "environment" ], - "time": "2019-06-15T22:40:20+00:00" + "time": "2019-08-27T17:00:38+00:00" }, { "name": "wm/common", @@ -3798,7 +3804,7 @@ "dist": { "type": "path", "url": "./modules/wm-common", - "reference": "6c182b87de234466a6950ac24cc9afaca524c570", + "reference": "02182c4005bfb0a1ddfe505b61b20cc40983ca0c", "shasum": null }, "require": { @@ -3821,7 +3827,11 @@ "autoload": { "psr-4": { "WM\\Common\\": "src/" - } + }, + "classmap": [ + "database/seeds", + "database/factories" + ] }, "autoload-dev": { "psr-4": { @@ -3839,7 +3849,7 @@ "dist": { "type": "path", "url": "./modules/wm-core", - "reference": "a9dcd537a7f3d2bb8b86e7c6a144bd0c4e8d10c9", + "reference": "7dde2817a09c7ee79527bde3eb2e64f833cf9535", "shasum": null }, "require": { @@ -3884,7 +3894,7 @@ "dist": { "type": "path", "url": "./modules/wm-crm", - "reference": "234a0d2b3ccb4aad7cb9d0c7981705c2e70ec2d0", + "reference": "997e15bf31c75652bd783eb13ebed07d3be7abea", "shasum": null }, "require": { @@ -3908,7 +3918,11 @@ "autoload": { "psr-4": { "WM\\CRM\\": "src/" - } + }, + "classmap": [ + "database/seeds", + "database/factories" + ] }, "autoload-dev": { "psr-4": { @@ -5796,6 +5810,7 @@ "minimum-stability": "dev", "stability-flags": { "wm/common": 20, + "wm/core": 20, "wm/crm": 20, "wm/reservation": 20 }, diff --git a/config/modules.php b/config/modules.php deleted file mode 100644 index 4432f45..0000000 --- a/config/modules.php +++ /dev/null @@ -1,188 +0,0 @@ - 'Modules', - - /* - |-------------------------------------------------------------------------- - | Module Stubs - |-------------------------------------------------------------------------- - | - | Default module stubs. - | - */ - - 'stubs' => [ - 'enabled' => false, - 'path' => base_path() . '/vendor/nwidart/laravel-modules/src/Commands/stubs', - 'files' => [ - 'routes/web' => 'Routes/web.php', - 'routes/api' => 'Routes/api.php', - 'views/index' => 'Resources/views/index.blade.php', - 'views/master' => 'Resources/views/layouts/master.blade.php', - 'scaffold/config' => 'Config/config.php', - 'composer' => 'composer.json', - 'assets/js/app' => 'Resources/assets/js/app.js', - 'assets/sass/app' => 'Resources/assets/sass/app.scss', - 'webpack' => 'webpack.mix.js', - 'package' => 'package.json', - ], - 'replacements' => [ - 'routes/web' => ['LOWER_NAME', 'STUDLY_NAME'], - 'routes/api' => ['LOWER_NAME'], - 'webpack' => ['LOWER_NAME'], - 'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'], - 'views/index' => ['LOWER_NAME'], - 'views/master' => ['LOWER_NAME', 'STUDLY_NAME'], - 'scaffold/config' => ['STUDLY_NAME'], - 'composer' => [ - 'LOWER_NAME', - 'STUDLY_NAME', - 'VENDOR', - 'AUTHOR_NAME', - 'AUTHOR_EMAIL', - 'MODULE_NAMESPACE', - ], - ], - 'gitkeep' => true, - ], - 'paths' => [ - /* - |-------------------------------------------------------------------------- - | Modules path - |-------------------------------------------------------------------------- - | - | This path used for save the generated module. This path also will be added - | automatically to list of scanned folders. - | - */ - - 'modules' => base_path('Modules'), - /* - |-------------------------------------------------------------------------- - | Modules assets path - |-------------------------------------------------------------------------- - | - | Here you may update the modules assets path. - | - */ - - 'assets' => public_path('modules'), - /* - |-------------------------------------------------------------------------- - | The migrations path - |-------------------------------------------------------------------------- - | - | Where you run 'module:publish-migration' command, where do you publish the - | the migration files? - | - */ - - 'migration' => base_path('database/migrations'), - /* - |-------------------------------------------------------------------------- - | Generator path - |-------------------------------------------------------------------------- - | Customise the paths where the folders will be generated. - | Set the generate key to false to not generate that folder - */ - 'generator' => [ - 'config' => ['path' => 'Config', 'generate' => true], - 'command' => ['path' => 'Console', 'generate' => true], - 'migration' => ['path' => 'Database/Migrations', 'generate' => true], - 'seeder' => ['path' => 'Database/Seeders', 'generate' => true], - 'factory' => ['path' => 'Database/factories', 'generate' => true], - 'model' => ['path' => 'Entities', 'generate' => true], - 'controller' => ['path' => 'Http/Controllers', 'generate' => true], - 'filter' => ['path' => 'Http/Middleware', 'generate' => true], - 'request' => ['path' => 'Http/Requests', 'generate' => true], - 'provider' => ['path' => 'Providers', 'generate' => true], - 'assets' => ['path' => 'Resources/assets', 'generate' => true], - 'lang' => ['path' => 'Resources/lang', 'generate' => true], - 'views' => ['path' => 'Resources/views', 'generate' => true], - 'test' => ['path' => 'Tests', 'generate' => true], - 'repository' => ['path' => 'Repositories', 'generate' => false], - 'event' => ['path' => 'Events', 'generate' => false], - 'listener' => ['path' => 'Listeners', 'generate' => false], - 'policies' => ['path' => 'Policies', 'generate' => false], - 'rules' => ['path' => 'Rules', 'generate' => false], - 'jobs' => ['path' => 'Jobs', 'generate' => false], - 'emails' => ['path' => 'Emails', 'generate' => false], - 'notifications' => ['path' => 'Notifications', 'generate' => false], - 'resource' => ['path' => 'Transformers', 'generate' => false], - ], - ], - /* - |-------------------------------------------------------------------------- - | Scan Path - |-------------------------------------------------------------------------- - | - | Here you define which folder will be scanned. By default will scan vendor - | directory. This is useful if you host the package in packagist website. - | - */ - - 'scan' => [ - 'enabled' => false, - 'paths' => [ - base_path('vendor/*/*'), - ], - ], - /* - |-------------------------------------------------------------------------- - | Composer File Template - |-------------------------------------------------------------------------- - | - | Here is the config for composer.json file, generated by this package - | - */ - - 'composer' => [ - 'vendor' => 'nwidart', - 'author' => [ - 'name' => 'Nicolas Widart', - 'email' => 'n.widart@gmail.com', - ], - ], - /* - |-------------------------------------------------------------------------- - | Caching - |-------------------------------------------------------------------------- - | - | Here is the config for setting up caching feature. - | - */ - 'cache' => [ - 'enabled' => false, - 'key' => 'laravel-modules', - 'lifetime' => 60, - ], - /* - |-------------------------------------------------------------------------- - | Choose what laravel-modules will register as custom namespaces. - | Setting one to false will require you to register that part - | in your own Service Provider class. - |-------------------------------------------------------------------------- - */ - 'register' => [ - 'translations' => true, - /** - * load files on boot or register method - * - * Note: boot not compatible with asgardcms - * - * @example boot|register - */ - 'files' => 'register', - ], -]; diff --git a/database/migrations/2019_09_05_192945_add_load_in_home_column.php b/database/migrations/2019_09_05_192945_add_load_in_home_column.php new file mode 100644 index 0000000..ddc3b3c --- /dev/null +++ b/database/migrations/2019_09_05_192945_add_load_in_home_column.php @@ -0,0 +1,31 @@ +enum('load_in_home', ['yes', 'no'])->default('yes'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + + } +} diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 904d8e3..1e740b7 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -11,6 +11,7 @@ class DatabaseSeeder extends Seeder */ public function run() { - $this->call(ModuleSeeder::class); + // $this->call(ModuleSeeder::class); + $this->call(ElementTypeSeeder::class); } } diff --git a/routes/api.php b/routes/api.php index c641ca5..0f37e00 100644 --- a/routes/api.php +++ b/routes/api.php @@ -13,6 +13,3 @@ use Illuminate\Http\Request; | */ -Route::middleware('auth:api')->get('/user', function (Request $request) { - return $request->user(); -}); From 5679e9d2d2c0eba87f8101170175a90922084ba0 Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Fri, 6 Sep 2019 19:50:46 +0430 Subject: [PATCH 24/39] Form loader --- public/mix-manifest.json | 10 +++--- .../FormLoader/Elements/wm-checkbox.vue | 22 ++++++++++++ .../FormLoader/Elements/wm-form.vue | 9 +++++ .../FormLoader/Elements/wm-input.vue | 22 ++++++++++++ .../FormLoader/Elements/wm-radioButton.vue | 23 +++++++++++++ .../FormLoader/Elements/wm-select.vue | 23 +++++++++++++ .../FormLoader/Elements/wm-switch.vue | 21 ++++++++++++ .../FormLoader/Elements/wm-textarea.vue | 22 ++++++++++++ .../components/FormLoader/FactoryPattern.vue | 26 ++++++++++++++ .../Global/components/FormLoader/Wrapper.vue | 34 +++++++++++++++++++ resources/js/Global/components/Tiles/Tile.vue | 1 - resources/js/Global/mixins/global.js | 9 +++-- resources/js/Home/views/Home.vue | 21 ++++++------ 13 files changed, 225 insertions(+), 18 deletions(-) create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-checkbox.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-form.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-input.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-radioButton.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-select.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-switch.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-textarea.vue create mode 100644 resources/js/Global/components/FormLoader/FactoryPattern.vue create mode 100644 resources/js/Global/components/FormLoader/Wrapper.vue diff --git a/public/mix-manifest.json b/public/mix-manifest.json index e59dd88..d71799b 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=c9ebdffec50d82145867", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=e2cd567ef427a1285194", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=21ca2c0fd50704c54125", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=ecddb140ee87bb6dfc7c", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=ba20da8154c5c04c0dd6" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js", + "/js/vue/Home/app.js": "/js/vue/Home/app.js", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js", + "/js/vue/User/app.js": "/js/vue/User/app.js" } diff --git a/resources/js/Global/components/FormLoader/Elements/wm-checkbox.vue b/resources/js/Global/components/FormLoader/Elements/wm-checkbox.vue new file mode 100644 index 0000000..a118308 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-checkbox.vue @@ -0,0 +1,22 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-form.vue b/resources/js/Global/components/FormLoader/Elements/wm-form.vue new file mode 100644 index 0000000..bc9a33f --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-form.vue @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-input.vue b/resources/js/Global/components/FormLoader/Elements/wm-input.vue new file mode 100644 index 0000000..c779f47 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-input.vue @@ -0,0 +1,22 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-radioButton.vue b/resources/js/Global/components/FormLoader/Elements/wm-radioButton.vue new file mode 100644 index 0000000..0f48e4f --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-radioButton.vue @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-select.vue b/resources/js/Global/components/FormLoader/Elements/wm-select.vue new file mode 100644 index 0000000..fa4ef07 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-select.vue @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-switch.vue b/resources/js/Global/components/FormLoader/Elements/wm-switch.vue new file mode 100644 index 0000000..39fa8e4 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-switch.vue @@ -0,0 +1,21 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue b/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue new file mode 100644 index 0000000..2bd0a2c --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue @@ -0,0 +1,22 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/FactoryPattern.vue b/resources/js/Global/components/FormLoader/FactoryPattern.vue new file mode 100644 index 0000000..93108a2 --- /dev/null +++ b/resources/js/Global/components/FormLoader/FactoryPattern.vue @@ -0,0 +1,26 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Wrapper.vue b/resources/js/Global/components/FormLoader/Wrapper.vue new file mode 100644 index 0000000..e1ed0b5 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Wrapper.vue @@ -0,0 +1,34 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/Tiles/Tile.vue b/resources/js/Global/components/Tiles/Tile.vue index 69babc2..cbe6a55 100644 --- a/resources/js/Global/components/Tiles/Tile.vue +++ b/resources/js/Global/components/Tiles/Tile.vue @@ -49,7 +49,6 @@ export default { } }, data: function () { - console.log( ( this.RouteType == 'Route' ) ? 'router-link' : 'a' ); return { TagType: ( this.RouteType == 'Route' ) ? 'router-link' : 'a', RouteAddress: ( this.RouteType == 'Route' ) ? this.Route : false, diff --git a/resources/js/Global/mixins/global.js b/resources/js/Global/mixins/global.js index 61ab213..867432e 100644 --- a/resources/js/Global/mixins/global.js +++ b/resources/js/Global/mixins/global.js @@ -2,6 +2,7 @@ import { mapActions } from "vuex"; import globalStore from "@Global/store"; import authStore from "@Core/store"; import permissionList from "@Global/utils/Permissions/list"; +import { UserService } from "@Global/services/storage.services"; const global = { methods: { $_getPath(subPath) { @@ -29,16 +30,20 @@ const global = { let currentModule = globalStore.state.common.current_module; let permissions = authStore.state.auth.permissions; let multiPermission = permission.split("|"); + let siteOwner = !!UserService.get().is_owner; for (const iterator of multiPermission) { - if (iterator == '') { + if (iterator == "") { return true; } permission = permissionList[iterator]; if ( + siteOwner || owner || (permission && permissions[currentModule] && - Object.values(permissions[currentModule]).includes(permission)) + Object.values(permissions[currentModule]).includes( + permission + )) ) { return true; } diff --git a/resources/js/Home/views/Home.vue b/resources/js/Home/views/Home.vue index b62d9ae..64eb068 100644 --- a/resources/js/Home/views/Home.vue +++ b/resources/js/Home/views/Home.vue @@ -11,7 +11,6 @@ :TileClass="module.title_class" :TitleEn="module.title_en" :TitleFa="module.title_fa" - :Desc="module.description" :GradientBegin="module.gradient_begin" :GradientEnd="module.gradient_end" :ImageURL="module.img_url" @@ -24,6 +23,7 @@ fas fa-plus + @@ -31,22 +31,23 @@ From b2ddcec1b6ce052a370506f73ff1e3fcc1a82321 Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Sat, 7 Sep 2019 00:56:29 +0430 Subject: [PATCH 25/39] elements in form loader --- public/mix-manifest.json | 10 +++---- .../FormLoader/Elements/wm-date.vue | 0 .../FormLoader/Elements/wm-dropzone.vue | 0 .../FormLoader/Elements/wm-file.vue | 0 .../FormLoader/Elements/wm-form.vue | 21 +++++++++++-- .../FormLoader/Elements/wm-number_input.vue | 30 +++++++++++++++++++ .../FormLoader/Elements/wm-range.vue | 30 +++++++++++++++++++ .../{wm-input.vue => wm-text_input.vue} | 7 +++++ .../FormLoader/Elements/wm-time.vue | 0 .../components/FormLoader/FactoryPattern.vue | 2 +- .../Global/components/FormLoader/Wrapper.vue | 18 +++++------ resources/js/Home/views/Home.vue | 6 ++-- 12 files changed, 103 insertions(+), 21 deletions(-) create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-date.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-dropzone.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-file.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-number_input.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-range.vue rename resources/js/Global/components/FormLoader/Elements/{wm-input.vue => wm-text_input.vue} (78%) create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-time.vue diff --git a/public/mix-manifest.json b/public/mix-manifest.json index d71799b..cefc2cd 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js", - "/js/vue/Home/app.js": "/js/vue/Home/app.js", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js", - "/js/vue/User/app.js": "/js/vue/User/app.js" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=1e82449eeed5825a8ba1", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=8eaf21984d417aafd698", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=f30c2bd0c5cc464db69b", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=b993b2ea20cfffd23264", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=ed8c59c266ebb9751214" } diff --git a/resources/js/Global/components/FormLoader/Elements/wm-date.vue b/resources/js/Global/components/FormLoader/Elements/wm-date.vue new file mode 100644 index 0000000..e69de29 diff --git a/resources/js/Global/components/FormLoader/Elements/wm-dropzone.vue b/resources/js/Global/components/FormLoader/Elements/wm-dropzone.vue new file mode 100644 index 0000000..e69de29 diff --git a/resources/js/Global/components/FormLoader/Elements/wm-file.vue b/resources/js/Global/components/FormLoader/Elements/wm-file.vue new file mode 100644 index 0000000..e69de29 diff --git a/resources/js/Global/components/FormLoader/Elements/wm-form.vue b/resources/js/Global/components/FormLoader/Elements/wm-form.vue index bc9a33f..400b202 100644 --- a/resources/js/Global/components/FormLoader/Elements/wm-form.vue +++ b/resources/js/Global/components/FormLoader/Elements/wm-form.vue @@ -1,9 +1,24 @@ \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-number_input.vue b/resources/js/Global/components/FormLoader/Elements/wm-number_input.vue new file mode 100644 index 0000000..d56e5e7 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-number_input.vue @@ -0,0 +1,30 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-range.vue b/resources/js/Global/components/FormLoader/Elements/wm-range.vue new file mode 100644 index 0000000..236dc8c --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-range.vue @@ -0,0 +1,30 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-input.vue b/resources/js/Global/components/FormLoader/Elements/wm-text_input.vue similarity index 78% rename from resources/js/Global/components/FormLoader/Elements/wm-input.vue rename to resources/js/Global/components/FormLoader/Elements/wm-text_input.vue index c779f47..7922436 100644 --- a/resources/js/Global/components/FormLoader/Elements/wm-input.vue +++ b/resources/js/Global/components/FormLoader/Elements/wm-text_input.vue @@ -17,6 +17,13 @@ export default { element:{ type: Object } + }, + watch:{ + element(){ + console.log(this.element); + + } } + } \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-time.vue b/resources/js/Global/components/FormLoader/Elements/wm-time.vue new file mode 100644 index 0000000..e69de29 diff --git a/resources/js/Global/components/FormLoader/FactoryPattern.vue b/resources/js/Global/components/FormLoader/FactoryPattern.vue index 93108a2..1efd97c 100644 --- a/resources/js/Global/components/FormLoader/FactoryPattern.vue +++ b/resources/js/Global/components/FormLoader/FactoryPattern.vue @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue b/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue index 2bd0a2c..ecd8372 100644 --- a/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue +++ b/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue @@ -8,6 +8,7 @@ :append-icon="element.append_icon" :prepend-icon="element.prepend_icon" :class="element.width" + v-model="values['input_'+element.id]" > @@ -15,7 +16,12 @@ export default { props:{ element:{ - type: Object + type: Object, + }, + values: { + type: Object, + required: false, + default: {} } } } diff --git a/resources/js/Global/components/FormLoader/FactoryPattern.vue b/resources/js/Global/components/FormLoader/FactoryPattern.vue index 1efd97c..c61a549 100644 --- a/resources/js/Global/components/FormLoader/FactoryPattern.vue +++ b/resources/js/Global/components/FormLoader/FactoryPattern.vue @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/resources/js/Global/mixins/global.js b/resources/js/Global/mixins/global.js index 867432e..ff8c943 100644 --- a/resources/js/Global/mixins/global.js +++ b/resources/js/Global/mixins/global.js @@ -6,7 +6,8 @@ import { UserService } from "@Global/services/storage.services"; const global = { methods: { $_getPath(subPath) { - return "/" + subPath; + const path = process.env.MIX_PUSHER_APP_PUBLIC_PATH ? process.env.MIX_PUSHER_APP_PUBLIC_PATH : '/'; + return path + subPath; }, //Modal diff --git a/resources/js/Global/plugins/globalComponent.js b/resources/js/Global/plugins/globalComponent.js index 19351ac..022ba4f 100644 --- a/resources/js/Global/plugins/globalComponent.js +++ b/resources/js/Global/plugins/globalComponent.js @@ -1,15 +1,15 @@ import Vue from 'vue'; -import VueScrollReveal from "vue-scroll-reveal"; +// import VueScrollReveal from "vue-scroll-reveal"; import Vuetify from 'vuetify' -import "popper.js"; -import "bootstrap-v4-rtl"; -import "bootstrap-v4-rtl/scss/bootstrap-rtl.scss"; -import "bootstrap-select"; -import "bootstrap-select/dist/css/bootstrap-select.css"; +// import "popper.js"; +// import "bootstrap-v4-rtl"; +// import "bootstrap-v4-rtl/scss/bootstrap-rtl.scss"; +// import "bootstrap-select"; +// import "bootstrap-select/dist/css/bootstrap-select.css"; import "vuetify/dist/vuetify.min.css"; // Ensure you are using css-loader import "@Global/assets/Font-Icons/css/fontello.css"; import "@Global/scss/style.scss"; @@ -22,13 +22,13 @@ import InfoBlock from "@Global/components/Misc/InfoBlock.vue"; import Breadcrumbs from "@Global/components/Misc/Breadcrumbs"; -Vue.use(VueScrollReveal, { - class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides. - duration: 800, - scale: 1, - distance: '10px', - mobile: false -}); +// Vue.use(VueScrollReveal, { +// class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides. +// duration: 800, +// scale: 1, +// distance: '10px', +// mobile: false +// }); Vue.use(Vuetify, { iconfont: "fa", diff --git a/resources/js/Global/services/api.services.js b/resources/js/Global/services/api.services.js index d53ecdc..2375528 100644 --- a/resources/js/Global/services/api.services.js +++ b/resources/js/Global/services/api.services.js @@ -4,10 +4,11 @@ import commonState from '@Global/store/modules/common/state'; const ApiService = { init(baseURL = null) { - axios.defaults.baseURL = "https://www.willaengine.ir"; - // if (baseURL) { - // axios.defaults.baseURL = baseURL; - // } + if (baseURL) { + axios.defaults.baseURL = baseURL; + } else if (process.env.MIX_PUSHER_APP_API) { + axios.defaults.baseURL = process.env.MIX_PUSHER_APP_API; + } axios.interceptors.request.use((config) => { config.headers = this.setModuleHeader(config.headers); diff --git a/resources/js/Home/views/Home.vue b/resources/js/Home/views/Home.vue index be73c78..64eb068 100644 --- a/resources/js/Home/views/Home.vue +++ b/resources/js/Home/views/Home.vue @@ -23,7 +23,7 @@ fas fa-plus - + @@ -31,13 +31,13 @@ diff --git a/resources/js/Global/components/FormLoader/Elements/wm-checkbox.vue b/resources/js/Global/components/FormLoader/Elements/we-checkbox.vue similarity index 100% rename from resources/js/Global/components/FormLoader/Elements/wm-checkbox.vue rename to resources/js/Global/components/FormLoader/Elements/we-checkbox.vue diff --git a/resources/js/Global/components/FormLoader/Elements/wm-date.vue b/resources/js/Global/components/FormLoader/Elements/we-date.vue similarity index 100% rename from resources/js/Global/components/FormLoader/Elements/wm-date.vue rename to resources/js/Global/components/FormLoader/Elements/we-date.vue diff --git a/resources/js/Global/components/FormLoader/Elements/wm-dropzone.vue b/resources/js/Global/components/FormLoader/Elements/we-dropzone.vue similarity index 100% rename from resources/js/Global/components/FormLoader/Elements/wm-dropzone.vue rename to resources/js/Global/components/FormLoader/Elements/we-dropzone.vue diff --git a/resources/js/Global/components/FormLoader/Elements/wm-file.vue b/resources/js/Global/components/FormLoader/Elements/we-file.vue similarity index 100% rename from resources/js/Global/components/FormLoader/Elements/wm-file.vue rename to resources/js/Global/components/FormLoader/Elements/we-file.vue diff --git a/resources/js/Global/components/FormLoader/Elements/wm-form.vue b/resources/js/Global/components/FormLoader/Elements/we-form.vue similarity index 54% rename from resources/js/Global/components/FormLoader/Elements/wm-form.vue rename to resources/js/Global/components/FormLoader/Elements/we-form.vue index ae7b6aa..cea55ae 100644 --- a/resources/js/Global/components/FormLoader/Elements/wm-form.vue +++ b/resources/js/Global/components/FormLoader/Elements/we-form.vue @@ -1,11 +1,9 @@ \ No newline at end of file + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/we-number_input.vue b/resources/js/Global/components/FormLoader/Elements/we-number_input.vue new file mode 100644 index 0000000..cf64d12 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/we-number_input.vue @@ -0,0 +1,28 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-radioButton.vue b/resources/js/Global/components/FormLoader/Elements/we-radioButton.vue similarity index 100% rename from resources/js/Global/components/FormLoader/Elements/wm-radioButton.vue rename to resources/js/Global/components/FormLoader/Elements/we-radioButton.vue diff --git a/resources/js/Global/components/FormLoader/Elements/wm-range.vue b/resources/js/Global/components/FormLoader/Elements/we-range.vue similarity index 100% rename from resources/js/Global/components/FormLoader/Elements/wm-range.vue rename to resources/js/Global/components/FormLoader/Elements/we-range.vue diff --git a/resources/js/Global/components/FormLoader/Elements/we-select.vue b/resources/js/Global/components/FormLoader/Elements/we-select.vue new file mode 100644 index 0000000..e1a7d09 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/we-select.vue @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/we-switch.vue b/resources/js/Global/components/FormLoader/Elements/we-switch.vue new file mode 100644 index 0000000..1364098 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/we-switch.vue @@ -0,0 +1,26 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/we-text_input.vue b/resources/js/Global/components/FormLoader/Elements/we-text_input.vue new file mode 100644 index 0000000..e0e53ea --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/we-text_input.vue @@ -0,0 +1,27 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/we-textarea.vue b/resources/js/Global/components/FormLoader/Elements/we-textarea.vue new file mode 100644 index 0000000..924136d --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/we-textarea.vue @@ -0,0 +1,26 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-time.vue b/resources/js/Global/components/FormLoader/Elements/we-time.vue similarity index 100% rename from resources/js/Global/components/FormLoader/Elements/wm-time.vue rename to resources/js/Global/components/FormLoader/Elements/we-time.vue diff --git a/resources/js/Global/components/FormLoader/Elements/wm-number_input.vue b/resources/js/Global/components/FormLoader/Elements/wm-number_input.vue deleted file mode 100644 index a9a534d..0000000 --- a/resources/js/Global/components/FormLoader/Elements/wm-number_input.vue +++ /dev/null @@ -1,36 +0,0 @@ - - \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-select.vue b/resources/js/Global/components/FormLoader/Elements/wm-select.vue deleted file mode 100644 index fa4ef07..0000000 --- a/resources/js/Global/components/FormLoader/Elements/wm-select.vue +++ /dev/null @@ -1,23 +0,0 @@ - - \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-switch.vue b/resources/js/Global/components/FormLoader/Elements/wm-switch.vue deleted file mode 100644 index 4b038be..0000000 --- a/resources/js/Global/components/FormLoader/Elements/wm-switch.vue +++ /dev/null @@ -1,27 +0,0 @@ - - \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-text_input.vue b/resources/js/Global/components/FormLoader/Elements/wm-text_input.vue deleted file mode 100644 index 83621ec..0000000 --- a/resources/js/Global/components/FormLoader/Elements/wm-text_input.vue +++ /dev/null @@ -1,28 +0,0 @@ - - \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue b/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue deleted file mode 100644 index ecd8372..0000000 --- a/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue +++ /dev/null @@ -1,28 +0,0 @@ - - \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/FactoryPattern.vue b/resources/js/Global/components/FormLoader/FactoryPattern.vue index c61a549..a8aef2d 100644 --- a/resources/js/Global/components/FormLoader/FactoryPattern.vue +++ b/resources/js/Global/components/FormLoader/FactoryPattern.vue @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/resources/js/Global/mixins/global.js b/resources/js/Global/mixins/global.js index ff8c943..7cd82d4 100644 --- a/resources/js/Global/mixins/global.js +++ b/resources/js/Global/mixins/global.js @@ -5,7 +5,7 @@ import permissionList from "@Global/utils/Permissions/list"; import { UserService } from "@Global/services/storage.services"; const global = { methods: { - $_getPath(subPath) { + $_getPath(subPath = '') { const path = process.env.MIX_PUSHER_APP_PUBLIC_PATH ? process.env.MIX_PUSHER_APP_PUBLIC_PATH : '/'; return path + subPath; }, diff --git a/resources/js/Global/plugins/globalComponent.js b/resources/js/Global/plugins/globalComponent.js index 19351ac..b36a547 100644 --- a/resources/js/Global/plugins/globalComponent.js +++ b/resources/js/Global/plugins/globalComponent.js @@ -21,6 +21,12 @@ import Checkbox from "@Global/components/Inputs/Checkbox.vue"; import InfoBlock from "@Global/components/Misc/InfoBlock.vue"; import Breadcrumbs from "@Global/components/Misc/Breadcrumbs"; +//jalali +import jalaliMoment from "vue-jalali-moment" +import momment from "moment" +momment.locale('fa'); +Vue.use(jalaliMoment); + Vue.use(VueScrollReveal, { class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides. diff --git a/resources/js/Global/services/errorHandler.services.js b/resources/js/Global/services/errorHandler.services.js index ef1974e..deac168 100644 --- a/resources/js/Global/services/errorHandler.services.js +++ b/resources/js/Global/services/errorHandler.services.js @@ -4,6 +4,9 @@ import ApiService from "@Global/services/api.services"; import store from "@Core/store/index"; import commonRoute from "@Global/utils/common/routes"; + +import toast from "./toast.service"; + function errorResponseHandler(error) { // check for errorHandle config @@ -19,13 +22,26 @@ function errorResponseHandler(error) { if(error.response.status == 401) { TokenService.removeToken(); ApiService.removeAuthHeader(); - store.commit('auth/logout', {}, {root: true}) - window.location.href = commonRoute.login(); + store.commit('auth/logout', {}, {root: true}); + if (commonRoute.login() != window.location.pathname) { + window.location.href = commonRoute.login(); + } + toast.error('نام کاربری یا رمز عبور اشتباه است', 'خطا'); + } else if(error.response.status == 422) { + if(typeof error.response.data.errors !== 'undefined') { + for (const key in error.response.data.errors) { + if (error.response.data.errors.hasOwnProperty(key)) { + toast.error(error.response.data.errors[key], 'خطا'); + } + } + } + } else if(error.response.status == 500) { + toast.error('مشکل از سمت سرور', 'خطا'); } } } function successHandler(response) { - // if(response.status == 200) { + // if(response.status == 200 || response.status == 201) { // if(typeof response.data.message !== 'undefined') { // toast.success(response.data.message, response.data.title); // } diff --git a/resources/js/Global/services/toast.service.js b/resources/js/Global/services/toast.service.js new file mode 100644 index 0000000..6507505 --- /dev/null +++ b/resources/js/Global/services/toast.service.js @@ -0,0 +1,23 @@ +import "izitoast/dist/css/iziToast.min.css"; +import iZtoast from "izitoast"; + +const toast = { + error: (message, title = "Error") => { + return iZtoast.error({ + title: title, + message: message, + rtl:true, + position: "bottomCenter" + }); + }, + success: (message, title = "Success") => { + return iZtoast.success({ + title: title, + message: message, + rtl:true, + position: "bottomCenter" + }); + } +}; + +export default toast; diff --git a/resources/js/Home/views/Home.vue b/resources/js/Home/views/Home.vue index be73c78..db0604d 100644 --- a/resources/js/Home/views/Home.vue +++ b/resources/js/Home/views/Home.vue @@ -18,12 +18,11 @@ > - + + --> @@ -31,13 +30,11 @@