Add new version in repository
This commit is contained in:
550
Gruntfile.js
550
Gruntfile.js
@@ -1,121 +1,139 @@
|
|||||||
var jsBase = [
|
var jsBase = [
|
||||||
'node_modules/jquery/dist/jquery.min.js',
|
'node_modules/jquery/dist/jquery.min.js',
|
||||||
'node_modules/jquery-migrate/jquery-migrate.min.js',
|
'node_modules/jquery-migrate/dist/jquery-migrate.min.js',
|
||||||
|
'node_modules/jquery-ui-dist/jquery-ui.min.js'
|
||||||
|
]
|
||||||
|
|
||||||
|
var jsBootstrap = [
|
||||||
'node_modules/bootstrap/dist/js/bootstrap.bundle.min.js',
|
'node_modules/bootstrap/dist/js/bootstrap.bundle.min.js',
|
||||||
|
'node_modules/bootbox/dist/bootbox.all.min.js',
|
||||||
]
|
]
|
||||||
|
|
||||||
var cssBase = [
|
var jsCompat = [
|
||||||
'node_modules/bootstrap/dist/css/bootstrap.min.css',
|
|
||||||
]
|
|
||||||
|
|
||||||
var cssIcons = [
|
|
||||||
'node_modules/font-awesome/css/font-awesome.css',
|
|
||||||
]
|
|
||||||
|
|
||||||
var jsCompatibilty = [
|
|
||||||
'node_modules/promise-polyfill/dist/polyfill.min.js',
|
'node_modules/promise-polyfill/dist/polyfill.min.js',
|
||||||
'node_modules/es6-promise/dist/es6-promise.min.js'
|
'node_modules/es6-promise/dist/es6-promise.min.js',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
var jsAdminLTE = [
|
||||||
|
jsBase,
|
||||||
|
jsBootstrap,
|
||||||
|
'node_modules/sizzle/dist/sizzle.min.js',
|
||||||
|
'node_modules/admin-lte/dist/js/adminlte.min.js',
|
||||||
|
'node_modules/toastr/build/toastr.min.js',
|
||||||
]
|
]
|
||||||
|
|
||||||
var jsCoreInclude = [
|
var jsCoreInclude = [
|
||||||
'build/js/include/core/appender.js',
|
// 'build/js/include/core/appender.js',
|
||||||
// 'build/js/include/core/cache.js',
|
// 'build/js/include/core/cache.js',
|
||||||
// 'build/js/include/core/handlebars.js',
|
// 'build/js/include/core/handlebars.js',
|
||||||
// 'build/js/include/core/lang.js',
|
// 'build/js/include/core/lang.js',
|
||||||
'build/js/include/core/objectLength.js',
|
'build/js/include/core/objectLength.js',
|
||||||
// 'build/js/include/core/session.js',
|
// 'build/js/include/core/session.js',
|
||||||
'build/js/include/core/url.js',
|
'build/js/include/core/url.js',
|
||||||
// 'build/js/include/core/user.js',
|
'build/js/include/core/user.js',
|
||||||
// 'build/js/include/form/check_fields.js',
|
// 'build/js/include/form/check_fields.js',
|
||||||
// 'build/js/include/form/checkbox.js',
|
// 'build/js/include/form/checkbox.js',
|
||||||
// 'build/js/include/form/datetime.js',
|
// 'build/js/include/form/datetime.js',
|
||||||
// 'build/js/include/form/multi-select.js',
|
// 'build/js/include/form/multi-select.js',
|
||||||
// 'build/js/include/form/radio.js',
|
'build/js/include/form/radio.js',
|
||||||
// 'build/js/include/form/select.js',
|
// 'build/js/include/form/select.js',
|
||||||
'build/js/include/form/upload.js',
|
'build/js/include/form/upload.js',
|
||||||
// 'build/js/include/form/validator.js',
|
'build/js/include/form/validator.js',
|
||||||
'build/js/include/layout/animate.js',
|
'build/js/include/layout/animate.js',
|
||||||
// 'build/js/include/layout/message.js',
|
'build/js/include/layout/message.js',
|
||||||
// 'build/js/include/layout/modal.js',
|
// 'build/js/include/layout/modal.js',
|
||||||
'build/js/include/layout/scroll.js',
|
'build/js/include/layout/scroll.js',
|
||||||
// 'build/js/include/layout/tooltip.js',
|
'build/js/include/layout/tooltip.js',
|
||||||
// 'build/js/include/datatable.js',
|
// 'build/js/include/datatable.js',
|
||||||
'build/js/include/file.js',
|
'build/js/include/file.js',
|
||||||
'build/js/include/uploader.js',
|
'build/js/include/uploader.js',
|
||||||
]
|
]
|
||||||
|
|
||||||
var jsMain = [
|
var jsBundle = [
|
||||||
// 'node_modules/sweetalert2/dist/sweetalert2.all.min.js',
|
'node_modules/jquery-ui-sortable/jquery-ui.min.js',
|
||||||
// 'node_modules/inputmask/dist/min/jquery.inputmask.bundle.min.js',
|
|
||||||
/* 'node_modules/summernote/dist/summernote.min.js',
|
|
||||||
'node_modules/summernote/dist/lang/summernote-fr-FR.min.js',
|
|
||||||
*/
|
|
||||||
// 'node_modules/@activix/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js',
|
|
||||||
// 'node_modules/@activix/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js',
|
|
||||||
'node_modules/bootstrap-fileinput/js/plugins/piexif.min.js',
|
|
||||||
'node_modules/bootstrap-fileinput/js/plugins/sortable.min.js',
|
|
||||||
// 'node_modules/bootstrap-slider/dist/bootstrap-slider.min.js',
|
|
||||||
// 'node_modules/bootstrap-validate/dist/bootstrap-validate.js',
|
|
||||||
// 'node_modules/jQuery-QueryBuilder/dist/js/jquery-builder.standalone.min.js',
|
|
||||||
/* 'node_modules/jQuery-QueryBuilder/dist/i18n/query-builder.fr.js', */
|
|
||||||
/* 'node_modules/isotope-layout/dist/isotope.pkgd.min.js', */
|
|
||||||
'node_modules/jquery-serializejson/jquery.serializejson.min.js',
|
'node_modules/jquery-serializejson/jquery.serializejson.min.js',
|
||||||
'node_modules/bootstrap4-toggle/js/bootstrap4-toggle.min.js',
|
// 'node_modules/moment/min/moment.min.js',
|
||||||
'node_modules/wew.js/dist/wew.min.js',
|
'node_modules/jquery-placeholder/jquery.placeholder.js',
|
||||||
'node_modules/jquery.are-you-sure/jquery.are-you-sure.js',
|
// 'node_modules/daterangepicker/daterangepicker.js',
|
||||||
/* 'node_modules/letteringjs/jquery.lettering.js', */
|
// 'node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js',
|
||||||
/* 'node_modules/textillate/jquery.textillate.js', */
|
// 'node_modules/bootstrap4-toggle/js/bootstrap4-toggle.min.js',
|
||||||
'node_modules/jqtree/tree.jquery.js',
|
'node_modules/@claviska/jquery-minicolors/jquery.minicolors.js',
|
||||||
'node_modules/numeral/min/numeral.min.js',
|
'node_modules/bootstrap-validate/dist/bootstrap-validate.js',
|
||||||
'node_modules/numeral/min/locales/fr.min.js',
|
'node_modules/bootstrap-validator/dist/validator.min.js',
|
||||||
'build/js/include/plugins/jquery.hcaptions.js',
|
'node_modules/jquery-validation/dist/jquery.validate.min.js',
|
||||||
jsCoreInclude
|
'node_modules/jquery-confirm/dist/jquery-confirm.min.js',
|
||||||
// 'build/js/include/confirm.js',
|
'node_modules/jquery.cookie/jquery.cookie.js',
|
||||||
|
'node_modules/jquery.filer/js/jquery.filer.min.js',
|
||||||
|
'node_modules/jquery-file-download/src/Scripts/jquery.fileDownload.js',
|
||||||
|
'node_modules/jquery-jeditable/dist/jquery.jeditable.min.js',
|
||||||
|
'node_modules/jquery.quicksearch/dist/jquery.quicksearch.min.js',
|
||||||
|
'node_modules/jquery.nicescroll/dist/jquery.nicescroll.js',
|
||||||
|
'node_modules/jquery-slimscroll/jquery.slimscroll.min.js',
|
||||||
|
// 'node_modules/superclick/dist/js/superclick.min.js',
|
||||||
|
// 'node_modules/dropzone/dist/min/dropzone.min.js',
|
||||||
|
'node_modules/handlebars/dist/handlebars.min.js',
|
||||||
|
'node_modules/swag/lib/swag.min.js',
|
||||||
|
'node_modules/multiselect/js/jquery.multi-select.js',
|
||||||
|
'node_modules/screenfull/dist/screenfull.js',
|
||||||
|
'node_modules/underscore/underscore-min.js',
|
||||||
|
// 'Admin/js/themes/admin/layout.js',
|
||||||
|
// 'node_modules/wew.js/dist/wew.min.js'
|
||||||
|
]
|
||||||
|
|
||||||
|
var jsMain = [
|
||||||
|
jsCompat,
|
||||||
|
jsCoreInclude,
|
||||||
|
jsBundle,
|
||||||
|
]
|
||||||
|
|
||||||
|
var cssPrint = [
|
||||||
|
// 'node_modules/bootstrap/dist/css/bootstrap.min.css',
|
||||||
|
'node_modules/@fortawesome/fontawesome-free/css/fontawesome.min.css',
|
||||||
|
'build/print.css'
|
||||||
|
]
|
||||||
|
|
||||||
|
var cssBundle = [
|
||||||
|
'node_modules/bootstrap/dist/css/bootstrap.min.css',
|
||||||
|
'node_modules/animate.css/animate.min.css',
|
||||||
|
'node_modules/dropzone/dist/min/dropzone.min.css',
|
||||||
|
'node_modules/daterangepicker/daterangepicker.css',
|
||||||
|
'node_modules/jquery-confirm/dist/jquery-confirm.min.css',
|
||||||
|
'node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css',
|
||||||
|
'node_modules/bootstrap-sweetalert/dist/sweetalert.css',
|
||||||
|
'node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css',
|
||||||
|
'node_modules/@claviska/jquery-minicolors/jquery.minicolors.css',
|
||||||
|
'node_modules/jquery.filer/css/jquery.filer.css',
|
||||||
|
'node_modules/jquery.filer/css/themes/jquery.filer-dragdropbox-theme.css',
|
||||||
|
'node_modules/jquery.filer/assets/fonts/jquery.filer-icons/jquery-filer.css',
|
||||||
|
]
|
||||||
|
|
||||||
|
var cssIcons = [
|
||||||
|
'node_modules/@fortawesome/fontawesome-free/css/fontawesome.min.css',
|
||||||
]
|
]
|
||||||
|
|
||||||
var cssMain = [
|
var cssMain = [
|
||||||
// 'node_modules/sweetalert2/dist/sweetalert2.min.css',
|
cssBundle,
|
||||||
// 'node_modules/inputmask/css/inputmask.css',
|
|
||||||
// 'node_modules/summernote/dist/summernote.css',
|
|
||||||
// 'node_modules/@activix/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css',
|
|
||||||
// 'node_modules/bootstrap-slider/dist/css/bootstrap-slider.min.css',
|
|
||||||
// 'node_modules/jQuery-QueryBuilder/dist/css/query-builder.default.min.css',
|
|
||||||
'node_modules/animate.css/animate.min.css',
|
|
||||||
'node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css',
|
|
||||||
'node_modules/jqtree/jqtree.css',
|
|
||||||
// 'build/css/modal-option.css',
|
|
||||||
'build/css/shadow.css',
|
|
||||||
// 'build/css/utility.css',
|
|
||||||
'build/css/main.css'
|
|
||||||
]
|
|
||||||
|
|
||||||
var jsSite = [
|
|
||||||
jsBase
|
|
||||||
]
|
|
||||||
|
|
||||||
var cssSite = [
|
|
||||||
cssBase,
|
|
||||||
cssIcons,
|
cssIcons,
|
||||||
'node_modules/animate.css/animate.min.css',
|
'build/css/main.css',
|
||||||
'build/css/shadow.css',
|
|
||||||
'build/css/site.css'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
var jsDataTables = [
|
var jsDataTables = [
|
||||||
|
// 'build/Suite/js/datatables.js',
|
||||||
'node_modules/jszip/dist/jszip.min.js',
|
'node_modules/jszip/dist/jszip.min.js',
|
||||||
'node_modules/pdfmake/build/pdfmake.min.js',
|
'node_modules/pdfmake/build/pdfmake.min.js',
|
||||||
'node_modules/pdfmake/build/vfs_fonts.js',
|
'node_modules/pdfmake/build/vfs_fonts.js',
|
||||||
'node_modules/datatables/media/js/jquery.dataTables.min.js',
|
'node_modules/datatables.net/js/jquery.dataTables.min.js',
|
||||||
'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js',
|
'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-autofill/js/autoFill.min.js',
|
'node_modules/datatables.net-autofill/js/dataTables.autoFill.min.js',
|
||||||
'node_modules/datatables.net-autofill/js/autoFill.bootstrap.min.js',
|
'node_modules/datatables.net-autofill-bs4/js/autoFill.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-buttons/js/dataTables.buttons.min.js',
|
'node_modules/datatables.net-buttons/js/dataTables.buttons.min.js',
|
||||||
'node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js',
|
'node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-buttons/js/buttons.html5.min.js',
|
'node_modules/datatables.net-buttons/js/buttons.html5.min.js',
|
||||||
'node_modules/datatables.net-buttons/js/buttons.print.min.js',
|
'node_modules/datatables.net-buttons/js/buttons.print.min.js',
|
||||||
'node_modules/datatables.net-buttons/js/buttons.colVis.min.js',
|
'node_modules/datatables.net-buttons/js/buttons.colVis.min.js',
|
||||||
'node_modules/datatables.net-colreorder/js/dataTables.colReorder.min.js',
|
'node_modules/datatables.net-colreorder/js/dataTables.colReorder.min.js',
|
||||||
'node_modules/datatables.net-colreorder-bs4/js/dataTables.colReorder-bs4.min.js',
|
'node_modules/datatables.net-colreorder-bs4/js/colReorder.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js',
|
'node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js',
|
||||||
'node_modules/datatables.net-fixedheader-bs4/js/fixedHeader.bootstrap4.min.js',
|
'node_modules/datatables.net-fixedheader-bs4/js/fixedHeader.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-fixedcolumns/js/dataTables.fixedColumns.min.js',
|
'node_modules/datatables.net-fixedcolumns/js/dataTables.fixedColumns.min.js',
|
||||||
@@ -124,21 +142,18 @@ var jsDataTables = [
|
|||||||
'node_modules/datatables.net-keytable-bs4/js/keyTable.bootstrap4.min.js',
|
'node_modules/datatables.net-keytable-bs4/js/keyTable.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-responsive/js/dataTables.responsive.min.js',
|
'node_modules/datatables.net-responsive/js/dataTables.responsive.min.js',
|
||||||
'node_modules/datatables.net-rowreorder/js/dataTables.rowReorder.min.js',
|
'node_modules/datatables.net-rowreorder/js/dataTables.rowReorder.min.js',
|
||||||
'node_modules/datatables.net-rowreorder-bs4/js/dataTables.rowReorder.botstrap4.min.js',
|
'node_modules/datatables.net-rowreorder-bs4/js/rowReorder.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-scroller/js/dataTables.scroller.min.js',
|
'node_modules/datatables.net-scroller/js/dataTables.scroller.min.js',
|
||||||
'node_modules/datatables.net-scroller-bs4/js/scroller.bootstrap4.min.js',
|
'node_modules/datatables.net-scroller-bs4/js/scroller.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-select/js/dataTables.select.min.js',
|
'node_modules/datatables.net-select/js/dataTables.select.min.js',
|
||||||
'node_modules/datatables.net-select-bs4/js/select.bootstrap4.min.js',
|
'node_modules/datatables.net-select-bs4/js/select.bootstrap4.min.js',
|
||||||
'node_modules/yadcf/jquery.dataTables.yadcf.js',
|
/* 'node_modules/yadcf/jquery.dataTables.yadcf.js', */
|
||||||
'build/js/modal.js',
|
|
||||||
'build/js/datatables.js',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
var cssDataTables = [
|
var cssDataTables = [
|
||||||
// 'node_modules/datatables/media/css/jquery.dataTables.min.css',
|
|
||||||
'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css',
|
'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css',
|
||||||
|
'node_modules/datatables.net-autofill-bs4/css/autoFill.bootstrap4.min.css',
|
||||||
'node_modules/dataTables.net-buttons-bs4/css/buttons.bootstrap4.min.css',
|
'node_modules/dataTables.net-buttons-bs4/css/buttons.bootstrap4.min.css',
|
||||||
'node_modules/datatables.net-autofill/css/autoFill.bootstrap.min.css',
|
|
||||||
'node_modules/datatables.net-colreorder-bs4/css/colReorder.bootstrap4.min.css',
|
'node_modules/datatables.net-colreorder-bs4/css/colReorder.bootstrap4.min.css',
|
||||||
'node_modules/datatables.net-fixedheader-bs4/css/fixedHeader.bootstrap4.min.css',
|
'node_modules/datatables.net-fixedheader-bs4/css/fixedHeader.bootstrap4.min.css',
|
||||||
'node_modules/datatables.net-fixedcolumns-bs4/css/fixedColumns.bootstrap4.min.css',
|
'node_modules/datatables.net-fixedcolumns-bs4/css/fixedColumns.bootstrap4.min.css',
|
||||||
@@ -146,18 +161,9 @@ var cssDataTables = [
|
|||||||
'node_modules/datatables.net-rowreorder-bs4/css/rowReorder.bootstrap4.min.css',
|
'node_modules/datatables.net-rowreorder-bs4/css/rowReorder.bootstrap4.min.css',
|
||||||
'node_modules/datatables.net-scroller-bs4/css/scroller.bootstrap4.min.css',
|
'node_modules/datatables.net-scroller-bs4/css/scroller.bootstrap4.min.css',
|
||||||
'node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css',
|
'node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css',
|
||||||
'node_modules/yadcf/jquery.dataTables.yadcf.css',
|
/* 'node_modules/yadcf/jquery.dataTables.yadcf.css', */
|
||||||
'build/dataTables.bootstrap.min.css',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
var jsCalendar = [
|
|
||||||
'node_modules/fullcalendar/dist/fullcalendar.min.js',
|
|
||||||
'node_modules/fullcalendar/dist/locale/fr.js'
|
|
||||||
]
|
|
||||||
|
|
||||||
var cssCalendar = [
|
|
||||||
'node_modules/fullcalendar/dist/fullcalendar.min.css',
|
|
||||||
]
|
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
@@ -171,28 +177,19 @@ module.exports = function(grunt) {
|
|||||||
build: {
|
build: {
|
||||||
files: [
|
files: [
|
||||||
{
|
{
|
||||||
'public/js/main.min.js': jsMain,
|
'public/assets/js/main.min.js': jsMain,
|
||||||
'public/js/site.js': jsSite,
|
'public/assets/css/main.min.css': cssMain,
|
||||||
'public/js/datatables.min.js': jsDataTables,
|
'public/assets/plugins/datatables.min.js': jsDataTables,
|
||||||
'public/js/calendar.min.js': jsCalendar
|
'public/assets/plugins/adminlte/adminlte.min.js': jsAdminLTE
|
||||||
},
|
|
||||||
{
|
|
||||||
expand: true,
|
|
||||||
cwd: 'build/js/modules',
|
|
||||||
src: '**/*.js',
|
|
||||||
dest: 'public/js',
|
|
||||||
rename: function (dest, src) {
|
|
||||||
return dest + '/' + src.replace('.js', '.min.js');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
eslint: {
|
eslint: {
|
||||||
target: ['build/js/*']
|
target: ['public/assets/js/*']
|
||||||
},
|
},
|
||||||
webstandards: {
|
webstandards: {
|
||||||
'src': ['build/js/*']
|
'src': ['public/assets/js/*']
|
||||||
},
|
},
|
||||||
concat: {
|
concat: {
|
||||||
options: {
|
options: {
|
||||||
@@ -200,36 +197,28 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
mainjs: {
|
mainjs: {
|
||||||
src: jsMain,
|
src: jsMain,
|
||||||
dest: 'public/js/main.min.js'
|
dest: 'public/assets/js/main.min.js'
|
||||||
},
|
},
|
||||||
maincss: {
|
maincss: {
|
||||||
src: cssMain,
|
src: cssMain,
|
||||||
dest: 'public/css/main.min.css'
|
dest: 'public/assets/css/main.min.css'
|
||||||
},
|
},
|
||||||
sitejs: {
|
printcss: {
|
||||||
src: jsSite,
|
src: cssPrint,
|
||||||
dest: 'public/js/site.min.js'
|
dest: 'public/assets/css/print.min.css'
|
||||||
},
|
},
|
||||||
sitecss: {
|
adminltejs: {
|
||||||
src: cssSite,
|
src: jsAdminLTE,
|
||||||
dest: 'public/css/site.min.css'
|
dest: 'public/assets/plugins/adminlte/adminlte.min.js'
|
||||||
},
|
},
|
||||||
datatablesjs: {
|
datatablesjs: {
|
||||||
src: jsDataTables,
|
src: jsDataTables,
|
||||||
dest: 'public/js/datatables.min.js'
|
dest: 'public/assets/plugins/datatables.min.js'
|
||||||
},
|
},
|
||||||
datatablescss: {
|
datatablescss: {
|
||||||
src: cssDataTables,
|
src: cssDataTables,
|
||||||
dest: 'public/css/datatables.min.css'
|
dest: 'public/assets/plugins/datatables.min.css'
|
||||||
},
|
},
|
||||||
calendarjs: {
|
|
||||||
src: jsCalendar,
|
|
||||||
dest: 'public/js/calendar.min.js'
|
|
||||||
},
|
|
||||||
calendarcss: {
|
|
||||||
src: cssCalendar,
|
|
||||||
dest: 'public/css/calendar.min.css'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
cssmin: {
|
cssmin: {
|
||||||
options: {
|
options: {
|
||||||
@@ -239,7 +228,10 @@ module.exports = function(grunt) {
|
|||||||
target: {
|
target: {
|
||||||
files: [
|
files: [
|
||||||
{
|
{
|
||||||
'public/css/main.min.css': cssMain
|
'public/assets/css/main.min.css': cssMain
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'public/assets/css/print.min.css': cssPrint
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -249,33 +241,81 @@ module.exports = function(grunt) {
|
|||||||
files: [
|
files: [
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'node_modules/bootstrap/dist/fonts/',
|
cwd: 'node_modules/@fortawesome/fontawesome-free/webfonts/',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/fonts/'
|
dest: 'public/assets/fonts/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'node_modules/font-awesome/fonts/',
|
cwd: 'build/fonts',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/fonts/'
|
dest: 'public/assets/fonts/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'node_modules/summernote/dist/font/',
|
cwd: 'build/img',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/css/font/'
|
dest: 'public/assets/img/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'node_modules/datatables/media/images/',
|
cwd: 'build/lang',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/images/'
|
dest: 'public/assets/lang/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'node_modules/bootstrap4-toggle/',
|
cwd: 'build/plugins',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/assets/plugins/bootstrap4-toggle',
|
dest: 'public/assets/plugins/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'build/assets/tpl',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/tpl/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/owp.glyphicons/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/fonts/glyphicons'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/summernote/dist/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/summernote'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jquery.filer/assets/fonts/jquery.filer-icons/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/assets/fonts/jquery.filer-icons/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/icheck/skins/square/',
|
||||||
|
src: ['blue.png'],
|
||||||
|
dest: 'public/assets/apps/Admin/css/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/icheck/skins/square/',
|
||||||
|
src: ['blue@2x.png'],
|
||||||
|
dest: 'public/assets/apps/Admin/css/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/@claviska/jquery-minicolors/',
|
||||||
|
src: ['jquery.minicolors.png'],
|
||||||
|
dest: 'public/assets/css/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/@claviska/jquery-minicolors/',
|
||||||
|
src: ['jquery.minicolors.*'],
|
||||||
|
dest: 'public/assets/plugins/jquery-minicolors',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
@@ -285,9 +325,219 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'build/img/',
|
cwd: 'node_modules/jquery.quicksearch/dist/',
|
||||||
|
src: ['jquery.quicksearch.min.js.map'],
|
||||||
|
dest: 'public/assets/js/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jquery.quicksearch/dist/',
|
||||||
|
src: ['**/*.map'],
|
||||||
|
dest: 'public/js'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/pdfmake/build/',
|
||||||
|
src: ['pdfmake.min.js.map'],
|
||||||
|
dest: 'public/assets/plugins/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'build/Suite/js/widgets/daterangepicker/Lang',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/img/'
|
dest: 'public/assets/plugins/daterangepicker',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/chart.js/dist/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/chartjs'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/highcharts/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/highcharts'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/@highcharts/map-collection/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/highcharts/map',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/nestable2/dist/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/nestable2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jquery.fancytree/dist/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/fancytree'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-autocomplete/dist/latest/',
|
||||||
|
src: ['bootstrap-autocomplete.min.js'],
|
||||||
|
dest: 'public/assets/plugins/autocomplete'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/slick-carousel/slick/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/slick',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jquery-slimscroll/',
|
||||||
|
src: ['jquery.slimscroll.min.js'],
|
||||||
|
dest: 'public/assets/plugins',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jquery.nicescroll/dist/',
|
||||||
|
src: ['jquery.nicescroll.min.js'],
|
||||||
|
dest: 'public/assets/plugins',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap4-toggle/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap4-toggle',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/css/',
|
||||||
|
src: ['**/*.min.css'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap-fileinput/css',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/js/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap-fileinput/js',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/img/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap-fileinput/img',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/themes/fa/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap-fileinput/themes/fa',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/themes/fas/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap-fileinput/themes/fas',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/pdfobject/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/pdfobject',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'build/plugins/pdfjs/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/pdfjs',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap4-duallistbox/dist/',
|
||||||
|
src: ['*.min.*'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap4-duallistbox',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/select2/dist/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/select2',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/tempusdominus-bootstrap-4/build/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/datepicker',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/moment/min/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/moment',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/js/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/fileinput',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/css/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/fileinput',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/themes/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/fileinput',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/tinymce/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'build/js/include/plugins/datatables_lang/',
|
||||||
|
src: ['*.json'],
|
||||||
|
dest: 'public/assets/plugins/datatables_lang',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'vendor/sebastienheyd/boilerplate/src/public/plugins/tinymce/plugins/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce/plugins',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'vendor/sebastienheyd/boilerplate/src/resources/assets/js/vendor/tinymce/plugins/stickytoolbar/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce/plugins/stickytoolbar',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'vendor/sebastienheyd/boilerplate/src/resources/assets/js/vendor/tinymce/langs/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce/langs',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'vendor/sebastienheyd/boilerplate/src/resources/assets/js/vendor/tinymce/skins/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce/skins/ui',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'vendor/sebastienheyd/boilerplate/src/public/plugins/tinymce/skins/ui/boilerplate/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce/skins/ui/boilerplate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'build/js/include/',
|
||||||
|
src: ['boilerplate.js'],
|
||||||
|
dest: 'public/assets/plugins',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
@@ -295,11 +545,21 @@ module.exports = function(grunt) {
|
|||||||
watch: {
|
watch: {
|
||||||
dist: {
|
dist: {
|
||||||
files: [
|
files: [
|
||||||
'build/*',
|
'Admin/*',
|
||||||
],
|
],
|
||||||
tasks: ['concat', 'copy']
|
tasks: ['concat', 'copy']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handlebars: {
|
||||||
|
compile: {
|
||||||
|
options: {
|
||||||
|
namespace: "JST"
|
||||||
|
},
|
||||||
|
files: {
|
||||||
|
"assets/tpl/content.hbs": "public/assets/tpl/content.hbs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Load the plugin that provides the "uglify" task.
|
// Load the plugin that provides the "uglify" task.
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class Kernel extends ConsoleKernel
|
|||||||
/**
|
/**
|
||||||
* Define the application's command schedule.
|
* Define the application's command schedule.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule)
|
||||||
@@ -37,6 +37,6 @@ class Kernel extends ConsoleKernel
|
|||||||
{
|
{
|
||||||
$this->load(__DIR__.'/Commands');
|
$this->load(__DIR__.'/Commands');
|
||||||
|
|
||||||
require base_path('routes/console.php');
|
include base_path('routes/console.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,25 +8,24 @@ use App\Models\Botanic\Family;
|
|||||||
|
|
||||||
class FamiliesDataTable extends DataTable
|
class FamiliesDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'families';
|
public $model_name = 'families';
|
||||||
|
|
||||||
public function query(Family $model)
|
public function query(Family $model)
|
||||||
{
|
{
|
||||||
$model = $model::withCount(['genres','species','varieties']);
|
$model = $model::withCount(['genres','species','varieties']);
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('alias'),
|
|
||||||
Column::make('latin'),
|
|
||||||
Column::make('genres_count')->title('Nb genres')->searchable(false)->addClass('text-right'),
|
|
||||||
Column::make('species_count')->title('Nb espèces')->searchable(false)->addClass('text-right'),
|
|
||||||
Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('alias'),
|
||||||
|
Column::make('latin'),
|
||||||
|
Column::make('genres_count')->title('Nb genres')->searchable(false)->addClass('text-right'),
|
||||||
|
Column::make('species_count')->title('Nb espèces')->searchable(false)->addClass('text-right'),
|
||||||
|
Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,11 +19,12 @@ class GenresDataTable extends DataTable
|
|||||||
public function modifier($datatables)
|
public function modifier($datatables)
|
||||||
{
|
{
|
||||||
$datatables
|
$datatables
|
||||||
->editColumn('family_name', function(Genre $genre) {
|
->editColumn(
|
||||||
return $genre->family ? $genre->family->name : '';
|
'family_name', function (Genre $genre) {
|
||||||
})
|
return $genre->family ? $genre->family->name : '';
|
||||||
->rawColumns(['genre_name', 'action'])
|
}
|
||||||
;
|
)
|
||||||
|
->rawColumns(['genre_name', 'action']);
|
||||||
return Parent::modifier($datatables);
|
return Parent::modifier($datatables);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,5 +40,4 @@ class GenresDataTable extends DataTable
|
|||||||
self::makeColumnButtons(),
|
self::makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,36 +8,36 @@ use App\Models\Botanic\Specie;
|
|||||||
|
|
||||||
class SpeciesDataTable extends DataTable
|
class SpeciesDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'species';
|
public $model_name = 'species';
|
||||||
|
|
||||||
public function query(Specie $model)
|
public function query(Specie $model)
|
||||||
{
|
{
|
||||||
$model = $model::withCount('varieties')->with('genre');
|
$model = $model::withCount('varieties')->with('genre');
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function modifier($datatables)
|
public function modifier($datatables)
|
||||||
{
|
{
|
||||||
$datatables
|
$datatables
|
||||||
->editColumn('genre_name', function(Specie $specie) {
|
->editColumn(
|
||||||
return $specie->genre ? $specie->genre->name : '';
|
'genre_name', function (Specie $specie) {
|
||||||
})
|
return $specie->genre ? $specie->genre->name : '';
|
||||||
->rawColumns(['genre_name', 'action'])
|
}
|
||||||
;
|
)
|
||||||
return Parent::modifier($datatables);
|
->rawColumns(['genre_name', 'action']);
|
||||||
}
|
return Parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getColumns()
|
protected function getColumns()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
Column::make('name')->title('Nom'),
|
Column::make('name')->title('Nom'),
|
||||||
Column::make('alias'),
|
Column::make('alias'),
|
||||||
Column::make('genre.name')->data('genre_name')->title('Genre'),
|
Column::make('genre.name')->data('genre_name')->title('Genre'),
|
||||||
Column::make('latin'),
|
Column::make('latin'),
|
||||||
Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'),
|
Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'),
|
||||||
self::makeColumnButtons(),
|
self::makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,39 +8,40 @@ use App\Models\Botanic\Variety;
|
|||||||
|
|
||||||
class VarietiesDataTable extends DataTable
|
class VarietiesDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'varieties';
|
public $model_name = 'varieties';
|
||||||
|
|
||||||
public function query(Variety $model)
|
public function query(Variety $model)
|
||||||
{
|
{
|
||||||
// $model = $model::with('specie')->withCount('Articles')->select('botanic_varieties.*');
|
// $model = $model::with('specie')->withCount('Articles')->select('botanic_varieties.*');
|
||||||
$model = $model::joinRelations('Specie')->select('botanic_varieties.*','botanic_species.name as specie_name')->with('Specie')->withCount('Articles');
|
$model = $model::joinRelations('Specie')->select('botanic_varieties.*', 'botanic_species.name as specie_name')->with('Specie')->withCount('Articles');
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function modifier($datatables)
|
public function modifier($datatables)
|
||||||
{
|
{
|
||||||
$datatables
|
$datatables
|
||||||
->editColumn('photo', function(Variety $variety) {
|
->editColumn(
|
||||||
$media = $variety->getFirstMedia();
|
'photo', function (Variety $variety) {
|
||||||
dump($variety);
|
$media = $variety->getFirstMedia();
|
||||||
return "{{ $media('thumb') }}";
|
// dump($media);
|
||||||
})
|
// return $media('thumb');
|
||||||
->rawColumns(['photo', 'action'])
|
return '';
|
||||||
;
|
}
|
||||||
return Parent::modifier($datatables);
|
)
|
||||||
}
|
->rawColumns(['photo', 'action']);
|
||||||
|
return Parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getColumns()
|
protected function getColumns()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
Column::make('Specie.name')->data('specie_name')->title('Espèce'),
|
Column::make('Specie.name')->data('specie_name')->title('Espèce'),
|
||||||
Column::make('name')->title('Nom'),
|
Column::make('name')->title('Nom'),
|
||||||
Column::make('articles_count')->title('Nb articles')->class('text-right')->searchable(false),
|
Column::make('articles_count')->title('Nb articles')->class('text-right')->searchable(false),
|
||||||
Column::make('photo')->title('')->searchable(false)->orderable(false),
|
Column::make('photo')->title('')->searchable(false)->orderable(false),
|
||||||
self::makeColumnButtons(),
|
self::makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,195 +10,200 @@ use Yajra\DataTables\Services\DataTable;
|
|||||||
|
|
||||||
class ParentDataTable extends DataTable
|
class ParentDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $rowReorder = true;
|
public $rowReorder = true;
|
||||||
public $rowReorderSelector; // ['selector' => 'tr']
|
public $rowReorderSelector; // ['selector' => 'tr']
|
||||||
public $colReorder = false;
|
public $colReorder = false;
|
||||||
public $fixedColumns = false;
|
public $fixedColumns = false;
|
||||||
public $scrollX = false;
|
public $scrollX = false;
|
||||||
public $scrollCollapse = true;
|
public $scrollCollapse = true;
|
||||||
public $sortedColumn = 0;
|
public $sortedColumn = 0;
|
||||||
public $sortedOrder = 'asc';
|
public $sortedOrder = 'asc';
|
||||||
public $stateSave = false;
|
public $stateSave = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build DataTable class.
|
* Build DataTable class.
|
||||||
*
|
*
|
||||||
* @param mixed $query Results from query() method.
|
* @param mixed $query Results from query() method.
|
||||||
* @return \Yajra\DataTables\DataTableAbstract
|
* @return \Yajra\DataTables\DataTableAbstract
|
||||||
*/
|
*/
|
||||||
public function dataTable($query)
|
public function dataTable($query)
|
||||||
{
|
{
|
||||||
return $this->modifier(datatables()->eloquent($query));
|
return $this->modifier(datatables()->eloquent($query));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function modifier($datatables)
|
public function modifier($datatables)
|
||||||
{
|
{
|
||||||
return $this->addButtons($datatables->setRowId('{{$id}}'));
|
return $this->addButtons($datatables->setRowId('{{$id}}'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add buttons DataTable class.
|
* Add buttons DataTable class.
|
||||||
*
|
*
|
||||||
* @param mixed $query Results from query() method.
|
* @param mixed $query Results from query() method.
|
||||||
* @return \Yajra\DataTables\DataTableAbstract
|
* @return \Yajra\DataTables\DataTableAbstract
|
||||||
*/
|
*/
|
||||||
public function addButtons($datatables)
|
public function addButtons($datatables)
|
||||||
{
|
{
|
||||||
return $datatables->addColumn('action', $this->getHtmlButtons());
|
return $datatables->addColumn('action', $this->getHtmlButtons());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHtmlButtons()
|
public function getHtmlButtons()
|
||||||
{
|
{
|
||||||
$buttons = '';
|
$buttons = '';
|
||||||
|
|
||||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-secondary btn-show mr-2"><i class="fa fa-fw fa-eye"></i></button>';
|
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-secondary btn-show mr-2"><i class="fa fa-fw fa-eye"></i></button>';
|
||||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-leaf-alt"></i></button>';
|
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-leaf-alt"></i></button>';
|
||||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-pencil-alt"></i></button>';
|
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-pencil-alt"></i></button>';
|
||||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-danger btn-del"><i class="fa fa-fw fa-trash"></i></button>';
|
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-danger btn-del"><i class="fa fa-fw fa-trash"></i></button>';
|
||||||
return $buttons;
|
return $buttons;
|
||||||
// return view('components.datatables.buttons.row_action');
|
// return view('components.datatables.buttons.row_action');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function makeColumnButtons()
|
public function makeColumnButtons()
|
||||||
{
|
{
|
||||||
return Column::computed('action')
|
return Column::computed('action')
|
||||||
->title('')
|
->title('')
|
||||||
->exportable(false)
|
->exportable(false)
|
||||||
->printable(false)
|
->printable(false)
|
||||||
->searchable(false)
|
->searchable(false)
|
||||||
->width("74")
|
->width("74")
|
||||||
->addClass('text-center text-nowrap');
|
->addClass('text-center text-nowrap');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isFilteredByField($field)
|
public static function isFilteredByField($field)
|
||||||
{
|
{
|
||||||
return (request()->has('filters.' . $field)) ? request()->input('filters.'. $field) : (request()->has($field) ? request()->input($field) : false);
|
return (request()->has('filters.' . $field)) ? request()->input('filters.'. $field) : (request()->has($field) ? request()->input($field) : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get query source of dataTable.
|
* Get query source of dataTable.
|
||||||
*
|
*
|
||||||
* @param \App\Family $model
|
* @param \App\Family $model
|
||||||
* @return \Illuminate\Database\Eloquent\Builder
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
*/
|
*/
|
||||||
public function buildQuery($model)
|
public function buildQuery($model)
|
||||||
{
|
{
|
||||||
return $model->newQuery();
|
return $model->newQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional method if you want to use html builder.
|
* Optional method if you want to use html builder.
|
||||||
*
|
*
|
||||||
* @return \Yajra\DataTables\Html\Builder
|
* @return \Yajra\DataTables\Html\Builder
|
||||||
*/
|
*/
|
||||||
public function html()
|
public function html()
|
||||||
{
|
{
|
||||||
return $this->buildHtml(strtolower($this->model_name) . '-table');
|
return $this->buildHtml(strtolower($this->model_name) . '-table');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional method if you want to use html builder.
|
* Optional method if you want to use html builder.
|
||||||
*
|
*
|
||||||
* @return \Yajra\DataTables\Html\Builder
|
* @return \Yajra\DataTables\Html\Builder
|
||||||
*/
|
*/
|
||||||
public function buildHtml($table_id = false, $selector = false)
|
public function buildHtml($table_id = false, $selector = false)
|
||||||
{
|
{
|
||||||
$table_id = $table_id ? $table_id : strtolower($this->model_name) . '-table';
|
$table_id = $table_id ? $table_id : strtolower($this->model_name) . '-table';
|
||||||
$selector = $selector ? $selector : '#' . $this->model_name . '-filters';
|
$selector = $selector ? $selector : '#' . $this->model_name . '-filters';
|
||||||
return $this->builder()
|
return $this->builder()
|
||||||
->setTableId($table_id)
|
->setTableId($table_id)
|
||||||
->parameters($this->getParameters())
|
->parameters($this->getParameters())
|
||||||
->columns($this->getColumns())
|
->columns($this->getColumns())
|
||||||
->ajax([
|
->ajax(
|
||||||
'data' => 'function(d) { d.filters = $("' . $selector . '").serializeJSON(); }',
|
[
|
||||||
'url' => isset($this->url) ? $this->url : ''
|
'data' => 'function(d) { d.filters = $("' . $selector . '").serializeJSON(); }',
|
||||||
])
|
'url' => isset($this->url) ? $this->url : ''
|
||||||
->dom($this->getDom())
|
]
|
||||||
->orderBy($this->sortedColumn,$this->sortedOrder)
|
)
|
||||||
->buttons($this->getButtons());
|
->dom($this->getDom())
|
||||||
}
|
->orderBy($this->sortedColumn, $this->sortedOrder)
|
||||||
|
->buttons($this->getButtons());
|
||||||
|
}
|
||||||
|
|
||||||
public function getButtons() {
|
public function getButtons()
|
||||||
return [
|
{
|
||||||
Button::make('export'),
|
return [
|
||||||
Button::make('print'),
|
Button::make('export'),
|
||||||
Button::make('colvis'),
|
Button::make('print'),
|
||||||
Button::make('columnsToggle')
|
Button::make('colvis'),
|
||||||
];
|
Button::make('columnsToggle')
|
||||||
}
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function getParameters()
|
public function getParameters()
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'pageLength' => 5,
|
'pageLength' => 5,
|
||||||
'scrollX' => $this->scrollX,
|
'scrollX' => $this->scrollX,
|
||||||
'scrollCollapse' => $this->scrollCollapse,
|
'scrollCollapse' => $this->scrollCollapse,
|
||||||
'searchDelay' => 500,
|
'searchDelay' => 500,
|
||||||
'colReorder' => $this->colReorder,
|
'colReorder' => $this->colReorder,
|
||||||
'fixedColumns' => $this->fixedColumns,
|
'fixedColumns' => $this->fixedColumns,
|
||||||
// 'autoWidth' => false,
|
// 'autoWidth' => false,
|
||||||
'stateSave' => $this->stateSave
|
'stateSave' => $this->stateSave
|
||||||
];
|
];
|
||||||
if ($this->rowReorder) {
|
if ($this->rowReorder) {
|
||||||
$data['rowReorder'] = ['selector' => $this->rowReorderSelector];
|
$data['rowReorder'] = ['selector' => $this->rowReorderSelector];
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDom()
|
public function getDom()
|
||||||
{
|
{
|
||||||
$dom = '';
|
$dom = '';
|
||||||
// $dom .= $this->getDatatablesHeaderDefault();
|
// $dom .= $this->getDatatablesHeaderDefault();
|
||||||
$dom .= "rt";
|
$dom .= "rt";
|
||||||
$dom .= $this->getDatatablesFooterDefault();
|
$dom .= $this->getDatatablesFooterDefault();
|
||||||
return $dom;
|
return $dom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDatatablesHeader() {
|
public function getDatatablesHeader()
|
||||||
return view('components.datatables.header');
|
{
|
||||||
}
|
return view('components.datatables.header');
|
||||||
|
}
|
||||||
|
|
||||||
public function getDatatablesHeaderDefault() {
|
public function getDatatablesHeaderDefault()
|
||||||
// return "<div class'row'><div class='col'></div></div>";
|
{
|
||||||
/*
|
// return "<div class'row'><div class='col'></div></div>";
|
||||||
|
/*
|
||||||
$dom = 't<"row datatable-pager light"<"col-md-12"'
|
|
||||||
. '<"datatable-more-export-buttons filter-buttons pull-left">'
|
|
||||||
. '<"datatable-more-export-favorites-buttons filter-buttons pull-left">'
|
|
||||||
. '<"datatable-more-export-basket-buttons filter-buttons pull-left">'
|
|
||||||
. '<"datatable-download-buttons filter-buttons pull-left">'
|
|
||||||
. '>>'
|
|
||||||
. '<"dt-toolbar-footer"<"col"i><"col pull-right datatable-pager light nopadding-right"p>>';
|
|
||||||
|
|
||||||
*/
|
$dom = 't<"row datatable-pager light"<"col-md-12"'
|
||||||
|
. '<"datatable-more-export-buttons filter-buttons pull-left">'
|
||||||
$dom = "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>";
|
. '<"datatable-more-export-favorites-buttons filter-buttons pull-left">'
|
||||||
return $dom;
|
. '<"datatable-more-export-basket-buttons filter-buttons pull-left">'
|
||||||
// return 't<"row datatable-pager light"<"col-md-12"<"datatable-more-export-buttons filter-buttons pull-left"><"datatable-more-export-favorites-buttons filter-buttons pull-left"><"datatable-more-export-basket-buttons filter-buttons pull-left"><"datatable-download-buttons filter-buttons pull-left">>><"dt-toolbar-footer"<"col-md-6"i><"col-md-6 pull-right datatable-pager light nopadding-right"p>>';
|
. '<"datatable-download-buttons filter-buttons pull-left">'
|
||||||
|
. '>>'
|
||||||
|
. '<"dt-toolbar-footer"<"col"i><"col pull-right datatable-pager light nopadding-right"p>>';
|
||||||
|
|
||||||
}
|
*/
|
||||||
|
|
||||||
|
$dom = "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>";
|
||||||
|
return $dom;
|
||||||
|
// return 't<"row datatable-pager light"<"col-md-12"<"datatable-more-export-buttons filter-buttons pull-left"><"datatable-more-export-favorites-buttons filter-buttons pull-left"><"datatable-more-export-basket-buttons filter-buttons pull-left"><"datatable-download-buttons filter-buttons pull-left">>><"dt-toolbar-footer"<"col-md-6"i><"col-md-6 pull-right datatable-pager light nopadding-right"p>>';
|
||||||
|
}
|
||||||
|
|
||||||
public function getDatatablesFooterDefault() {
|
public function getDatatablesFooterDefault()
|
||||||
return "<'row pt-3 dt-toolbar-footer'<'col-md-6'i><'col-md-6'p>>";
|
{
|
||||||
}
|
return "<'row pt-3 dt-toolbar-footer'<'col-md-6'i><'col-md-6'p>>";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get filename for export.
|
* Get filename for export.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function filename()
|
protected function filename()
|
||||||
{
|
{
|
||||||
return self::buildFilename($this->model_name);
|
return self::buildFilename($this->model_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get filename for export.
|
* Get filename for export.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function buildFilename($name)
|
protected function buildFilename($name)
|
||||||
{
|
{
|
||||||
return $name . '_' . date('YmdHis');
|
return $name . '_' . date('YmdHis');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\ArticleFamily;
|
|
||||||
|
|
||||||
class ArticleFamiliesDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'article_families';
|
|
||||||
|
|
||||||
public function query(ArticleFamily $model)
|
|
||||||
{
|
|
||||||
$model = $model::withCount('Articles');
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('articles_count')->title('Nb articles')->addClass('text-right'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
27
app/Datatables/Shop/ArticleNaturesDataTable.php
Normal file
27
app/Datatables/Shop/ArticleNaturesDataTable.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\ArticleNature;
|
||||||
|
|
||||||
|
class ArticleNaturesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'article_natures';
|
||||||
|
|
||||||
|
public function query(ArticleNature $model)
|
||||||
|
{
|
||||||
|
$model = $model::withCount('Articles');
|
||||||
|
return self::buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('articles_count')->title('Nb articles')->addClass('text-right'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,24 +8,22 @@ use App\Models\Shop\Article;
|
|||||||
|
|
||||||
class ArticlesDataTable extends DataTable
|
class ArticlesDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'articles';
|
public $model_name = 'articles';
|
||||||
|
|
||||||
public function query(Article $model)
|
public function query(Article $model)
|
||||||
{
|
{
|
||||||
// $model = $model::with('Family')->select('shop_articles.*','family.name as family_name')->join('shop_article_families as family', 'family.id', '=', 'shop_articles.article_family_id')->groupBy('shop_articles.id');
|
// $model = $model::with('Family')->select('shop_articles.*','family.name as family_name')->join('shop_article_families as family', 'family.id', '=', 'shop_articles.article_family_id')->groupBy('shop_articles.id');
|
||||||
$model = $model::with('article_family')->select('shop_articles.*');
|
$model = $model::with('article_nature')->select('shop_articles.*');
|
||||||
// $model = $model::joinRelations('Family')->select('shop_articles.*','shop_article_families.name as family_name');
|
// $model = $model::joinRelations('Family')->select('shop_articles.*','shop_article_families.name as family_name');
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('article_family.name')->title('Famille')->orderable(false),
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('article_nature.name')->title('Nature')->orderable(false),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,21 +8,20 @@ use App\Models\Shop\Category;
|
|||||||
|
|
||||||
class CategoriesDataTable extends DataTable
|
class CategoriesDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'categories';
|
public $model_name = 'categories';
|
||||||
|
|
||||||
public function query(Category $model)
|
public function query(Category $model)
|
||||||
{
|
{
|
||||||
$model = $model::withCount('articles');
|
$model = $model::withCount('articles');
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('articles_count')->title('Nb Articles')->class('text-right')->searchable(false),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('articles_count')->title('Nb Articles')->class('text-right')->searchable(false),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,22 +8,21 @@ use App\Models\Shop\Customer;
|
|||||||
|
|
||||||
class CustomersDataTable extends DataTable
|
class CustomersDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'customers';
|
public $model_name = 'customers';
|
||||||
|
|
||||||
public function query(Customer $model)
|
public function query(Customer $model)
|
||||||
{
|
{
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('address')->title('Adresse'),
|
|
||||||
Column::make('zipcode')->title('Code postal'),
|
|
||||||
Column::make('city')->title('Ville'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('address')->title('Adresse'),
|
||||||
|
Column::make('zipcode')->title('Code postal'),
|
||||||
|
Column::make('city')->title('Ville'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,21 +8,20 @@ use App\Models\Shop\Invoice;
|
|||||||
|
|
||||||
class InvoicesDataTable extends DataTable
|
class InvoicesDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'Invoices';
|
public $model_name = 'Invoices';
|
||||||
|
|
||||||
public function query(Invoice $model)
|
public function query(Invoice $model)
|
||||||
{
|
{
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('status.name'),
|
|
||||||
Column::make('customer.name'),
|
|
||||||
Column::make('total'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('status.name'),
|
||||||
|
Column::make('customer.name'),
|
||||||
|
Column::make('total'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
28
app/Datatables/Shop/OffersDataTable.php
Normal file
28
app/Datatables/Shop/OffersDataTable.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Offer;
|
||||||
|
|
||||||
|
class OffersDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'tariffs';
|
||||||
|
|
||||||
|
public function query(Offer $model)
|
||||||
|
{
|
||||||
|
$model = $model->with(['article','variation','tariff'])->select(['shop_offers.*']);
|
||||||
|
return self::buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('article.name')->title('Article'),
|
||||||
|
Column::make('variation.name')->title('Déclinaison'),
|
||||||
|
Column::make('tariff.name')->title('Tarif'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,19 +8,18 @@ use App\Models\Shop\Order;
|
|||||||
|
|
||||||
class OrdersDataTable extends DataTable
|
class OrdersDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'orders';
|
public $model_name = 'orders';
|
||||||
|
|
||||||
public function query(Product $model)
|
public function query(Product $model)
|
||||||
{
|
{
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,28 +8,18 @@ use App\Models\Shop\Package;
|
|||||||
|
|
||||||
class PackagesDataTable extends DataTable
|
class PackagesDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'packages';
|
public $model_name = 'packages';
|
||||||
|
|
||||||
public function query(Package $model)
|
public function query(Package $model)
|
||||||
{
|
{
|
||||||
$model = $model::with(['article_family'])->select('shop_packages.*');
|
return self::buildQuery($model);
|
||||||
$model = self::filterByFamily($model);
|
}
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function filterByFamily($model, $family_id = false)
|
|
||||||
{
|
|
||||||
$family_id = $family_id ? $family_id : self::isFilteredByField('family_id');
|
|
||||||
return $family_id ? $model->byArticleFamily($family_id) : $model;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('article_family.name')->title('Famille d\'articles'),
|
|
||||||
Column::make('value')->title('Valeur'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('value')->title('Valeur'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,21 +8,20 @@ use App\Models\Shop\PriceGenericCategory;
|
|||||||
|
|
||||||
class PriceGenericCategoriesDataTable extends DataTable
|
class PriceGenericCategoriesDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'price_generic_categories';
|
public $model_name = 'price_generic_categories';
|
||||||
|
|
||||||
public function query(PriceGenericCategory $model)
|
public function query(PriceGenericCategory $model)
|
||||||
{
|
{
|
||||||
$model = $model->withCount('price_generics');
|
$model = $model->withCount('price_generics');
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('price_generics_count')->title('Nb Tarifs')->class('text-right'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('price_generics_count')->title('Nb Tarifs')->class('text-right'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\PriceGeneric;
|
|
||||||
|
|
||||||
class PriceGenericsDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'price_generics';
|
|
||||||
|
|
||||||
public function query(PriceGeneric $model)
|
|
||||||
{
|
|
||||||
$model = $model::with(['category','priceByUnit'])->withCount('prices');
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('category.name')->title('Catégorie'),
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('price_by_unit.price')->title('Prix HT')->class('text-right'),
|
|
||||||
Column::make('price_by_unit.price_taxed')->title('Prix TTC')->class('text-right'),
|
|
||||||
Column::make('prices_count')->title('Nb tarifs')->class('text-right'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
38
app/Datatables/Shop/PriceListsDataTable.php
Normal file
38
app/Datatables/Shop/PriceListsDataTable.php
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\PriceList;
|
||||||
|
|
||||||
|
class PriceListsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'price_lists';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = route('Admin.Shop.PriceLists.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query(PriceList $model)
|
||||||
|
{
|
||||||
|
$model = self::filterByTariff($model);
|
||||||
|
return self::buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function filterByTariff($model, $tariff_id = false)
|
||||||
|
{
|
||||||
|
$tariff_id = $tariff_id ? $tariff_id : self::isFilteredByField('tariff_id');
|
||||||
|
return $tariff_id ? $model->byTariff($tariff_id) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
25
app/Datatables/Shop/SaleChannelsDataTable.php
Normal file
25
app/Datatables/Shop/SaleChannelsDataTable.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\SaleChannel;
|
||||||
|
|
||||||
|
class SaleChannelsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'sale_channels';
|
||||||
|
|
||||||
|
public function query(SaleChannel $model)
|
||||||
|
{
|
||||||
|
return self::buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,21 +8,20 @@ use App\Models\Shop\TagGroup;
|
|||||||
|
|
||||||
class TagGroupsDataTable extends DataTable
|
class TagGroupsDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'tag_groups';
|
public $model_name = 'tag_groups';
|
||||||
|
|
||||||
public function query(TagGroup $model)
|
public function query(TagGroup $model)
|
||||||
{
|
{
|
||||||
$model = $model::withCount('tags');
|
$model = $model::withCount('tags');
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name'),
|
|
||||||
Column::make('tags_count')->title('Nb de tags')->searchable(false)->addClass('text-right'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name'),
|
||||||
|
Column::make('tags_count')->title('Nb de tags')->searchable(false)->addClass('text-right'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,23 +8,22 @@ use App\Models\Shop\Tag;
|
|||||||
|
|
||||||
class TagsDataTable extends DataTable
|
class TagsDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'tags';
|
public $model_name = 'tags';
|
||||||
public $rowReorder = ['selector' => 'tr'];
|
public $rowReorder = ['selector' => 'tr'];
|
||||||
|
|
||||||
public function query(Tag $model)
|
public function query(Tag $model)
|
||||||
{
|
{
|
||||||
$model = $model::with('group')->select(['tags.*']);
|
$model = $model::with('group')->select(['tags.*']);
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('group.name')->title('Groupe'),
|
|
||||||
Column::make('sort_order')->title('Ordre'),
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('group.name')->title('Groupe'),
|
||||||
|
Column::make('sort_order')->title('Ordre'),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
29
app/Datatables/Shop/TariffsDataTable.php
Normal file
29
app/Datatables/Shop/TariffsDataTable.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Tariff;
|
||||||
|
|
||||||
|
class TariffsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'tariffs';
|
||||||
|
|
||||||
|
public function query(Tariff $model)
|
||||||
|
{
|
||||||
|
$model = $model->with(['sale_channel'])->select(['shop_tariffs.*']);
|
||||||
|
return self::buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('sale_channel.name')->title('Canal de vente'),
|
||||||
|
Column::make('code')->title('Code'),
|
||||||
|
Column::make('ref')->title('Référence'),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,29 +8,18 @@ use App\Models\Shop\Unity;
|
|||||||
|
|
||||||
class UnitiesDataTable extends DataTable
|
class UnitiesDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'unities';
|
public $model_name = 'unities';
|
||||||
|
|
||||||
public function query(Unity $model)
|
public function query(Unity $model)
|
||||||
{
|
{
|
||||||
$model = $model::with(['package.article_family'])->select('shop_unities.*');
|
return self::buildQuery($model);
|
||||||
$model = self::filterByFamily($model);
|
}
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function filterByFamily($model, $family_id = false)
|
|
||||||
{
|
|
||||||
$family_id = $family_id ? $family_id : self::isFilteredByField('family_id');
|
|
||||||
return $family_id ? $model->byArticleFamily($family_id) : $model;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('package.article_family.name')->title('Famille'),
|
|
||||||
Column::make('package.value')->title('Package'),
|
|
||||||
Column::make('value')->title('Valeur'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('value')->title('Valeur'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
28
app/Datatables/Shop/VariationsDataTable.php
Normal file
28
app/Datatables/Shop/VariationsDataTable.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Variation;
|
||||||
|
|
||||||
|
class VariationsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'variations';
|
||||||
|
|
||||||
|
public function query(Variation $model)
|
||||||
|
{
|
||||||
|
$model = $model->with(['package','unity']);
|
||||||
|
return self::buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('package.value')->title('Package'),
|
||||||
|
Column::make('quantity')->title('Quantité')->class('text-right'),
|
||||||
|
Column::make('unity.value')->title('Unité'),
|
||||||
|
self::makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,7 +29,7 @@ class Handler extends ExceptionHandler
|
|||||||
/**
|
/**
|
||||||
* Report or log an exception.
|
* Report or log an exception.
|
||||||
*
|
*
|
||||||
* @param \Exception $exception
|
* @param \Exception $exception
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -42,8 +42,8 @@ class Handler extends ExceptionHandler
|
|||||||
/**
|
/**
|
||||||
* Render an exception into an HTTP response.
|
* Render an exception into an HTTP response.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Exception $exception
|
* @param \Exception $exception
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ class FamiliesExport implements FromQuery
|
|||||||
{
|
{
|
||||||
use Exportable;
|
use Exportable;
|
||||||
|
|
||||||
public function query()
|
public function query()
|
||||||
{
|
{
|
||||||
return Family::query();
|
return Family::query();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ class GenresExport implements FromQuery
|
|||||||
{
|
{
|
||||||
use Exportable;
|
use Exportable;
|
||||||
|
|
||||||
public function query()
|
public function query()
|
||||||
{
|
{
|
||||||
return Genre::query();
|
return Genre::query();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ class SpeciesExport implements FromQuery
|
|||||||
{
|
{
|
||||||
use Exportable;
|
use Exportable;
|
||||||
|
|
||||||
public function query()
|
public function query()
|
||||||
{
|
{
|
||||||
return Specie::query();
|
return Specie::query();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ class VarietiesExport implements FromQuery
|
|||||||
{
|
{
|
||||||
use Exportable;
|
use Exportable;
|
||||||
|
|
||||||
public function query()
|
public function query()
|
||||||
{
|
{
|
||||||
return Variety::query();
|
return Variety::query();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
13
app/Http/Controllers/Admin/Botanic/Controller.php
Normal file
13
app/Http/Controllers/Admin/Botanic/Controller.php
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Botanic;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||||
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
|
|
||||||
|
class Controller extends BaseController
|
||||||
|
{
|
||||||
|
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||||
|
}
|
||||||
55
app/Http/Controllers/Admin/Botanic/FamilyController.php
Normal file
55
app/Http/Controllers/Admin/Botanic/FamilyController.php
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Botanic;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use App\Repositories\Botanic\Families;
|
||||||
|
use App\Datatables\Botanic\FamiliesDataTable;
|
||||||
|
|
||||||
|
class FamilyController extends Controller
|
||||||
|
{
|
||||||
|
public function index(FamiliesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Botanic.Families.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatable(Request $request)
|
||||||
|
{
|
||||||
|
return Families::getTables($request->all());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Botanic.Families.create', $data ?? []);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$ret = Families::store($data);
|
||||||
|
return redirect()->route('Admin.Botanic.Families.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = Families::get($id);
|
||||||
|
return view('Admin.Botanic.Families.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['family'] = Families::get($id)->toArray();
|
||||||
|
return view('Admin.Botanic.Families.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Families::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function exportExcel()
|
||||||
|
{
|
||||||
|
return Families::exportExcel();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Botanic\Admin;
|
namespace App\Http\Controllers\Admin\Botanic;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Botanic\Genres;
|
use App\Repositories\Botanic\Genres;
|
||||||
use App\Repositories\Botanic\Families;
|
use App\Repositories\Botanic\Families;
|
||||||
@@ -13,7 +12,7 @@ class GenreController extends Controller
|
|||||||
{
|
{
|
||||||
public function index(GenresDataTable $dataTable)
|
public function index(GenresDataTable $dataTable)
|
||||||
{
|
{
|
||||||
return $dataTable->render('Botanic.Admin.Genres.list');
|
return $dataTable->render('Admin.Botanic.Genres.list');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
public function getDatatable(Request $request)
|
||||||
@@ -23,26 +22,27 @@ class GenreController extends Controller
|
|||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
return view('Botanic.Admin.Genres.create');
|
$data['families'] = Families::getOptions();
|
||||||
|
return view('Admin.Botanic.Genres.create', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$ret = Genres::store($request);
|
$ret = Genres::store($request);
|
||||||
return redirect()->route('Botanic.Admin.Genres.index');
|
return redirect()->route('Admin.Botanic.Genres.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$data = Genres::get($id);
|
$data['genre'] = Genres::get($id);
|
||||||
return view('Botanic.Admin.Genres.view', $data);
|
return view('Admin.Botanic.Genres.view', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data = Genres::get($id);
|
$data['genre'] = Genres::get($id);
|
||||||
$data['families'] = Families::getOptions();
|
$data['families'] = Families::getOptions();
|
||||||
return view('Botanic.Admin.Genres.edit', $data);
|
return view('Admin.Botanic.Genres.edit', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
@@ -50,9 +50,8 @@ class GenreController extends Controller
|
|||||||
return Genres::destroy($id);
|
return Genres::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function exportExcel()
|
public function exportExcel()
|
||||||
{
|
{
|
||||||
return Genres::exportExcel();
|
return Genres::exportExcel();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
63
app/Http/Controllers/Admin/Botanic/SpecieController.php
Normal file
63
app/Http/Controllers/Admin/Botanic/SpecieController.php
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Botanic;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use App\Repositories\Botanic\Species;
|
||||||
|
use App\Repositories\Botanic\Genres;
|
||||||
|
use App\Datatables\Botanic\SpeciesDataTable;
|
||||||
|
|
||||||
|
class SpecieController extends Controller
|
||||||
|
{
|
||||||
|
public function index(SpeciesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Botanic.Species.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatable(Request $request)
|
||||||
|
{
|
||||||
|
return Species::getDatatable($request->all());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOptions()
|
||||||
|
{
|
||||||
|
return response()->json(Species::getOptions());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data['genres'] = Genres::getOptions();
|
||||||
|
return view('Admin.Botanic.Species.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$ret = Species::store($data);
|
||||||
|
return redirect()->route('Admin.Botanic.Species.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = Species::get($id);
|
||||||
|
return view('Admin.Botanic.Species.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['specie'] = Species::get($id);
|
||||||
|
$data['genres'] = Genres::getOptions();
|
||||||
|
return view('Admin.Botanic.Species.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Species::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function exportExcel()
|
||||||
|
{
|
||||||
|
return Species::exportExcel();
|
||||||
|
}
|
||||||
|
}
|
||||||
77
app/Http/Controllers/Admin/Botanic/VarietyController.php
Normal file
77
app/Http/Controllers/Admin/Botanic/VarietyController.php
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Botanic;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use App\Repositories\Botanic\Varieties;
|
||||||
|
use App\Repositories\Botanic\Species;
|
||||||
|
use App\Repositories\Shop\TagGroups;
|
||||||
|
use App\Datatables\Botanic\VarietiesDataTable;
|
||||||
|
|
||||||
|
use App\Models\Shop\Variety;
|
||||||
|
|
||||||
|
class VarietyController extends Controller
|
||||||
|
{
|
||||||
|
public function index(VarietiesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Botanic.Varieties.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOptionsWithSpecie()
|
||||||
|
{
|
||||||
|
return response()->json(Varieties::getOptionsWithSpecie());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data['species'] = Species::getOptions();
|
||||||
|
$data['tags_list'] = TagGroups::getTreeTags();
|
||||||
|
return view('Admin.Botanic.Varieties.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
Varieties::storeFull($data);
|
||||||
|
return redirect()->route('Admin.Botanic.Varieties.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
return view('Admin.Botanic.Varieties.view', Varieties::get($id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = Varieties::getFull($id);
|
||||||
|
$data['species'] = Species::getOptions();
|
||||||
|
$data['tags_list'] = TagGroups::getTreeTags();
|
||||||
|
return view('Admin.Botanic.Varieties.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Varieties::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getImages(Request $request, $id = false, $can_edit = true)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
$data['images'] = Varieties::getImages($id);
|
||||||
|
$data['can_edit'] = $can_edit;
|
||||||
|
return view('components.uploader.mini-gallery-items', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteImage(Request $request)
|
||||||
|
{
|
||||||
|
$id = $request->input('id');
|
||||||
|
$index = $request->input('index');
|
||||||
|
return Varieties::deleteImage($id, $index);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function exportExcel()
|
||||||
|
{
|
||||||
|
return Varieties::exportExcel();
|
||||||
|
}
|
||||||
|
}
|
||||||
9
app/Http/Controllers/Admin/Controller.php
Normal file
9
app/Http/Controllers/Admin/Controller.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller as ParentController;
|
||||||
|
|
||||||
|
class Controller extends ParentController
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core\App;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
use Yajra\DataTables\DataTables;
|
||||||
|
|
||||||
|
use App\Repositories\Core\App\Applications;
|
||||||
|
use App\Datatables\Admin\Core\App\ApplicationsDataTable;
|
||||||
|
|
||||||
|
class ApplicationController extends Controller
|
||||||
|
{
|
||||||
|
public function index(ApplicationsDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
return $dataTable->render('admin.Core.App.Application.index', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatable()
|
||||||
|
{
|
||||||
|
return Applications::getDatatable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
$data = Applications::select_by_id($id);
|
||||||
|
return view('admin.Core.App.Application.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
Applications::store($request->all());
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
Applications::destroy($id);
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toggleActive(Request $request)
|
||||||
|
{
|
||||||
|
$data = Applications::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core\App;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
use App\Repositories\Core\App\Applications;
|
||||||
|
use App\Repositories\Core\App\ApplicationModules;
|
||||||
|
use App\Datatables\Admin\Core\App\ApplicationModulesDataTable;
|
||||||
|
|
||||||
|
class ApplicationModuleController extends Controller
|
||||||
|
{
|
||||||
|
public function index(ApplicationModulesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
return $dataTable->render('admin.Core.App.ApplicationModule.index', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatable()
|
||||||
|
{
|
||||||
|
return ApplicationModules::getDatatable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
$data['applications'] = Applications::getOptions();
|
||||||
|
return view('admin.Core.App.ApplicationModule.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
$data = ApplicationModules::get($id)->toArray();
|
||||||
|
$data['applications'] = Applications::getOptions();
|
||||||
|
return view('admin.Core.App.ApplicationModule.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
ApplicationModules::store($request->all());
|
||||||
|
return redirect()->route('admin.Core.App.ApplicationModule.index')
|
||||||
|
->with('growl', [__('admin.successadd'), 'success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
ApplicationModules::destroy($id);
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toggleActive(Request $request)
|
||||||
|
{
|
||||||
|
$data = ApplicationModules::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
9
app/Http/Controllers/Admin/Core/App/Controller.php
Normal file
9
app/Http/Controllers/Admin/Core/App/Controller.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core\App;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller as ParentController;
|
||||||
|
|
||||||
|
class Controller extends ParentController
|
||||||
|
{
|
||||||
|
}
|
||||||
9
app/Http/Controllers/Admin/Core/Auth/Controller.php
Normal file
9
app/Http/Controllers/Admin/Core/Auth/Controller.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller as ParentController;
|
||||||
|
|
||||||
|
class Controller extends ParentController
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use App\Repositories\Core\App\Applications;
|
||||||
|
use App\Repositories\Core\App\ApplicationModules;
|
||||||
|
use App\Repositories\Core\Auth\Permissions;
|
||||||
|
use App\Repositories\Core\Auth\Users;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Core\Auth\PermissionsDataTable;
|
||||||
|
|
||||||
|
class PermissionController extends Controller
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('ability:admin,permissions_crud');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(PermissionsDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
return $dataTable->render('admin.Core.Auth.Permission.index', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
$data['roles'] = Users::getRolesToEdit();
|
||||||
|
$data['applications'] = Applications::getOptions();
|
||||||
|
$data['application_modules'] = ApplicationModules::getOptions();
|
||||||
|
return view('admin.Core.Auth.Permission.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = (int) $id ? $id : $request->input('id');
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
$data['permission'] = Permissions::get($id);
|
||||||
|
$data['roles'] = Users::getRolesToEdit();
|
||||||
|
$data['applications'] = Applications::getOptions();
|
||||||
|
$data['application_modules'] = ApplicationModules::getOptions();
|
||||||
|
return view('admin.Core.Auth.Permission.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
unset($data['roles']);
|
||||||
|
unset($data['_token']);
|
||||||
|
|
||||||
|
/*
|
||||||
|
$this->validate($request, [
|
||||||
|
'name' => 'required|unique:permissions,name',
|
||||||
|
'display_name' => 'required',
|
||||||
|
'description' => 'required',
|
||||||
|
]);
|
||||||
|
$data['name'] = Str::slug($data['display_name']);
|
||||||
|
*/
|
||||||
|
|
||||||
|
Permissions::store($data);
|
||||||
|
return redirect()->route('Admin.Core.Auth.Permission.index')->with('growl', [__('permissions.successadd'), 'success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
Permissions::destroy($id);
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
96
app/Http/Controllers/Admin/Core/Auth/RoleController.php
Normal file
96
app/Http/Controllers/Admin/Core/Auth/RoleController.php
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Yajra\DataTables\DataTables;
|
||||||
|
|
||||||
|
use App\Models\Core\Auth\Role;
|
||||||
|
use App\Models\Core\Auth\Permission;
|
||||||
|
use App\Models\Core\App\ApplicationModule;
|
||||||
|
|
||||||
|
use App\Repositories\Core\Auth\Permissions;
|
||||||
|
use App\Repositories\Core\Auth\Roles;
|
||||||
|
use App\Datatables\Admin\Core\Auth\RolesDataTable;
|
||||||
|
|
||||||
|
class RoleController extends Controller
|
||||||
|
{
|
||||||
|
public function index(RolesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
$data['modules'] = ApplicationModule::with('permissions')->get()->toArray();
|
||||||
|
return $dataTable->render('admin.Core.Auth.Role.index', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTable(Request $request)
|
||||||
|
{
|
||||||
|
$model = Role::orderBy('name')->get();
|
||||||
|
return Datatables::of($model)->make(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
return view('admin.Core.Auth.Role.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
$data['role'] = Roles::getWithPermissions($id);
|
||||||
|
$data['modules'] = ApplicationModule::with('permissions')->get()->toArray();
|
||||||
|
|
||||||
|
return view('admin.Core.Auth.Role.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
Roles::store($request->all());
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
Roles::destroy($id);
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function manage(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$data = [];
|
||||||
|
$id = (int) $id ? $id : $request->input('id');
|
||||||
|
$data['role'] = Role::with('permissions')->find($id)->toArray();
|
||||||
|
$permissions = Permission::orderBy('app')->orderBy('module')->orderBy('action')->get();
|
||||||
|
foreach ($permissions as $permission) {
|
||||||
|
$data[$permission->app][$permission->module][] = [
|
||||||
|
'action' => $permission->action,
|
||||||
|
'description' => $permission->description,
|
||||||
|
'id' => $permission->id,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
// Debug::fdump($data);
|
||||||
|
// Debug::fdump($permissions);
|
||||||
|
// exit;
|
||||||
|
$data['permissions'] = $data;
|
||||||
|
return view('admin.Core.Auth.Role.manage', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function manage_store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$role = Role::find($data['role_id']);
|
||||||
|
foreach ($data['permissions'] as $key) {
|
||||||
|
$permission = Permission::find($key);
|
||||||
|
$role->attachPermission($permission);
|
||||||
|
}
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toggleActive(Request $request)
|
||||||
|
{
|
||||||
|
$data = Roles::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
75
app/Http/Controllers/Admin/Core/Auth/TeamController.php
Normal file
75
app/Http/Controllers/Admin/Core/Auth/TeamController.php
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use App\Models\Core\Auth\Team;
|
||||||
|
use App\Models\Core\Auth\Role;
|
||||||
|
|
||||||
|
class TeamController extends Controller
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('ability:admin,teams_crud');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('admin.Core.Auth.Team.list', ['teams' => Team::all()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('admin.Core.Auth.Team.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$input = $request->all();
|
||||||
|
$input['name'] = Str::slug($input['display_name']);
|
||||||
|
$request->replace($input);
|
||||||
|
|
||||||
|
$this->validate(
|
||||||
|
$request, [
|
||||||
|
'name' => 'required|unique:teams,name',
|
||||||
|
'display_name' => 'required',
|
||||||
|
'description' => 'required',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$team = Team::create($input);
|
||||||
|
$team->teams()->sync(array_keys($request->input('team', [])));
|
||||||
|
|
||||||
|
return redirect()->route('admin.Teams.edit', $team)
|
||||||
|
->with('growl', [__('teams.successadd'), 'success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$team = Team::find($id);
|
||||||
|
|
||||||
|
return view('admin.Core.Auth.Team.edit', compact('team', 'teams'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
$this->validate(
|
||||||
|
$request, [
|
||||||
|
'display_name' => 'required',
|
||||||
|
'description' => 'required',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$team = Team::find($id);
|
||||||
|
|
||||||
|
return redirect()->route('admin.Teams.edit', $team)
|
||||||
|
->with('growl', [__('teams.successmod'), 'success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
Team::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
183
app/Http/Controllers/Admin/Core/Auth/UserController.php
Normal file
183
app/Http/Controllers/Admin/Core/Auth/UserController.php
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||||
|
|
||||||
|
use Auth;
|
||||||
|
use Image;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
use App\Models\Core\Auth\Role;
|
||||||
|
use App\Models\Core\Auth\User;
|
||||||
|
|
||||||
|
use App\Repositories\Core\Auth\Users;
|
||||||
|
use App\Datatables\Admin\Core\Auth\UsersDataTable;
|
||||||
|
|
||||||
|
class UserController extends Controller
|
||||||
|
{
|
||||||
|
public function index(UsersDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
return $dataTable->render('admin.Core.Auth.User.index', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modalCreate()
|
||||||
|
{
|
||||||
|
$data['roles'] = Users::getRolesToEdit();
|
||||||
|
return view('admin.Core.Auth.User.modal', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modalEdit($id = false)
|
||||||
|
{
|
||||||
|
$user = $id ? Users::get($id) : false;
|
||||||
|
$data['roles'] = Users::getRolesToEdit();
|
||||||
|
$data['user'] = $user ? $user->toArray() : [];
|
||||||
|
$data['user']['roles'] = $user->roles->pluck('id')->toArray();
|
||||||
|
return view('admin.Core.Auth.User.modal', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function storeAjax(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$ret = Users::store($data);
|
||||||
|
return response()->json(['code' => '200']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
$data['roles'] = Users::getRolesToEdit();
|
||||||
|
return view('admin.Core.Auth.User.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
$this->validate($request, [
|
||||||
|
'last_name' => 'required',
|
||||||
|
'first_name' => 'required',
|
||||||
|
'email' => 'required|email|unique:users,email,NULL,id,deleted_at,NULL',
|
||||||
|
]);
|
||||||
|
*/
|
||||||
|
$input = $request->all();
|
||||||
|
if (empty($input['password'])) {
|
||||||
|
unset($input['password']);
|
||||||
|
}
|
||||||
|
$user = Users::store($input);
|
||||||
|
|
||||||
|
return redirect()->route('admin.Core.Auth.User.index')
|
||||||
|
->with('growl', [__('boilerplate::users.successadd'), 'success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
$data['roles'] = Users::getRolesToEdit();
|
||||||
|
$data['user'] = Users::get($id);
|
||||||
|
return view('admin.Core.Auth.User.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
Users::delete($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function firstLogin($token, Request $request)
|
||||||
|
{
|
||||||
|
$user = User::where(['remember_token' => $token])->firstOrFail();
|
||||||
|
|
||||||
|
return view('boilerplate::auth.firstlogin', compact('user', 'token'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function firstLoginPost(Request $request)
|
||||||
|
{
|
||||||
|
$this->validate(
|
||||||
|
$request, [
|
||||||
|
'token' => 'required',
|
||||||
|
'password' => 'required|min:8',
|
||||||
|
'password_confirmation' => 'required|same:password',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$user = User::where(['remember_token' => $request->input('token')])->first();
|
||||||
|
|
||||||
|
$user->password = bcrypt($request->input('password'));
|
||||||
|
$user->remember_token = Str::random(32);
|
||||||
|
$user->last_login = Carbon::now()->toDateTimeString();
|
||||||
|
$user->save();
|
||||||
|
|
||||||
|
Auth::attempt(['email' => $user->email, 'password' => $request->input('password'), 'active' => 1]);
|
||||||
|
|
||||||
|
return redirect()->route('boilerplate.dashboard')
|
||||||
|
->with('growl', [__('boilerplate::users.newpassword'), 'success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function profile()
|
||||||
|
{
|
||||||
|
$user = Users::get();
|
||||||
|
$data['user'] = $user ? $user->toArray() : [];
|
||||||
|
$data['user']['name'] = $user->name;
|
||||||
|
$data['user']['avatar'] = Users::getAvatar($user->id);
|
||||||
|
return view('admin.Core.Auth.User.modalProfile', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function profilePost(Request $request)
|
||||||
|
{
|
||||||
|
$this->validate(
|
||||||
|
$request, [
|
||||||
|
'avatar' => 'mimes:jpeg,png|max:10000',
|
||||||
|
'last_name' => 'required',
|
||||||
|
'first_name' => 'required',
|
||||||
|
'password_confirmation' => 'same:password',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$avatar = $request->file('avatar');
|
||||||
|
$user = Auth::user();
|
||||||
|
|
||||||
|
if ($avatar && $file = $avatar->isValid()) {
|
||||||
|
$destinationPath = dirname($user->avatar_path);
|
||||||
|
if (!is_dir($destinationPath)) {
|
||||||
|
mkdir($destinationPath, 0766, true);
|
||||||
|
}
|
||||||
|
$extension = $avatar->getClientOriginalExtension();
|
||||||
|
$fileName = md5($user->id.$user->email).'_tmp.'.$extension;
|
||||||
|
$avatar->move($destinationPath, $fileName);
|
||||||
|
|
||||||
|
Image::make($destinationPath.DIRECTORY_SEPARATOR.$fileName)
|
||||||
|
->fit(100, 100)
|
||||||
|
->save($user->avatar_path);
|
||||||
|
|
||||||
|
unlink($destinationPath.DIRECTORY_SEPARATOR.$fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
$input = $request->all();
|
||||||
|
|
||||||
|
if ($input['password'] !== null) {
|
||||||
|
$input['password'] = bcrypt($input['password']);
|
||||||
|
$input['remember_token'] = Str::random(32);
|
||||||
|
} else {
|
||||||
|
unset($input['password']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$user->update($input);
|
||||||
|
|
||||||
|
return redirect()->route('boilerplate.user.profile')
|
||||||
|
->with('growl', [__('boilerplate::users.profile.successupdate'), 'success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function avatarDelete()
|
||||||
|
{
|
||||||
|
$user = Auth::user();
|
||||||
|
if (is_file($user->avatar_path)) {
|
||||||
|
unlink($user->avatar_path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toggleActive(Request $request)
|
||||||
|
{
|
||||||
|
$data = Users::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
8
app/Http/Controllers/Admin/Core/Controller.php
Normal file
8
app/Http/Controllers/Admin/Core/Controller.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Http\Controllers\Admin\Core;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller as ParentController;
|
||||||
|
|
||||||
|
class Controller extends ParentController
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -7,13 +7,13 @@ use App\Http\Controllers\Controller;
|
|||||||
|
|
||||||
class HomeController extends Controller
|
class HomeController extends Controller
|
||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->middleware('auth');
|
$this->middleware('auth');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return view('home');
|
return view('admin.Shop.Dashboard.index');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
68
app/Http/Controllers/Admin/Shop/ArticleController.php
Normal file
68
app/Http/Controllers/Admin/Shop/ArticleController.php
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\Articles;
|
||||||
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
|
use App\Datatables\Shop\ArticlesDataTable;
|
||||||
|
|
||||||
|
class ArticleController extends Controller
|
||||||
|
{
|
||||||
|
public function autocomplete(Request $request, $str = false)
|
||||||
|
{
|
||||||
|
$str = $str ? $str : $request->input('q');
|
||||||
|
return response()->json(Articles::autocomplete($str));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(ArticlesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data['families'] = ArticleNatures::getOptions();
|
||||||
|
return $dataTable->render('Admin.Shop.Articles.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = Articles::getMeta();
|
||||||
|
return view('Admin.Shop.Articles.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
Articles::storeFull($data);
|
||||||
|
return redirect()->route('Admin.Shop.Articles.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = Articles::get($id);
|
||||||
|
return view('Admin.Shop.Articles.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = Articles::getFull($id);
|
||||||
|
return view('Admin.Shop.Articles.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Articles::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getImages(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
$data['images'] = Articles::getImages($id);
|
||||||
|
return view('components.uploader.mini-gallery-items', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteImage(Request $request)
|
||||||
|
{
|
||||||
|
$id = $request->input('id');
|
||||||
|
$index = $request->input('index');
|
||||||
|
return Articles::deleteImage($id, $index);
|
||||||
|
}
|
||||||
|
}
|
||||||
49
app/Http/Controllers/Admin/Shop/ArticleNatureController.php
Normal file
49
app/Http/Controllers/Admin/Shop/ArticleNatureController.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
|
use App\Datatables\Shop\ArticleNaturesDataTable;
|
||||||
|
|
||||||
|
class ArticleNatureController extends Controller
|
||||||
|
{
|
||||||
|
public function index(ArticleNaturesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.ArticleNatures.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatable(Request $request)
|
||||||
|
{
|
||||||
|
return ArticleNatures::getTables($request->all());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.ArticleNatures.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = ArticleNatures::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.ArticleNatures.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data['article_nature'] = ArticleNatures::get($id);
|
||||||
|
return view('Admin.Shop.ArticleNatures.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['article_nature'] = ArticleNatures::get($id);
|
||||||
|
return view('Admin.Shop.ArticleNatures.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return ArticleNatures::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Shop\Categories;
|
use App\Repositories\Shop\Categories;
|
||||||
use App\Datatables\Shop\CategoriesDataTable;
|
use App\Datatables\Shop\CategoriesDataTable;
|
||||||
|
|
||||||
class CategoryController extends Controller
|
class CategoryController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
public function index(CategoriesDataTable $dataTable)
|
public function index(CategoriesDataTable $dataTable)
|
||||||
{
|
{
|
||||||
return $dataTable->render('Shop.Admin.Categories.list');
|
return $dataTable->render('Admin.Shop.Categories.list');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
public function getDatatable(Request $request)
|
||||||
@@ -26,26 +24,26 @@ class CategoryController extends Controller
|
|||||||
$data = [];
|
$data = [];
|
||||||
$data['category_id'] = 0;
|
$data['category_id'] = 0;
|
||||||
$data['categories'] = Categories::getOptions();
|
$data['categories'] = Categories::getOptions();
|
||||||
return view('Shop.Admin.Categories.create', $data);
|
return view('Admin.Shop.Categories.create', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$ret = Categories::store($request->all());
|
$ret = Categories::store($request->all());
|
||||||
return redirect()->route('Shop.Admin.Categories.index');
|
return redirect()->route('Admin.Shop.Categories.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$data = Categories::get($id);
|
$data = Categories::get($id);
|
||||||
return view('Shop.Admin.Categories.view', $data);
|
return view('Admin.Shop.Categories.view', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data = Categories::get($id)->toArray();
|
$data = Categories::get($id)->toArray();
|
||||||
$data['categories'] = Categories::getOptions();
|
$data['categories'] = Categories::getOptions();
|
||||||
return view('Shop.Admin.Categories.edit', $data);
|
return view('Admin.Shop.Categories.edit', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(Request $request)
|
public function update(Request $request)
|
||||||
@@ -79,5 +77,4 @@ class CategoryController extends Controller
|
|||||||
$type = $request->input('type');
|
$type = $request->input('type');
|
||||||
return Categories::moveTree($node_id, $target_id, $type);
|
return Categories::moveTree($node_id, $target_id, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
13
app/Http/Controllers/Admin/Shop/Controller.php
Normal file
13
app/Http/Controllers/Admin/Shop/Controller.php
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||||
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
|
|
||||||
|
class Controller extends BaseController
|
||||||
|
{
|
||||||
|
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||||
|
}
|
||||||
45
app/Http/Controllers/Admin/Shop/CustomerController.php
Normal file
45
app/Http/Controllers/Admin/Shop/CustomerController.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\Customers;
|
||||||
|
use App\Datatables\Shop\CustomersDataTable;
|
||||||
|
|
||||||
|
class CustomerController extends Controller
|
||||||
|
{
|
||||||
|
public function index(CustomersDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data = [];
|
||||||
|
return $dataTable->render('Admin.Shop.Customers.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.Customers.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Customers::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.Customers.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data['customer'] = Customers::get($id);
|
||||||
|
return view('Admin.Shop.Customers.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['customer'] = Customers::get($id)->toArray();
|
||||||
|
return view('Admin.Shop.Customers.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Customers::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
@@ -33,6 +33,6 @@ class DashboardController extends Controller
|
|||||||
$data = [];
|
$data = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('Shop.Admin.Dashboard.index', $data);
|
return view('Admin.Shop.Dashboard.index', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
29
app/Http/Controllers/Admin/Shop/HomeController.php
Normal file
29
app/Http/Controllers/Admin/Shop/HomeController.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Shop\Admin;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
class HomeController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a new controller instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the application dashboard.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Contracts\Support\Renderable
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return redirect('dashboard');
|
||||||
|
}
|
||||||
|
}
|
||||||
45
app/Http/Controllers/Admin/Shop/InvoiceController.php
Normal file
45
app/Http/Controllers/Admin/Shop/InvoiceController.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\Invoices;
|
||||||
|
use App\Datatables\Shop\InvoicesDataTable;
|
||||||
|
|
||||||
|
class InvoiceController extends Controller
|
||||||
|
{
|
||||||
|
public function index(InvoicesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.Invoices.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.Invoices.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Invoices::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.Invoices.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = Invoices::get($id);
|
||||||
|
return view('Admin.Shop.Invoices.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['customer'] = Invoices::get($id)->toArray();
|
||||||
|
return view('Admin.Shop.Invoices.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Invoices::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use App\InvoiceItem;
|
use App\InvoiceItem;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -31,7 +31,7 @@ class InvoiceItemController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
@@ -42,7 +42,7 @@ class InvoiceItemController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\InvoiceItem $invoiceItem
|
* @param \App\InvoiceItem $invoiceItem
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function show(InvoiceItem $invoiceItem)
|
public function show(InvoiceItem $invoiceItem)
|
||||||
@@ -53,7 +53,7 @@ class InvoiceItemController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* Show the form for editing the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\InvoiceItem $invoiceItem
|
* @param \App\InvoiceItem $invoiceItem
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function edit(InvoiceItem $invoiceItem)
|
public function edit(InvoiceItem $invoiceItem)
|
||||||
@@ -64,8 +64,8 @@ class InvoiceItemController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \App\InvoiceItem $invoiceItem
|
* @param \App\InvoiceItem $invoiceItem
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, InvoiceItem $invoiceItem)
|
public function update(Request $request, InvoiceItem $invoiceItem)
|
||||||
@@ -76,7 +76,7 @@ class InvoiceItemController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*
|
*
|
||||||
* @param \App\InvoiceItem $invoiceItem
|
* @param \App\InvoiceItem $invoiceItem
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function destroy(InvoiceItem $invoiceItem)
|
public function destroy(InvoiceItem $invoiceItem)
|
||||||
45
app/Http/Controllers/Admin/Shop/OfferController.php
Normal file
45
app/Http/Controllers/Admin/Shop/OfferController.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\Offers;
|
||||||
|
use App\Datatables\Shop\OffersDataTable;
|
||||||
|
|
||||||
|
class OfferController extends Controller
|
||||||
|
{
|
||||||
|
public function index(OffersDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.Offers.list', $data ?? []);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.Offers.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Offers::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.Offers.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = Offers::get($id);
|
||||||
|
return view('Admin.Shop.Offers.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['customer'] = Offers::get($id)->toArray();
|
||||||
|
return view('Admin.Shop.Offers.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Offers::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
45
app/Http/Controllers/Admin/Shop/OrderController.php
Normal file
45
app/Http/Controllers/Admin/Shop/OrderController.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\Orders;
|
||||||
|
use App\Datatables\Shop\OrdersDataTable;
|
||||||
|
|
||||||
|
class OrderController extends Controller
|
||||||
|
{
|
||||||
|
public function index(OrdersDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.Orders.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.Orders.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Orders::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.Orders.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = Orders::get($id);
|
||||||
|
return view('Admin.Shop.Orders.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['customer'] = Orders::get($id)->toArray();
|
||||||
|
return view('Admin.Shop.Orders.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Orders::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use App\OrderPayment;
|
use App\OrderPayment;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -31,7 +31,7 @@ class OrderPaymentController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
@@ -42,7 +42,7 @@ class OrderPaymentController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\OrderPayment $orderPayment
|
* @param \App\OrderPayment $orderPayment
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function show(OrderPayment $orderPayment)
|
public function show(OrderPayment $orderPayment)
|
||||||
@@ -53,7 +53,7 @@ class OrderPaymentController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* Show the form for editing the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\OrderPayment $orderPayment
|
* @param \App\OrderPayment $orderPayment
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function edit(OrderPayment $orderPayment)
|
public function edit(OrderPayment $orderPayment)
|
||||||
@@ -64,8 +64,8 @@ class OrderPaymentController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \App\OrderPayment $orderPayment
|
* @param \App\OrderPayment $orderPayment
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, OrderPayment $orderPayment)
|
public function update(Request $request, OrderPayment $orderPayment)
|
||||||
@@ -76,7 +76,7 @@ class OrderPaymentController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*
|
*
|
||||||
* @param \App\OrderPayment $orderPayment
|
* @param \App\OrderPayment $orderPayment
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function destroy(OrderPayment $orderPayment)
|
public function destroy(OrderPayment $orderPayment)
|
||||||
65
app/Http/Controllers/Admin/Shop/PackageController.php
Normal file
65
app/Http/Controllers/Admin/Shop/PackageController.php
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
|
use App\Repositories\Shop\Packages;
|
||||||
|
use App\Datatables\Shop\PackagesDataTable;
|
||||||
|
|
||||||
|
class PackageController extends Controller
|
||||||
|
{
|
||||||
|
public function index(PackagesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data['families'] = ArticleNatures::getOptions();
|
||||||
|
return $dataTable->render('Admin.Shop.Packages.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatable(Request $request)
|
||||||
|
{
|
||||||
|
return Packages::getTables($request->all());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOptionsByFamily(Request $request)
|
||||||
|
{
|
||||||
|
$id = $request->input('family_id');
|
||||||
|
return response()->json(Packages::getSelectByFamily($id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data['families'] = ArticleNatures::getOptions();
|
||||||
|
return view('Admin.Shop.Packages.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Packages::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.Packages.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = Packages::get($id);
|
||||||
|
return view('Admin.Shop.Packages.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['package'] = Packages::get($id);
|
||||||
|
$data['families'] = ArticleNatures::getOptions();
|
||||||
|
return view('Admin.Shop.Packages.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Packages::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
|
use App\Repositories\Shop\PriceGenericCategories;
|
||||||
|
use App\Datatables\Shop\PriceGenericCategoriesDataTable;
|
||||||
|
|
||||||
|
class PriceGenericCategoryController extends Controller
|
||||||
|
{
|
||||||
|
public function index(PriceGenericCategoriesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.PriceGenericCategories.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data['families'] = ArticleNatures::getOptions();
|
||||||
|
return view('Admin.Shop.PriceGenericCategories.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['families'] = ArticleNatures::getOptions();
|
||||||
|
$data['generic_category'] = PriceGenericCategories::get($id)->toArray();
|
||||||
|
return view('Admin.Shop.PriceGenericCategories.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = PriceGenericCategories::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.PriceGenericCategories.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = PriceGenericCategories::get($id);
|
||||||
|
return view('Admin.Shop.PriceGenericCategories.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return PriceGenericCategories::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
85
app/Http/Controllers/Admin/Shop/PriceListController.php
Normal file
85
app/Http/Controllers/Admin/Shop/PriceListController.php
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Models\Shop\PriceList;
|
||||||
|
use App\Repositories\Shop\PriceLists;
|
||||||
|
use App\Repositories\Shop\Taxes;
|
||||||
|
use App\Repositories\Shop\Tariffs;
|
||||||
|
use App\Repositories\Shop\SaleChannels;
|
||||||
|
use App\Repositories\Shop\Unities;
|
||||||
|
use App\Datatables\Shop\PriceListsDataTable;
|
||||||
|
|
||||||
|
class PriceListController extends Controller
|
||||||
|
{
|
||||||
|
public function index(PriceListsDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data = [];
|
||||||
|
return $dataTable->render('Admin.Shop.PriceLists.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = [];
|
||||||
|
$data['sale_channels'] = SaleChannels::getOptions();
|
||||||
|
return view('Admin.Shop.PriceLists.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['price_list'] = PriceLists::get($id);
|
||||||
|
$data['sale_channels'] = SaleChannels::getOptions();
|
||||||
|
return view('Admin.Shop.PriceLists.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modalCreate($tariff_id)
|
||||||
|
{
|
||||||
|
$data = [];
|
||||||
|
$data['price_list']['tariff_id'] = $tariff_id;
|
||||||
|
$data['price_list']['price_list_values'] = array_fill(0, 3, '');
|
||||||
|
$data['sale_channels'] = SaleChannels::getOptions();
|
||||||
|
$data['statuses'] = Tariffs::getStatuses();
|
||||||
|
return view('Admin.Shop.PriceLists.modal', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modalEdit($id)
|
||||||
|
{
|
||||||
|
$data['price_list'] = PriceLists::getFull($id);
|
||||||
|
$data['sale_channels'] = SaleChannels::getOptions();
|
||||||
|
$data['statuses'] = Tariffs::getStatuses();
|
||||||
|
return view('Admin.Shop.PriceLists.modal', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = PriceLists::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.PriceLists.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function storeAjax(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$ret = PriceLists::store($data);
|
||||||
|
return response()->json(['code' => '200']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = PriceLists::get($id);
|
||||||
|
return view('Admin.Shop.PriceLists.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return PriceLists::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPrice($id)
|
||||||
|
{
|
||||||
|
$data['generic'] = PriceLists::getFull($id);
|
||||||
|
return view('Admin.Shop.PriceLists.partials.table-prices', $data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Models\Shop\PriceListValue;
|
||||||
|
use App\Repositories\Shop\PriceListValues;
|
||||||
|
use App\Repositories\Shop\PriceListValueCategories;
|
||||||
|
use App\Repositories\Shop\Taxes;
|
||||||
|
use App\Repositories\Shop\Packages;
|
||||||
|
use App\Repositories\Shop\Unities;
|
||||||
|
use App\Datatables\Shop\PriceListValuesDataTable;
|
||||||
|
|
||||||
|
class PriceListValueController extends Controller
|
||||||
|
{
|
||||||
|
public function index(PriceListValuesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data['categories'] = PriceListValueCategories::getOptions();
|
||||||
|
return $dataTable->render('Admin.Shop.PriceListValues.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatable(Request $request)
|
||||||
|
{
|
||||||
|
return PriceListValues::getTables($request->all());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data['unities'] = Unities::getOptions();
|
||||||
|
$data['taxes_options'] = Taxes::getOptions();
|
||||||
|
$data['categories'] = PriceListValueCategories::getOptions();
|
||||||
|
return view('Admin.Shop.PriceListValues.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['generic'] = PriceListValues::getFull($id)->toArray();
|
||||||
|
$data['packages'] = Packages::getSelectByFamily($data['generic']['category']['article_family_id']);
|
||||||
|
$data['unities'] = ($data['packages']['id'] ?? false) ? Unities::getSelectByPackage($data['packages']['id']) : [];
|
||||||
|
$data['taxes_options'] = Taxes::getOptions();
|
||||||
|
$data['categories'] = PriceListValueCategories::getOptions();
|
||||||
|
return view('Admin.Shop.PriceListValues.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = PriceListValues::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.PriceListValues.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = PriceListValues::get($id);
|
||||||
|
return view('Admin.Shop.PriceListValues.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return PriceListValues::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPrice($id)
|
||||||
|
{
|
||||||
|
$data['generic'] = PriceListValues::getFull($id);
|
||||||
|
return view('Admin.Shop.PriceListValues.partials.table-prices', $data);
|
||||||
|
}
|
||||||
|
}
|
||||||
46
app/Http/Controllers/Admin/Shop/SaleChannelController.php
Normal file
46
app/Http/Controllers/Admin/Shop/SaleChannelController.php
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
|
use App\Repositories\Shop\SaleChannels;
|
||||||
|
use App\Datatables\Shop\SaleChannelsDataTable;
|
||||||
|
|
||||||
|
class SaleChannelController extends Controller
|
||||||
|
{
|
||||||
|
public function index(SaleChannelsDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.SaleChannels.list', $data ?? []);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.SaleChannels.create', $data ?? []);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = SaleChannels::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.SaleChannels.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data['sale_channel'] = SaleChannels::get($id);
|
||||||
|
return view('Admin.Shop.SaleChannels.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['sale_channel'] = SaleChannels::get($id);
|
||||||
|
return view('Admin.Shop.SaleChannels.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return SaleChannels::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
use App\Repositories\Shop\Tags;
|
use App\Repositories\Shop\Tags;
|
||||||
use App\Repositories\Shop\TagGroups;
|
use App\Repositories\Shop\TagGroups;
|
||||||
use App\Datatables\Shop\TagsDataTable;
|
use App\Datatables\Shop\TagsDataTable;
|
||||||
|
|
||||||
class TagController extends Controller
|
class TagController extends Controller
|
||||||
{
|
{
|
||||||
public function index(TagsDataTable $dataTable)
|
public function index(TagsDataTable $dataTable)
|
||||||
{
|
{
|
||||||
return $dataTable->render('Shop.Admin.Tags.list');
|
return $dataTable->render('Admin.Shop.Tags.list');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
public function getDatatable(Request $request)
|
||||||
@@ -25,26 +25,26 @@ class TagController extends Controller
|
|||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
$data['tag_groups'] = TagGroups::getOptions();
|
$data['tag_groups'] = TagGroups::getOptions();
|
||||||
return view('Shop.Admin.Tags.create', $data);
|
return view('Admin.Shop.Tags.create', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$ret = Tags::store($request->all());
|
$ret = Tags::store($request->all());
|
||||||
return redirect()->route('Shop.Admin.Tags.index');
|
return redirect()->route('Admin.Shop.Tags.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$data = Tags::get($id);
|
$data = Tags::get($id);
|
||||||
return view('Shop.Admin.Tags.view', $data);
|
return view('Admin.Shop.Tags.view', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data = Tags::get($id);
|
$data = Tags::get($id);
|
||||||
$data['tag_groups'] = TagGroups::getOptions();
|
$data['tag_groups'] = TagGroups::getOptions();
|
||||||
return view('Shop.Admin.Tags.edit', $data);
|
return view('Admin.Shop.Tags.edit', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(Request $request)
|
public function update(Request $request)
|
||||||
@@ -56,5 +56,4 @@ class TagController extends Controller
|
|||||||
{
|
{
|
||||||
return Tags::destroy($id);
|
return Tags::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
58
app/Http/Controllers/Admin/Shop/TagGroupController.php
Normal file
58
app/Http/Controllers/Admin/Shop/TagGroupController.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\TagGroups;
|
||||||
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
|
use App\Datatables\Shop\TagGroupsDataTable;
|
||||||
|
|
||||||
|
class TagGroupController extends Controller
|
||||||
|
{
|
||||||
|
public function index(TagGroupsDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.TagGroups.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatable(Request $request)
|
||||||
|
{
|
||||||
|
return TagGroups::getTables($request->all());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data['article_families'] = ArticleNatures::getOptions();
|
||||||
|
return view('Admin.Shop.TagGroups.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = TagGroups::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.TagGroups.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = TagGroups::get($id);
|
||||||
|
return view('Admin.Shop.TagGroups.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = TagGroups::get($id);
|
||||||
|
$data['article_families'] = ArticleNatures::getOptions();
|
||||||
|
return view('Admin.Shop.TagGroups.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return TagGroups::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
67
app/Http/Controllers/Admin/Shop/TariffController.php
Normal file
67
app/Http/Controllers/Admin/Shop/TariffController.php
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\SaleChannels;
|
||||||
|
use App\Repositories\Shop\Tariffs;
|
||||||
|
use App\Repositories\Shop\TariffUnities;
|
||||||
|
use App\Datatables\Shop\TariffsDataTable;
|
||||||
|
use App\Datatables\Shop\PriceListsDataTable;
|
||||||
|
|
||||||
|
class TariffController extends Controller
|
||||||
|
{
|
||||||
|
public function autocomplete(Request $request, $str = false)
|
||||||
|
{
|
||||||
|
$str = $str ? $str : $request->input('q');
|
||||||
|
return response()->json(Tariffs::autocomplete($str));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(TariffsDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.Tariffs.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data['sale_channels'] = SaleChannels::getOptions();
|
||||||
|
$data['statuses'] = Tariffs::getStatuses();
|
||||||
|
$data['tariff_unities'] = TariffUnities::getOptions();
|
||||||
|
|
||||||
|
$model = new PriceListsDataTable();
|
||||||
|
$data['datatables']['price_lists'] = $model->html();
|
||||||
|
|
||||||
|
return view('Admin.Shop.Tariffs.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data['tariff'] = Tariffs::getFull($id);
|
||||||
|
return view('Admin.Shop.Tariffs.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['tariff'] = Tariffs::get($id);
|
||||||
|
$data['sale_channels'] = SaleChannels::getOptions();
|
||||||
|
$data['statuses'] = Tariffs::getStatuses();
|
||||||
|
$data['tariff_unities'] = TariffUnities::getOptions();
|
||||||
|
|
||||||
|
$model = new PriceListsDataTable();
|
||||||
|
$data['datatables']['price_lists'] = $model->html();
|
||||||
|
|
||||||
|
return view('Admin.Shop.Tariffs.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Tariffs::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.Tariffs.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Tariffs::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
@@ -11,7 +11,7 @@ class TaxController extends Controller
|
|||||||
{
|
{
|
||||||
public function index(TaxesDataTable $dataTable)
|
public function index(TaxesDataTable $dataTable)
|
||||||
{
|
{
|
||||||
return $dataTable->render('Shop.Admin.Taxes.list');
|
return $dataTable->render('Admin.Shop.Taxes.list');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
public function getDatatable(Request $request)
|
||||||
@@ -23,26 +23,26 @@ class TaxController extends Controller
|
|||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
$data['groups'] = TagGroups::getOptions();
|
$data['groups'] = TagGroups::getOptions();
|
||||||
return view('Shop.Admin.Taxes.create', $data);
|
return view('Admin.Shop.Taxes.create', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$ret = Taxes::store($request->all());
|
$ret = Taxes::store($request->all());
|
||||||
return redirect()->route('Shop.Admin.Taxes.index');
|
return redirect()->route('Admin.Shop.Taxes.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$data = Taxes::get($id);
|
$data = Taxes::get($id);
|
||||||
return view('Shop.Admin.Taxes.view', $data);
|
return view('Admin.Shop.Taxes.view', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data = Taxes::get($id);
|
$data = Taxes::get($id);
|
||||||
$data['groups'] = TagGroups::getOptions();
|
$data['groups'] = TagGroups::getOptions();
|
||||||
return view('Shop.Admin.Taxes.edit', $data);
|
return view('Admin.Shop.Taxes.edit', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(Request $request)
|
public function update(Request $request)
|
||||||
@@ -54,5 +54,4 @@ class TaxController extends Controller
|
|||||||
{
|
{
|
||||||
return Taxes::destroy($id);
|
return Taxes::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
66
app/Http/Controllers/Admin/Shop/UnityController.php
Normal file
66
app/Http/Controllers/Admin/Shop/UnityController.php
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
|
use App\Repositories\Shop\Packages;
|
||||||
|
use App\Repositories\Shop\Unities;
|
||||||
|
use App\Datatables\Shop\UnitiesDataTable;
|
||||||
|
|
||||||
|
class UnityController extends Controller
|
||||||
|
{
|
||||||
|
public function index(UnitiesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data['families'] = ArticleNatures::getOptions();
|
||||||
|
$data['packages'] = Packages::getOptions();
|
||||||
|
return $dataTable->render('Admin.Shop.Unities.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatable(Request $request)
|
||||||
|
{
|
||||||
|
return Unities::getTables($request->all());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOptionsByPackage(Request $request)
|
||||||
|
{
|
||||||
|
$id = $request->input('package_id');
|
||||||
|
return response()->json(Unities::getOptionsByPackage($id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data['packages'] = Packages::getOptions();
|
||||||
|
return view('Admin.Shop.Unities.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Unities::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.Unities.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = Unities::get($id);
|
||||||
|
return view('Admin.Shop.Unities.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['packages'] = Packages::getOptions();
|
||||||
|
$data['unity'] = Unities::get($id)->toArray();
|
||||||
|
return view('Admin.Shop.Unities.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Unities::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update($id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
57
app/Http/Controllers/Admin/Shop/VariationController.php
Normal file
57
app/Http/Controllers/Admin/Shop/VariationController.php
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\Packages;
|
||||||
|
use App\Repositories\Shop\Unities;
|
||||||
|
use App\Repositories\Shop\Variations;
|
||||||
|
|
||||||
|
use App\Datatables\Shop\VariationsDataTable;
|
||||||
|
|
||||||
|
class VariationController extends Controller
|
||||||
|
{
|
||||||
|
public function autocomplete(Request $request, $str = false)
|
||||||
|
{
|
||||||
|
$str = $str ? $str : $request->input('q');
|
||||||
|
return response()->json(Variations::autocomplete($str));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(VariationsDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.Variations.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data['packages'] = Packages::getOptions();
|
||||||
|
$data['unities'] = Unities::getOptions();
|
||||||
|
return view('Admin.Shop.Variations.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['variation'] = Variations::get($id);
|
||||||
|
$data['packages'] = Packages::getOptions();
|
||||||
|
$data['unities'] = Unities::getOptions();
|
||||||
|
return view('Admin.Shop.Variations.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Variations::store($request->all());
|
||||||
|
return redirect()->route('Admin.Shop.Variations.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = Variations::get($id);
|
||||||
|
return view('Admin.Shop.Variations.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Variations::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@ class ConfirmPasswordController extends Controller
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $redirectTo = RouteServiceProvider::HOME;
|
protected $redirectTo = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new controller instance.
|
* Create a new controller instance.
|
||||||
|
|||||||
@@ -19,4 +19,20 @@ class ForgotPasswordController extends Controller
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use SendsPasswordResetEmails;
|
use SendsPasswordResetEmails;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new controller instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('guest');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function showLinkRequestForm()
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
return view('auth.passwords.email', $data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,38 +3,49 @@
|
|||||||
namespace App\Http\Controllers\Auth;
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Providers\RouteServiceProvider;
|
|
||||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Repositories\Layout;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class LoginController extends Controller
|
class LoginController extends Controller
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Login Controller
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This controller handles authenticating users for the application and
|
|
||||||
| redirecting them to your home screen. The controller uses a trait
|
|
||||||
| to conveniently provide its functionality to your applications.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
use AuthenticatesUsers;
|
use AuthenticatesUsers;
|
||||||
|
protected $redirectTo = '/';
|
||||||
|
|
||||||
/**
|
|
||||||
* Where to redirect users after login.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $redirectTo = RouteServiceProvider::HOME;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new controller instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->middleware('guest')->except('logout');
|
$this->middleware('guest')->except('logout');
|
||||||
|
$this->middleware('guest:web')->except('logout');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function showLoginForm()
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
return view('auth.login', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function authenticated(Request $request, $user)
|
||||||
|
{
|
||||||
|
$request->session()->forget('password_expired_id');
|
||||||
|
|
||||||
|
if ($user->passwordSecurity->password_expiry_days > 0) {
|
||||||
|
$password_updated_at = $user->passwordSecurity->password_updated_at;
|
||||||
|
$password_expiry_days = $user->passwordSecurity->password_expiry_days;
|
||||||
|
$password_expiry_at = Carbon::parse($password_updated_at)->addDays($password_expiry_days);
|
||||||
|
if ($password_expiry_at->lessThan(Carbon::now())) {
|
||||||
|
$request->session()->put('password_expired_id', $user->id);
|
||||||
|
auth()->logout();
|
||||||
|
return redirect('/reset-password')->with('message', "Your password is expired. You need to change your password.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect()->intended($this->redirectPath());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function username()
|
||||||
|
{
|
||||||
|
return 'username';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
71
app/Http/Controllers/Auth/PasswordSecurityController.php
Normal file
71
app/Http/Controllers/Auth/PasswordSecurityController.php
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\User;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
|
class PasswordSecurityController extends Controller
|
||||||
|
{
|
||||||
|
// reset password form
|
||||||
|
public function resetPasswordForm(Request $request)
|
||||||
|
{
|
||||||
|
$password_expired_id = $request->session()->get('password_expired_id');
|
||||||
|
if (!isset($password_expired_id)) {
|
||||||
|
return redirect('/login');
|
||||||
|
}
|
||||||
|
return view('auth.reset_password');
|
||||||
|
}
|
||||||
|
|
||||||
|
// reset password
|
||||||
|
public function resetPassword(Request $request)
|
||||||
|
{
|
||||||
|
// check expire id
|
||||||
|
$password_expired_id = $request->session()->get('password_expired_id');
|
||||||
|
if (!isset($password_expired_id)) {
|
||||||
|
return redirect('/login');
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
$validatedData = $request->validate(
|
||||||
|
[
|
||||||
|
'current_password' => 'required',
|
||||||
|
'new_password' => 'required|string|min:6|confirmed',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
// the requests
|
||||||
|
$request_current_password = $request->current_password;
|
||||||
|
$request_new_password = $request->new_password;
|
||||||
|
$request_new_password_confirm = $request->new_password_confirm;
|
||||||
|
|
||||||
|
// the passwords matches
|
||||||
|
$user = User::find($password_expired_id);
|
||||||
|
if (!(Hash::check($request_current_password, $user->password))) {
|
||||||
|
return redirect()->back()->with("error", "Your current password does not matches with the password you provided. Please try again.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// current password and new password are same
|
||||||
|
if (strcmp($request_current_password, $request->new_password) == 0) {
|
||||||
|
return redirect()->back()->with("error", "New password cannot be same as your current password. Please choose a different password.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// new password and new password confirm doesn't match
|
||||||
|
if (strcmp($request_new_password, $request_new_password_confirm) == 1) {
|
||||||
|
return redirect()->back()->with("error", "New password doesn't match with confirm password.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// change Password
|
||||||
|
$user->password = bcrypt($request->new_password);
|
||||||
|
$user->save();
|
||||||
|
|
||||||
|
// update password update time
|
||||||
|
$user->passwordSecurity->password_updated_at = Carbon::now();
|
||||||
|
$user->passwordSecurity->save();
|
||||||
|
|
||||||
|
return redirect('/login')->with("status", "Password changed successfully. Now you can login!");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,12 +2,11 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Auth;
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\User;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Providers\RouteServiceProvider;
|
|
||||||
use App\Models\Core\Auth\User;
|
|
||||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||||
|
|
||||||
class RegisterController extends Controller
|
class RegisterController extends Controller
|
||||||
{
|
{
|
||||||
@@ -29,7 +28,7 @@ class RegisterController extends Controller
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $redirectTo = RouteServiceProvider::HOME;
|
protected $redirectTo = '/home';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new controller instance.
|
* Create a new controller instance.
|
||||||
@@ -38,36 +37,40 @@ class RegisterController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->middleware('guest');
|
$this->middleware('auth');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a validator for an incoming registration request.
|
* Get a validator for an incoming registration request.
|
||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
* @return \Illuminate\Contracts\Validation\Validator
|
* @return \Illuminate\Contracts\Validation\Validator
|
||||||
*/
|
*/
|
||||||
protected function validator(array $data)
|
protected function validator(array $data)
|
||||||
{
|
{
|
||||||
return Validator::make($data, [
|
return Validator::make(
|
||||||
'name' => ['required', 'string', 'max:255'],
|
$data, [
|
||||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
'name' => 'required|string|max:255',
|
||||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
'email' => 'required|string|email|max:255|unique:users',
|
||||||
]);
|
'password' => 'required|string|min:6|confirmed',
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new user instance after a valid registration.
|
* Create a new user instance after a valid registration.
|
||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
* @return \App\User
|
* @return \App\User
|
||||||
*/
|
*/
|
||||||
protected function create(array $data)
|
protected function create(array $data)
|
||||||
{
|
{
|
||||||
return User::create([
|
return User::create(
|
||||||
|
[
|
||||||
'name' => $data['name'],
|
'name' => $data['name'],
|
||||||
'email' => $data['email'],
|
'email' => $data['email'],
|
||||||
'password' => Hash::make($data['password']),
|
'password' => Hash::make($data['password']),
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Auth;
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Providers\RouteServiceProvider;
|
|
||||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||||
|
|
||||||
class ResetPasswordController extends Controller
|
class ResetPasswordController extends Controller
|
||||||
@@ -26,5 +26,23 @@ class ResetPasswordController extends Controller
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $redirectTo = RouteServiceProvider::HOME;
|
protected $redirectTo = '/home';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new controller instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('guest');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function showResetForm(Request $request, $token = null)
|
||||||
|
{
|
||||||
|
$data = \App\Repositories\Config::init();
|
||||||
|
$data['token'] = $token;
|
||||||
|
$data['email'] = $request->email;
|
||||||
|
return view('auth.passwords.reset', $data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
namespace App\Http\Controllers\Auth;
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Providers\RouteServiceProvider;
|
|
||||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||||
|
|
||||||
class VerificationController extends Controller
|
class VerificationController extends Controller
|
||||||
@@ -26,7 +25,7 @@ class VerificationController extends Controller
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $redirectTo = RouteServiceProvider::HOME;
|
protected $redirectTo = '/home';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new controller instance.
|
* Create a new controller instance.
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Botanic\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Botanic\Families;
|
|
||||||
use App\Datatables\Botanic\FamiliesDataTable;
|
|
||||||
|
|
||||||
class FamilyController extends Controller
|
|
||||||
{
|
|
||||||
|
|
||||||
public function index(FamiliesDataTable $dataTable)
|
|
||||||
{
|
|
||||||
return $dataTable->render('Botanic.Admin.Families.list');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
|
||||||
{
|
|
||||||
return Families::getTables($request->all());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
$data = [];
|
|
||||||
return view('Botanic.Admin.Families.create', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$ret = Families::store($request);
|
|
||||||
return redirect()->route('Botanic.Admin.Families.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data = Families::get($id);
|
|
||||||
return view('Botanic.Admin.Families.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data['family'] = Families::get($id)->toArray();
|
|
||||||
return view('Botanic.Admin.Families.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return Families::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function exportExcel()
|
|
||||||
{
|
|
||||||
return Families::exportExcel();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Botanic\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Botanic\Species;
|
|
||||||
use App\Repositories\Botanic\Genres;
|
|
||||||
use App\Datatables\Botanic\SpeciesDataTable;
|
|
||||||
|
|
||||||
class SpecieController extends Controller
|
|
||||||
{
|
|
||||||
public function index(SpeciesDataTable $dataTable)
|
|
||||||
{
|
|
||||||
return $dataTable->render('Botanic.Admin.Species.list');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
|
||||||
{
|
|
||||||
return Species::getDatatable($request->all());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getOptions()
|
|
||||||
{
|
|
||||||
return response()->json(Species::getOptions());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
return view('Botanic.Admin.Species.create');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$data = $request->all();
|
|
||||||
$ret = Species::store($data);
|
|
||||||
return redirect()->route('Botanic.Admin.Species.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data = Species::get($id);
|
|
||||||
return view('Botanic.Admin.Species.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data = Species::get($id);
|
|
||||||
$data['genres'] = Genres::getOptions();
|
|
||||||
return view('Botanic.Admin.Species.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return Species::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function exportExcel()
|
|
||||||
{
|
|
||||||
return Species::exportExcel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Botanic\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Botanic\Varieties;
|
|
||||||
use App\Repositories\Botanic\Species;
|
|
||||||
use App\Repositories\Shop\TagGroups;
|
|
||||||
use App\Datatables\Botanic\VarietiesDataTable;
|
|
||||||
|
|
||||||
use App\Models\Shop\Variety;
|
|
||||||
|
|
||||||
class VarietyController extends Controller
|
|
||||||
{
|
|
||||||
public function index(VarietiesDataTable $dataTable)
|
|
||||||
{
|
|
||||||
return $dataTable->render('Botanic.Admin.Varieties.list');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getOptionsWithSpecie()
|
|
||||||
{
|
|
||||||
return response()->json(Varieties::getOptionsWithSpecie());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
$data['tags_list'] = TagGroups::getTreeTags();
|
|
||||||
return view('Botanic.Admin.Varieties.create', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$data = $request->all();
|
|
||||||
Varieties::storeFull($data);
|
|
||||||
return redirect()->route('Botanic.Admin.Varieties.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
return view('Botanic.Admin.Varieties.view', Varieties::get($id));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data = Varieties::getFull($id);
|
|
||||||
$data['species'] = Species::getOptions();
|
|
||||||
$data['tags_list'] = TagGroups::getTreeTags();
|
|
||||||
return view('Botanic.Admin.Varieties.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return Varieties::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getImages(Request $request, $id = false, $can_edit = true)
|
|
||||||
{
|
|
||||||
$id = $id ? $id : $request->input('id');
|
|
||||||
$data['images'] = Varieties::getImages($id);
|
|
||||||
$data['can_edit'] = $can_edit;
|
|
||||||
return view('components.uploader.mini-gallery-items', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function deleteImage(Request $request)
|
|
||||||
{
|
|
||||||
$id = $request->input('id');
|
|
||||||
$index = $request->input('index');
|
|
||||||
return Varieties::deleteImage($id, $index);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function exportExcel()
|
|
||||||
{
|
|
||||||
return Varieties::exportExcel();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\JS;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Config;
|
|
||||||
|
|
||||||
class CacheController extends Controller
|
|
||||||
{
|
|
||||||
public function getCacheVersions()
|
|
||||||
{
|
|
||||||
$data['versions'] = Config::getCacheVersions();
|
|
||||||
|
|
||||||
$d = (string) view('js.cache', $data);
|
|
||||||
$d = html_entity_decode($d);
|
|
||||||
|
|
||||||
return self::render($d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Shop\Articles;
|
|
||||||
use App\Repositories\Shop\ArticleFamilies;
|
|
||||||
use App\Datatables\Shop\ArticlesDataTable;
|
|
||||||
|
|
||||||
class ArticleController extends Controller
|
|
||||||
{
|
|
||||||
public function index(ArticlesDataTable $dataTable)
|
|
||||||
{
|
|
||||||
$data['families'] = ArticleFamilies::getOptions();
|
|
||||||
return $dataTable->render('Shop.Admin.Articles.list', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
|
||||||
{
|
|
||||||
return Articles::getTables($request->all());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
$data = $this->getMeta();
|
|
||||||
return view('Shop.Admin.Articles.create', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$data = $request->all();
|
|
||||||
// dump($data);
|
|
||||||
// exit;
|
|
||||||
Articles::storeFull($data);
|
|
||||||
return redirect()->route('Shop.Admin.Articles.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data = Articles::get($id);
|
|
||||||
return view('Shop.Admin.Articles.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data = Articles::getFull($id);
|
|
||||||
return view('Shop.Admin.Articles.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update(Request $request)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return Articles::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMeta($data = [])
|
|
||||||
{
|
|
||||||
return Articles::getMeta($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getImages(Request $request, $id = false)
|
|
||||||
{
|
|
||||||
$id = $id ? $id : $request->input('id');
|
|
||||||
$data['images'] = Articles::getImages($id);
|
|
||||||
return view('components.uploader.mini-gallery-items', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function deleteImage(Request $request)
|
|
||||||
{
|
|
||||||
$id = $request->input('id');
|
|
||||||
$index = $request->input('index');
|
|
||||||
return Articles::deleteImage($id, $index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Shop\ArticleFamilies;
|
|
||||||
use App\Datatables\Shop\ArticleFamiliesDataTable;
|
|
||||||
|
|
||||||
class ArticleFamilyController extends Controller
|
|
||||||
{
|
|
||||||
public function index(ArticleFamiliesDataTable $dataTable)
|
|
||||||
{
|
|
||||||
return $dataTable->render('Shop.Admin.ArticleFamilies.list');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
|
||||||
{
|
|
||||||
return ArticleFamilies::getTables($request->all());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
return view('Shop.Admin.ArticleFamilies.create');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$ret = ArticleFamilies::store($request->all());
|
|
||||||
return redirect()->route('Shop.Admin.ArticleFamilies.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data = ArticleFamilies::get($id);
|
|
||||||
return view('Shop.Admin.ArticleFamilies.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data = ArticleFamilies::get($id);
|
|
||||||
return view('Shop.Admin.ArticleFamilies.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update(Request $request)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return ArticleFamilies::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Models\Shop\ArticlePrice;
|
|
||||||
use App\Repositories\Shop\ArticlePrices;
|
|
||||||
|
|
||||||
class ArticlePriceController extends Controller
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Display a listing of the resource.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for creating a new resource.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a newly created resource in storage.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display the specified resource.
|
|
||||||
*
|
|
||||||
* @param \App\ArticlePrice $ArticlePrice
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function show(ArticlePrice $ArticlePrice)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*
|
|
||||||
* @param \App\ArticlePrice $ArticlePrice
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function edit(ArticlePrice $ArticlePrice)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \App\ArticlePrice $ArticlePrice
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function update(Request $request, ArticlePrice $ArticlePrice)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*
|
|
||||||
* @param \App\ArticlePrice $ArticlePrice
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function destroy(ArticlePrice $ArticlePrice)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Shop\Customers;
|
|
||||||
use App\Datatables\Shop\CustomersDataTable;
|
|
||||||
|
|
||||||
class CustomerController extends Controller
|
|
||||||
{
|
|
||||||
public function index(CustomersDataTable $dataTable)
|
|
||||||
{
|
|
||||||
$data = [];
|
|
||||||
return $dataTable->render('Shop.Admin.Customers.list', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
return view('Shop.Admin.Customers.create');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$ret = Customers::store($request->all());
|
|
||||||
return redirect()->route('Shop.Admin.Customers.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data['customer'] = Customers::get($id);
|
|
||||||
return view('Shop.Admin.Customers.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data['customer'] = Customers::get($id)->toArray();
|
|
||||||
return view('Shop.Admin.Customers.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return Customers::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
class HomeController extends Controller
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Create a new controller instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
$this->middleware('auth');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the application dashboard.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Contracts\Support\Renderable
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
return redirect('dashboard');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use App\Inventory;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
class InventoryController extends Controller
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Display a listing of the resource.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for creating a new resource.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a newly created resource in storage.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display the specified resource.
|
|
||||||
*
|
|
||||||
* @param \App\Inventory $inventory
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function show(Inventory $inventory)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*
|
|
||||||
* @param \App\Inventory $inventory
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function edit(Inventory $inventory)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \App\Inventory $inventory
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function update(Request $request, Inventory $inventory)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*
|
|
||||||
* @param \App\Inventory $inventory
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function destroy(Inventory $inventory)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use App\InventoryPlace;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
class InventoryPlaceController extends Controller
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Display a listing of the resource.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for creating a new resource.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a newly created resource in storage.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display the specified resource.
|
|
||||||
*
|
|
||||||
* @param \App\InventoryPlace $inventoryPlace
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function show(InventoryPlace $inventoryPlace)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*
|
|
||||||
* @param \App\InventoryPlace $inventoryPlace
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function edit(InventoryPlace $inventoryPlace)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \App\InventoryPlace $inventoryPlace
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function update(Request $request, InventoryPlace $inventoryPlace)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*
|
|
||||||
* @param \App\InventoryPlace $inventoryPlace
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function destroy(InventoryPlace $inventoryPlace)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Shop\Invoices;
|
|
||||||
use App\Datatables\Shop\InvoicesDataTable;
|
|
||||||
|
|
||||||
class InvoiceController extends Controller
|
|
||||||
{
|
|
||||||
public function index(InvoicesDataTable $dataTable)
|
|
||||||
{
|
|
||||||
return $dataTable->render('Shop.Admin.Invoices.list', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
return view('Shop.Admin.Invoices.create');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$ret = Invoices::store($request->all());
|
|
||||||
return redirect()->route('Shop.Admin.Invoices.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data = Invoices::get($id);
|
|
||||||
return view('Shop.Admin.Invoices.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data['customer'] = Invoices::get($id)->toArray();
|
|
||||||
return view('Shop.Admin.Invoices.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return Invoices::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Shop\Orders;
|
|
||||||
use App\Datatables\Shop\OrdersDataTable;
|
|
||||||
|
|
||||||
class OrderController extends Controller
|
|
||||||
{
|
|
||||||
public function index(OrdersDataTable $dataTable)
|
|
||||||
{
|
|
||||||
return $dataTable->render('Shop.Admin.Orders.list', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
return view('Shop.Admin.Orders.create');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$ret = Orders::store($request->all());
|
|
||||||
return redirect()->route('Shop.Admin.Orders.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data = Orders::get($id);
|
|
||||||
return view('Shop.Admin.Orders.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data['customer'] = Orders::get($id)->toArray();
|
|
||||||
return view('Shop.Admin.Orders.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return Orders::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Shop\ArticleFamilies;
|
|
||||||
use App\Repositories\Shop\Packages;
|
|
||||||
use App\Datatables\Shop\PackagesDataTable;
|
|
||||||
|
|
||||||
class PackageController extends Controller
|
|
||||||
{
|
|
||||||
public function index(PackagesDataTable $dataTable)
|
|
||||||
{
|
|
||||||
$data['families'] = ArticleFamilies::getOptions();
|
|
||||||
return $dataTable->render('Shop.Admin.Packages.list', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
|
||||||
{
|
|
||||||
return Packages::getTables($request->all());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getOptionsByFamily(Request $request)
|
|
||||||
{
|
|
||||||
$id = $request->input('family_id');
|
|
||||||
return response()->json(Packages::getSelectByFamily($id));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
$data['families'] = ArticleFamilies::getOptions();
|
|
||||||
return view('Shop.Admin.Packages.create', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$ret = Packages::store($request->all());
|
|
||||||
return redirect()->route('Shop.Admin.Packages.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data = Packages::get($id);
|
|
||||||
return view('Shop.Admin.Packages.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data['package'] = Packages::get($id);
|
|
||||||
$data['families'] = ArticleFamilies::getOptions();
|
|
||||||
return view('Shop.Admin.Packages.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update(Request $request)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return Packages::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Shop\ArticleFamilies;
|
|
||||||
use App\Repositories\Shop\PriceGenericCategories;
|
|
||||||
use App\Datatables\Shop\PriceGenericCategoriesDataTable;
|
|
||||||
|
|
||||||
class PriceGenericCategoryController extends Controller
|
|
||||||
{
|
|
||||||
public function index(PriceGenericCategoriesDataTable $dataTable)
|
|
||||||
{
|
|
||||||
return $dataTable->render('Shop.Admin.PriceGenericCategories.list');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
$data['families'] = ArticleFamilies::getOptions();
|
|
||||||
return view('Shop.Admin.PriceGenericCategories.create', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data['families'] = ArticleFamilies::getOptions();
|
|
||||||
$data['generic_category'] = PriceGenericCategories::get($id)->toArray();
|
|
||||||
return view('Shop.Admin.PriceGenericCategories.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$ret = PriceGenericCategories::store($request->all());
|
|
||||||
return redirect()->route('Shop.Admin.PriceGenericCategories.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data = PriceGenericCategories::get($id);
|
|
||||||
return view('Shop.Admin.PriceGenericCategories.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return PriceGenericCategories::destroy($id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Models\Shop\PriceGeneric;
|
|
||||||
use App\Repositories\Shop\PriceGenerics;
|
|
||||||
use App\Repositories\Shop\PriceGenericCategories;
|
|
||||||
use App\Repositories\Shop\Taxes;
|
|
||||||
use App\Repositories\Shop\Packages;
|
|
||||||
use App\Repositories\Shop\Unities;
|
|
||||||
use App\Datatables\Shop\PriceGenericsDataTable;
|
|
||||||
|
|
||||||
class PriceGenericController extends Controller
|
|
||||||
{
|
|
||||||
public function index(PriceGenericsDataTable $dataTable)
|
|
||||||
{
|
|
||||||
$data['categories'] = PriceGenericCategories::getOptions();
|
|
||||||
return $dataTable->render('Shop.Admin.PriceGenerics.list', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
|
||||||
{
|
|
||||||
return PriceGenerics::getTables($request->all());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
$data['unities'] = Unities::getOptions();
|
|
||||||
$data['taxes_options'] = Taxes::getOptions();
|
|
||||||
$data['categories'] = PriceGenericCategories::getOptions();
|
|
||||||
return view('Shop.Admin.PriceGenerics.create',$data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data['generic'] = PriceGenerics::getFull($id)->toArray();
|
|
||||||
$data['packages'] = Packages::getSelectByFamily($data['generic']['category']['article_family_id']);
|
|
||||||
$data['unities'] = ($data['packages']['id'] ?? false) ? Unities::getSelectByPackage($data['packages']['id']) : [];
|
|
||||||
$data['taxes_options'] = Taxes::getOptions();
|
|
||||||
$data['categories'] = PriceGenericCategories::getOptions();
|
|
||||||
return view('Shop.Admin.PriceGenerics.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$ret = PriceGenerics::store($request->all());
|
|
||||||
return redirect()->route('Shop.Admin.PriceGenerics.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data = PriceGenerics::get($id);
|
|
||||||
return view('Shop.Admin.PriceGenerics.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return PriceGenerics::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getPrice($id) {
|
|
||||||
$data['generic'] = PriceGenerics::getFull($id);
|
|
||||||
return view('Shop.Admin.PriceGenerics.partials.table-prices', $data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Shop\TagGroups;
|
|
||||||
use App\Repositories\Shop\ArticleFamilies;
|
|
||||||
use App\Datatables\Shop\TagGroupsDataTable;
|
|
||||||
|
|
||||||
class TagGroupController extends Controller
|
|
||||||
{
|
|
||||||
public function index(TagGroupsDataTable $dataTable)
|
|
||||||
{
|
|
||||||
return $dataTable->render('Shop.Admin.TagGroups.list');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
|
||||||
{
|
|
||||||
return TagGroups::getTables($request->all());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
$data['article_families'] = ArticleFamilies::getOptions();
|
|
||||||
return view('Shop.Admin.TagGroups.create', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$ret = TagGroups::store($request->all());
|
|
||||||
return redirect()->route('Shop.Admin.TagGroups.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data = TagGroups::get($id);
|
|
||||||
return view('Shop.Admin.TagGroups.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data = TagGroups::get($id);
|
|
||||||
$data['article_families'] = ArticleFamilies::getOptions();
|
|
||||||
return view('Shop.Admin.TagGroups.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update(Request $request)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return TagGroups::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use App\Repositories\Shop\ArticleFamilies;
|
|
||||||
use App\Repositories\Shop\Packages;
|
|
||||||
use App\Repositories\Shop\Unities;
|
|
||||||
use App\Datatables\Shop\UnitiesDataTable;
|
|
||||||
|
|
||||||
class UnityController extends Controller
|
|
||||||
{
|
|
||||||
public function index(UnitiesDataTable $dataTable)
|
|
||||||
{
|
|
||||||
$data['families'] = ArticleFamilies::getOptions();
|
|
||||||
$data['packages'] = Packages::getOptions();
|
|
||||||
return $dataTable->render('Shop.Admin.Unities.list', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
|
||||||
{
|
|
||||||
return Unities::getTables($request->all());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getOptionsByPackage(Request $request)
|
|
||||||
{
|
|
||||||
$id = $request->input('package_id');
|
|
||||||
return response()->json(Unities::getOptionsByPackage($id));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
$data['packages'] = Packages::getOptions();
|
|
||||||
return view('Shop.Admin.Unities.create');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$ret = Unities::store($request->all());
|
|
||||||
return redirect()->route('Shop.Admin.Unities.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data = Unities::get($id);
|
|
||||||
return view('Shop.Admin.Unities.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$data['packages'] = Packages::getOptions();
|
|
||||||
$data['unity'] = Unities::get($id)->toArray();
|
|
||||||
return view('Shop.Admin.Unities.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
return Unities::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update($id) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -32,7 +32,7 @@ class ArticleController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
@@ -43,7 +43,7 @@ class ArticleController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\Article $article
|
* @param \App\Article $article
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
@@ -54,7 +54,7 @@ class ArticleController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* Show the form for editing the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\Article $article
|
* @param \App\Article $article
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
@@ -65,8 +65,8 @@ class ArticleController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \App\Article $article
|
* @param \App\Article $article
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, $id)
|
public function update(Request $request, $id)
|
||||||
@@ -77,7 +77,7 @@ class ArticleController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*
|
*
|
||||||
* @param \App\Article $article
|
* @param \App\Article $article
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
|
|||||||
@@ -6,15 +6,14 @@ use Illuminate\Http\Request;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
use App\Repositories\Shop\Categories;
|
use App\Repositories\Shop\Categories;
|
||||||
use App\Datatables\Shop\CategoriesDataTable;
|
use App\Datatables\Shop\CategoriesDataTable;
|
||||||
|
|
||||||
class CategoryController extends Controller
|
class CategoryController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
public function index(CategoriesDataTable $dataTable)
|
public function index(CategoriesDataTable $dataTable)
|
||||||
{
|
{
|
||||||
return $dataTable->render('Shop.Categories.list');
|
return $dataTable->render('Shop.Categories.list');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
public function getDatatable(Request $request)
|
||||||
{
|
{
|
||||||
@@ -31,5 +30,4 @@ class CategoryController extends Controller
|
|||||||
{
|
{
|
||||||
return response()->json(Categories::getTree());
|
return response()->json(Categories::getTree());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class CustomerController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\Customer $customer
|
* @param \App\Customer $customer
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function show(Customer $customer)
|
public function show(Customer $customer)
|
||||||
@@ -23,7 +23,7 @@ class CustomerController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* Show the form for editing the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\Customer $customer
|
* @param \App\Customer $customer
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function edit(Customer $customer)
|
public function edit(Customer $customer)
|
||||||
@@ -34,8 +34,8 @@ class CustomerController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \App\Customer $customer
|
* @param \App\Customer $customer
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, Customer $customer)
|
public function update(Request $request, Customer $customer)
|
||||||
@@ -46,7 +46,7 @@ class CustomerController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*
|
*
|
||||||
* @param \App\Customer $customer
|
* @param \App\Customer $customer
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function destroy(Customer $customer)
|
public function destroy(Customer $customer)
|
||||||
|
|||||||
@@ -10,27 +10,27 @@ use App\Repositories\Shop\Categories;
|
|||||||
|
|
||||||
class HomeController extends Controller
|
class HomeController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Create a new controller instance.
|
* Create a new controller instance.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
// $this->middleware('auth');
|
// $this->middleware('auth');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the application dashboard.
|
* Show the application dashboard.
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Contracts\Support\Renderable
|
* @return \Illuminate\Contracts\Support\Renderable
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$data['categories'] = Categories::getTree();
|
$data['categories'] = Categories::getTree();
|
||||||
$data['category'] = Categories::get(15)->toArray();
|
$data['category'] = Categories::get(15)->toArray();
|
||||||
$data['articles'] = Articles::getByCategory(0)->toArray();
|
$data['articles'] = Articles::getByCategory(0)->toArray();
|
||||||
// dump($data);
|
// dump($data);
|
||||||
return view('Shop.home', $data);
|
return view('Shop.home', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class InvoiceController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
@@ -43,7 +43,7 @@ class InvoiceController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\Invoice $invoice
|
* @param \App\Invoice $invoice
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function show(Invoice $invoice)
|
public function show(Invoice $invoice)
|
||||||
@@ -54,7 +54,7 @@ class InvoiceController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* Show the form for editing the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\Invoice $invoice
|
* @param \App\Invoice $invoice
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function edit(Invoice $invoice)
|
public function edit(Invoice $invoice)
|
||||||
@@ -65,8 +65,8 @@ class InvoiceController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \App\Invoice $invoice
|
* @param \App\Invoice $invoice
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, Invoice $invoice)
|
public function update(Request $request, Invoice $invoice)
|
||||||
@@ -77,7 +77,7 @@ class InvoiceController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*
|
*
|
||||||
* @param \App\Invoice $invoice
|
* @param \App\Invoice $invoice
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function destroy(Invoice $invoice)
|
public function destroy(Invoice $invoice)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class OrderController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
@@ -43,7 +43,7 @@ class OrderController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\Order $order
|
* @param \App\Order $order
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function show(Order $order)
|
public function show(Order $order)
|
||||||
@@ -54,7 +54,7 @@ class OrderController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* Show the form for editing the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\Order $order
|
* @param \App\Order $order
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function edit(Order $order)
|
public function edit(Order $order)
|
||||||
@@ -65,8 +65,8 @@ class OrderController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \App\Order $order
|
* @param \App\Order $order
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, Order $order)
|
public function update(Request $request, Order $order)
|
||||||
@@ -77,7 +77,7 @@ class OrderController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*
|
*
|
||||||
* @param \App\Order $order
|
* @param \App\Order $order
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function destroy(Order $order)
|
public function destroy(Order $order)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user