|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -13,7 +14,7 @@ class AppServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
Schema::defaultStringLength(191);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
{
|
||||
"name": "jitendra-webkul/bagisto",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": ["framework", "laravel"],
|
||||
"keywords": [
|
||||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"license": "MIT",
|
||||
"type": "project",
|
||||
"require": {
|
||||
|
|
@ -27,8 +30,9 @@
|
|||
"webkul/laravel-admin": "self.version",
|
||||
"webkul/laravel-ui": "self.version",
|
||||
"webkul/laravel-core": "self.version",
|
||||
"webkul/laravel-category": "self.version",
|
||||
"webkul/laravel-attribute": "self.version",
|
||||
"webkul/laravel-customer": "self.version",
|
||||
"webkul/laravel-category": "self.version",
|
||||
"webkul/laravel-channel": "self.version",
|
||||
"webkul/laravel-product": "self.version"
|
||||
},
|
||||
|
|
@ -44,7 +48,9 @@
|
|||
"Webkul\\Ui\\": "packages/Webkul/Ui/src",
|
||||
"Webkul\\Category\\": "packages/Webkul/Category/src",
|
||||
"Webkul\\Attribute\\": "packages/Webkul/Attribute/src",
|
||||
"Webkul\\Shop\\": "packages/Webkul/Shop/src",
|
||||
"Webkul\\Core\\": "packages/Webkul/Core/src",
|
||||
"Webkul\\Customer\\": "packages/Webkul/Customer/src",
|
||||
"Webkul\\Channel\\": "packages/Webkul/Channel/src",
|
||||
"Webkul\\Inventory\\": "packages/Webkul/Inventory/src",
|
||||
"Webkul\\Product\\": "packages/Webkul/Product/src"
|
||||
|
|
@ -57,8 +63,7 @@
|
|||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"dont-discover": [
|
||||
]
|
||||
"dont-discover": []
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -678,16 +678,16 @@
|
|||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v5.6.24",
|
||||
"version": "v5.6.27",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "56290edeb0d8051826d40b4cbd8ed3c30348b2b5"
|
||||
"reference": "2fe661f2444410a576aa40054ad9b7fe0bb5cee5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/56290edeb0d8051826d40b4cbd8ed3c30348b2b5",
|
||||
"reference": "56290edeb0d8051826d40b4cbd8ed3c30348b2b5",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/2fe661f2444410a576aa40054ad9b7fe0bb5cee5",
|
||||
"reference": "2fe661f2444410a576aa40054ad9b7fe0bb5cee5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -813,7 +813,7 @@
|
|||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"time": "2018-06-04T14:51:03+00:00"
|
||||
"time": "2018-07-10T13:47:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/tinker",
|
||||
|
|
@ -1146,16 +1146,16 @@
|
|||
},
|
||||
{
|
||||
"name": "nwidart/laravel-modules",
|
||||
"version": "3.2.1",
|
||||
"version": "3.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nWidart/laravel-modules.git",
|
||||
"reference": "5250efef2505c47687ebe4c0368a4f0cd01c84ef"
|
||||
"reference": "6e27f17ebf27c07bc6aeb83d5cc5a547cfa0c204"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/5250efef2505c47687ebe4c0368a4f0cd01c84ef",
|
||||
"reference": "5250efef2505c47687ebe4c0368a4f0cd01c84ef",
|
||||
"url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/6e27f17ebf27c07bc6aeb83d5cc5a547cfa0c204",
|
||||
"reference": "6e27f17ebf27c07bc6aeb83d5cc5a547cfa0c204",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -1212,20 +1212,20 @@
|
|||
"nwidart",
|
||||
"rad"
|
||||
],
|
||||
"time": "2018-04-16T17:35:14+00:00"
|
||||
"time": "2018-06-21T17:40:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "paragonie/random_compat",
|
||||
"version": "v2.0.15",
|
||||
"version": "v2.0.17",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/paragonie/random_compat.git",
|
||||
"reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09"
|
||||
"reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/10bcb46e8f3d365170f6de9d05245aa066b81f09",
|
||||
"reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09",
|
||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d",
|
||||
"reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -1261,7 +1261,7 @@
|
|||
"pseudorandom",
|
||||
"random"
|
||||
],
|
||||
"time": "2018-06-08T15:26:40+00:00"
|
||||
"time": "2018-07-04T16:31:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "propaganistas/laravel-intl",
|
||||
|
|
@ -1693,16 +1693,16 @@
|
|||
},
|
||||
{
|
||||
"name": "swiftmailer/swiftmailer",
|
||||
"version": "v6.0.2",
|
||||
"version": "v6.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/swiftmailer/swiftmailer.git",
|
||||
"reference": "412333372fb6c8ffb65496a2bbd7321af75733fc"
|
||||
"reference": "aa899fef280b1c1aec8d5d4ac069af7f80c89a23"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/412333372fb6c8ffb65496a2bbd7321af75733fc",
|
||||
"reference": "412333372fb6c8ffb65496a2bbd7321af75733fc",
|
||||
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/aa899fef280b1c1aec8d5d4ac069af7f80c89a23",
|
||||
"reference": "aa899fef280b1c1aec8d5d4ac069af7f80c89a23",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -1713,10 +1713,14 @@
|
|||
"mockery/mockery": "~0.9.1",
|
||||
"symfony/phpunit-bridge": "~3.3@dev"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-intl": "Needed to support internationalized email addresses",
|
||||
"true/punycode": "Needed to support internationalized email addresses, if ext-intl is not installed"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "6.0-dev"
|
||||
"dev-master": "6.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
|
@ -1738,26 +1742,26 @@
|
|||
}
|
||||
],
|
||||
"description": "Swiftmailer, free feature-rich PHP mailer",
|
||||
"homepage": "http://swiftmailer.symfony.com",
|
||||
"homepage": "https://swiftmailer.symfony.com",
|
||||
"keywords": [
|
||||
"email",
|
||||
"mail",
|
||||
"mailer"
|
||||
],
|
||||
"time": "2017-09-30T22:39:41+00:00"
|
||||
"time": "2018-07-04T11:12:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "2d5d973bf9933d46802b01010bd25c800c87c242"
|
||||
"reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/2d5d973bf9933d46802b01010bd25c800c87c242",
|
||||
"reference": "2d5d973bf9933d46802b01010bd25c800c87c242",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/70591cda56b4b47c55776ac78e157c4bb6c8b43f",
|
||||
"reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -1812,11 +1816,11 @@
|
|||
],
|
||||
"description": "Symfony Console Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-05-30T07:26:09+00:00"
|
||||
"time": "2018-05-31T10:17:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
|
|
@ -1869,16 +1873,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
"reference": "449f8b00b28ab6e6912c3e6b920406143b27193b"
|
||||
"reference": "dbe0fad88046a755dcf9379f2964c61a02f5ae3d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/449f8b00b28ab6e6912c3e6b920406143b27193b",
|
||||
"reference": "449f8b00b28ab6e6912c3e6b920406143b27193b",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/dbe0fad88046a755dcf9379f2964c61a02f5ae3d",
|
||||
"reference": "dbe0fad88046a755dcf9379f2964c61a02f5ae3d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -1921,11 +1925,11 @@
|
|||
],
|
||||
"description": "Symfony Debug Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-05-16T14:33:22+00:00"
|
||||
"time": "2018-06-08T09:39:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
|
|
@ -1988,16 +1992,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/finder",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/finder.git",
|
||||
"reference": "087e2ee0d74464a4c6baac4e90417db7477dc238"
|
||||
"reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/087e2ee0d74464a4c6baac4e90417db7477dc238",
|
||||
"reference": "087e2ee0d74464a4c6baac4e90417db7477dc238",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb",
|
||||
"reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -2033,20 +2037,20 @@
|
|||
],
|
||||
"description": "Symfony Finder Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-05-16T14:33:22+00:00"
|
||||
"time": "2018-06-19T21:38:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-foundation",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-foundation.git",
|
||||
"reference": "a916c88390fb861ee21f12a92b107d51bb68af99"
|
||||
"reference": "4f9c7cf962e635b0b26b14500ac046e07dbef7f3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/a916c88390fb861ee21f12a92b107d51bb68af99",
|
||||
"reference": "a916c88390fb861ee21f12a92b107d51bb68af99",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/4f9c7cf962e635b0b26b14500ac046e07dbef7f3",
|
||||
"reference": "4f9c7cf962e635b0b26b14500ac046e07dbef7f3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -2087,20 +2091,20 @@
|
|||
],
|
||||
"description": "Symfony HttpFoundation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-05-25T14:55:38+00:00"
|
||||
"time": "2018-06-19T21:38:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-kernel",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-kernel.git",
|
||||
"reference": "b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90"
|
||||
"reference": "29c094a1c4f8209b7e033f612cbbd69029e38955"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90",
|
||||
"reference": "b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90",
|
||||
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/29c094a1c4f8209b7e033f612cbbd69029e38955",
|
||||
"reference": "29c094a1c4f8209b7e033f612cbbd69029e38955",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -2108,13 +2112,13 @@
|
|||
"psr/log": "~1.0",
|
||||
"symfony/debug": "~3.4|~4.0",
|
||||
"symfony/event-dispatcher": "~4.1",
|
||||
"symfony/http-foundation": "~4.1",
|
||||
"symfony/http-foundation": "^4.1.1",
|
||||
"symfony/polyfill-ctype": "~1.8"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/config": "<3.4",
|
||||
"symfony/dependency-injection": "<4.1",
|
||||
"symfony/var-dumper": "<4.1",
|
||||
"symfony/var-dumper": "<4.1.1",
|
||||
"twig/twig": "<1.34|<2.4,>=2"
|
||||
},
|
||||
"provide": {
|
||||
|
|
@ -2135,7 +2139,7 @@
|
|||
"symfony/stopwatch": "~3.4|~4.0",
|
||||
"symfony/templating": "~3.4|~4.0",
|
||||
"symfony/translation": "~3.4|~4.0",
|
||||
"symfony/var-dumper": "~4.1"
|
||||
"symfony/var-dumper": "^4.1.1"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/browser-kit": "",
|
||||
|
|
@ -2174,7 +2178,7 @@
|
|||
],
|
||||
"description": "Symfony HttpKernel Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-05-30T12:52:34+00:00"
|
||||
"time": "2018-06-25T13:06:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
|
|
@ -2347,16 +2351,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "73445bd33b0d337c060eef9652b94df72b6b3434"
|
||||
"reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/73445bd33b0d337c060eef9652b94df72b6b3434",
|
||||
"reference": "73445bd33b0d337c060eef9652b94df72b6b3434",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a",
|
||||
"reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -2392,20 +2396,20 @@
|
|||
],
|
||||
"description": "Symfony Process Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-05-30T07:26:09+00:00"
|
||||
"time": "2018-05-31T10:17:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/routing",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/routing.git",
|
||||
"reference": "180b51c66d10f09e562c9ebc395b39aacb2cf8a2"
|
||||
"reference": "b38b9797327b26ea2e4146a40e6e2dc9820a6932"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/routing/zipball/180b51c66d10f09e562c9ebc395b39aacb2cf8a2",
|
||||
"reference": "180b51c66d10f09e562c9ebc395b39aacb2cf8a2",
|
||||
"url": "https://api.github.com/repos/symfony/routing/zipball/b38b9797327b26ea2e4146a40e6e2dc9820a6932",
|
||||
"reference": "b38b9797327b26ea2e4146a40e6e2dc9820a6932",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -2418,7 +2422,6 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"doctrine/annotations": "~1.0",
|
||||
"doctrine/common": "~2.2",
|
||||
"psr/log": "~1.0",
|
||||
"symfony/config": "~3.4|~4.0",
|
||||
"symfony/dependency-injection": "~3.4|~4.0",
|
||||
|
|
@ -2470,20 +2473,20 @@
|
|||
"uri",
|
||||
"url"
|
||||
],
|
||||
"time": "2018-05-30T07:26:09+00:00"
|
||||
"time": "2018-06-19T21:38:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/translation",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/translation.git",
|
||||
"reference": "16328f5b217cebc8dd4adfe4aeeaa8c377581f5a"
|
||||
"reference": "b6d8164085ee0b6debcd1b7a131fd6f63bb04854"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/16328f5b217cebc8dd4adfe4aeeaa8c377581f5a",
|
||||
"reference": "16328f5b217cebc8dd4adfe4aeeaa8c377581f5a",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/b6d8164085ee0b6debcd1b7a131fd6f63bb04854",
|
||||
"reference": "b6d8164085ee0b6debcd1b7a131fd6f63bb04854",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -2539,20 +2542,20 @@
|
|||
],
|
||||
"description": "Symfony Translation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-05-30T07:26:09+00:00"
|
||||
"time": "2018-06-22T08:59:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "bc88ad53e825ebacc7b190bbd360781fce381c64"
|
||||
"reference": "b2eebaec085d1f2cafbad7644733d494a3bbbc9b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/bc88ad53e825ebacc7b190bbd360781fce381c64",
|
||||
"reference": "bc88ad53e825ebacc7b190bbd360781fce381c64",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/b2eebaec085d1f2cafbad7644733d494a3bbbc9b",
|
||||
"reference": "b2eebaec085d1f2cafbad7644733d494a3bbbc9b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -2614,7 +2617,7 @@
|
|||
"debug",
|
||||
"dump"
|
||||
],
|
||||
"time": "2018-04-29T07:56:09+00:00"
|
||||
"time": "2018-06-23T12:23:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "tijsverkoyen/css-to-inline-styles",
|
||||
|
|
@ -2742,28 +2745,28 @@
|
|||
},
|
||||
{
|
||||
"name": "vlucas/phpdotenv",
|
||||
"version": "v2.4.0",
|
||||
"version": "v2.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vlucas/phpdotenv.git",
|
||||
"reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c"
|
||||
"reference": "6ae3e2e6494bb5e58c2decadafc3de7f1453f70a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c",
|
||||
"reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c",
|
||||
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/6ae3e2e6494bb5e58c2decadafc3de7f1453f70a",
|
||||
"reference": "6ae3e2e6494bb5e58c2decadafc3de7f1453f70a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8 || ^5.0"
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.4-dev"
|
||||
"dev-master": "2.5-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
|
@ -2773,7 +2776,7 @@
|
|||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause-Attribution"
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
|
|
@ -2788,7 +2791,7 @@
|
|||
"env",
|
||||
"environment"
|
||||
],
|
||||
"time": "2016-09-01T10:05:43+00:00"
|
||||
"time": "2018-07-01T10:25:50+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
|
|
@ -3202,16 +3205,16 @@
|
|||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
"version": "1.8.0",
|
||||
"version": "1.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/myclabs/DeepCopy.git",
|
||||
"reference": "478465659fd987669df0bd8a9bf22a8710e5f1b6"
|
||||
"reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/478465659fd987669df0bd8a9bf22a8710e5f1b6",
|
||||
"reference": "478465659fd987669df0bd8a9bf22a8710e5f1b6",
|
||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8",
|
||||
"reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -3246,20 +3249,20 @@
|
|||
"object",
|
||||
"object graph"
|
||||
],
|
||||
"time": "2018-05-29T17:25:09+00:00"
|
||||
"time": "2018-06-11T23:09:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nunomaduro/collision",
|
||||
"version": "v2.0.2",
|
||||
"version": "v2.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nunomaduro/collision.git",
|
||||
"reference": "245958b02c6a9edf24627380f368333ac5413a51"
|
||||
"reference": "b1f606399ae77e9479b5597cd1aa3d8ea0078176"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/245958b02c6a9edf24627380f368333ac5413a51",
|
||||
"reference": "245958b02c6a9edf24627380f368333ac5413a51",
|
||||
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/b1f606399ae77e9479b5597cd1aa3d8ea0078176",
|
||||
"reference": "b1f606399ae77e9479b5597cd1aa3d8ea0078176",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -3270,7 +3273,8 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"laravel/framework": "5.6.*",
|
||||
"phpunit/phpunit": "~7.0"
|
||||
"phpstan/phpstan": "^0.9.2",
|
||||
"phpunit/phpunit": "~7.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
|
|
@ -3308,7 +3312,7 @@
|
|||
"php",
|
||||
"symfony"
|
||||
],
|
||||
"time": "2018-03-21T20:11:24+00:00"
|
||||
"time": "2018-06-16T22:05:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phar-io/manifest",
|
||||
|
|
@ -3878,16 +3882,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "7.2.4",
|
||||
"version": "7.2.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "00bc0b93f0ff4f557e9ea766557fde96da9a03dd"
|
||||
"reference": "400a3836ee549ae6f665323ac3f21e27eac7155f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/00bc0b93f0ff4f557e9ea766557fde96da9a03dd",
|
||||
"reference": "00bc0b93f0ff4f557e9ea766557fde96da9a03dd",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/400a3836ee549ae6f665323ac3f21e27eac7155f",
|
||||
"reference": "400a3836ee549ae6f665323ac3f21e27eac7155f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -3903,7 +3907,7 @@
|
|||
"php": "^7.1",
|
||||
"phpspec/prophecy": "^1.7",
|
||||
"phpunit/php-code-coverage": "^6.0.7",
|
||||
"phpunit/php-file-iterator": "^2.0",
|
||||
"phpunit/php-file-iterator": "^2.0.1",
|
||||
"phpunit/php-text-template": "^1.2.1",
|
||||
"phpunit/php-timer": "^2.0",
|
||||
"sebastian/comparator": "^3.0",
|
||||
|
|
@ -3958,7 +3962,7 @@
|
|||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2018-06-05T03:40:05+00:00"
|
||||
"time": "2018-06-21T13:13:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/code-unit-reverse-lookup",
|
||||
|
|
@ -4007,16 +4011,16 @@
|
|||
},
|
||||
{
|
||||
"name": "sebastian/comparator",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/comparator.git",
|
||||
"reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5"
|
||||
"reference": "591a30922f54656695e59b1f39501aec513403da"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ed5fd2281113729f1ebcc64d101ad66028aeb3d5",
|
||||
"reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/591a30922f54656695e59b1f39501aec513403da",
|
||||
"reference": "591a30922f54656695e59b1f39501aec513403da",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -4067,7 +4071,7 @@
|
|||
"compare",
|
||||
"equality"
|
||||
],
|
||||
"time": "2018-04-18T13:33:00+00:00"
|
||||
"time": "2018-06-14T15:05:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/diff",
|
||||
|
|
|
|||
|
|
@ -118,6 +118,13 @@ return [
|
|||
| this array to grant expanded functionality to your applications.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
Code Editor
|
||||
|
||||
*/
|
||||
|
||||
'editor' =>'vscode',
|
||||
|
||||
|
||||
'providers' => [
|
||||
|
||||
|
|
@ -163,13 +170,15 @@ return [
|
|||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
|
||||
|
||||
//Webkul packages
|
||||
Webkul\User\Providers\UserServiceProvider::class,
|
||||
Webkul\Admin\Providers\AdminServiceProvider::class,
|
||||
Webkul\Ui\Providers\UiServiceProvider::class,
|
||||
Webkul\Category\Providers\CategoryServiceProvider::class,
|
||||
Webkul\Attribute\Providers\AttributeServiceProvider::class,
|
||||
Webkul\Core\Providers\CoreServiceProvider::class,
|
||||
Webkul\Shop\Providers\ShopServiceProvider::class,
|
||||
Webkul\Customer\Providers\CustomerServiceProvider::class,
|
||||
Webkul\Channel\Providers\ChannelServiceProvider::class,
|
||||
Webkul\Inventory\Providers\InventoryServiceProvider::class,
|
||||
Webkul\Product\Providers\ProductServiceProvider::class
|
||||
|
|
@ -221,7 +230,6 @@ return [
|
|||
'URL' => Illuminate\Support\Facades\URL::class,
|
||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
|
||||
'Datagrid' => Webkul\Ui\DataGrid\Facades\DataGrid::class
|
||||
],
|
||||
|
||||
|
|
|
|||
106
config/auth.php
|
|
@ -1,102 +1,60 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Defaults
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default authentication "guard" and password
|
||||
| reset options for your application. You may change these defaults
|
||||
| as required, but they're a perfect start for most applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'defaults' => [
|
||||
'guard' => 'web',
|
||||
'passwords' => 'users',
|
||||
'passwords' => 'admins',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Guards
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next, you may define every authentication guard for your application.
|
||||
| Of course, a great default configuration has been defined for you
|
||||
| here which uses session storage and the Eloquent user provider.
|
||||
|
|
||||
| All authentication drivers have a user provider. This defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| mechanisms used by this application to persist your user's data.
|
||||
|
|
||||
| Supported: "session", "token"
|
||||
|
|
||||
*/
|
||||
|
||||
'guards' => [
|
||||
'web' => [
|
||||
'driver' => 'session',
|
||||
'provider' => 'users',
|
||||
'provider' => 'admins',
|
||||
],
|
||||
|
||||
'api' => [
|
||||
'driver' => 'token',
|
||||
'provider' => 'users',
|
||||
'provider' => 'admins',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All authentication drivers have a user provider. This defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| mechanisms used by this application to persist your user's data.
|
||||
|
|
||||
| If you have multiple user tables or models you may configure multiple
|
||||
| sources which represent each model / table. These sources may then
|
||||
| be assigned to any extra authentication guards you have defined.
|
||||
|
|
||||
| Supported: "database", "eloquent"
|
||||
|
|
||||
*/
|
||||
'customer' =>[
|
||||
'driver' => 'session',
|
||||
'provider' => 'customers'
|
||||
],
|
||||
|
||||
'admin' => [
|
||||
'driver' => 'session',
|
||||
'provider' => 'admins'
|
||||
],
|
||||
|
||||
'admin-api' => [
|
||||
'driver' => 'token',
|
||||
'provider' => 'admins',
|
||||
]
|
||||
],
|
||||
|
||||
'providers' => [
|
||||
'users' => [
|
||||
'customers' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => App\User::class,
|
||||
'model' => Webkul\Customer\Models\Customer::class,
|
||||
],
|
||||
|
||||
// 'users' => [
|
||||
// 'driver' => 'database',
|
||||
// 'table' => 'users',
|
||||
// ],
|
||||
'admins' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => Webkul\User\Models\Admin::class,
|
||||
]
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Resetting Passwords
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may specify multiple password reset configurations if you have more
|
||||
| than one user table or model in the application and you want to have
|
||||
| separate password reset settings based on the specific user types.
|
||||
|
|
||||
| The expire time is the number of minutes that the reset token should be
|
||||
| considered valid. This security feature keeps tokens short-lived so
|
||||
| they have less time to be guessed. You may change this as needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'passwords' => [
|
||||
'users' => [
|
||||
'provider' => 'users',
|
||||
'table' => 'password_resets',
|
||||
'admins' => [
|
||||
'provider' => 'admins',
|
||||
'table' => 'admin_password_resets',
|
||||
'expire' => 60,
|
||||
],
|
||||
'customers' => [
|
||||
'provider' => 'customers',
|
||||
'table' => 'customers_password_resets',
|
||||
'expire' => 60,
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,23 +1,24 @@
|
|||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "npm run development",
|
||||
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"watch-poll": "npm run watch -- --watch-poll",
|
||||
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"prod": "npm run production",
|
||||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^0.18",
|
||||
"cross-env": "^5.1.4",
|
||||
"laravel-mix": "^2.1",
|
||||
"laravel-mix-merge-manifest": "^0.1.1",
|
||||
"jquery": "^3.2",
|
||||
"vue": "^2.1.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"vee-validate": "2.0.0-rc.26"
|
||||
}
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "npm run development",
|
||||
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"watch-poll": "npm run watch -- --watch-poll",
|
||||
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"prod": "npm run production",
|
||||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^0.18",
|
||||
"cross-env": "^5.1.4",
|
||||
"laravel-mix": "^2.1",
|
||||
"laravel-mix-merge-manifest": "^0.1.1",
|
||||
"jquery": "^3.2",
|
||||
"vue": "^2.1.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"vee-validate": "2.0.0-rc.26",
|
||||
"vue-flatpickr": "^2.3.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'guards' => [
|
||||
'web' => [
|
||||
'driver' => 'session',
|
||||
|
|
@ -12,6 +13,11 @@ return [
|
|||
'provider' => 'users',
|
||||
],
|
||||
|
||||
'customer' =>[
|
||||
'driver' => 'session',
|
||||
'provider' => 'customers'
|
||||
],
|
||||
|
||||
'admin' => [
|
||||
'driver' => 'session',
|
||||
'provider' => 'admins'
|
||||
|
|
@ -27,7 +33,12 @@ return [
|
|||
'users' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => Webkul\User\Models\User::class,
|
||||
],
|
||||
],
|
||||
|
||||
'customers' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => Webkul\Customer\Models\Customer::class,
|
||||
],
|
||||
|
||||
'admins' => [
|
||||
'driver' => 'eloquent',
|
||||
|
|
@ -41,5 +52,10 @@ return [
|
|||
'table' => 'admin_password_resets',
|
||||
'expire' => 60,
|
||||
],
|
||||
'customers' => [
|
||||
'provider' => 'customers',
|
||||
'table' => 'customers_password_resets',
|
||||
'expire' => 60,
|
||||
],
|
||||
],
|
||||
];
|
||||
];
|
||||
|
|
|
|||
|
|
@ -19,8 +19,14 @@ class DashboardController extends Controller
|
|||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_config = request('_config');
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
return view('admin::dashboard.index');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,57 +21,203 @@ class DataGridController extends Controller
|
|||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
{
|
||||
// $select_verbs = [
|
||||
// 0 => "aggregate",
|
||||
// 1 => "columns",
|
||||
// 2 => "from",
|
||||
// 3 => "joins",
|
||||
// 4 => "wheres",
|
||||
// 5 => "groups",
|
||||
// 6 => "havings",
|
||||
// 7 => "orders",
|
||||
// 8 => "limit",
|
||||
// 9 => "offset",
|
||||
// 10 => "lock"
|
||||
// ];
|
||||
// $bindings = [
|
||||
// "select" => [],
|
||||
// "from" => [],
|
||||
// "join" => [],
|
||||
// "where" => [],
|
||||
// "having" => [],
|
||||
// "order" => [],
|
||||
// "union" => [],
|
||||
// ];
|
||||
// $operators = [
|
||||
// 'eq' => "=",
|
||||
// 'lt' => "<",
|
||||
// 'gt' => ">",
|
||||
// 'lte' => "<=",
|
||||
// 'gte' => ">=",
|
||||
// 'neqs' => "<>",
|
||||
// 'neqn' => "!=",
|
||||
// 'ceq' => "<=>",
|
||||
// 'like' => "like",
|
||||
// 'likebin' => "like binary",
|
||||
// 'ntlike' => "not like",
|
||||
// 'ilike' => "ilike",
|
||||
// 'regex' => "regexp",
|
||||
// 'notregex' => "not regexp",
|
||||
// 'simto' => "similar to",
|
||||
// 'nsimto' => "not similar to",
|
||||
// 'nilike' => "not ilike",
|
||||
// ];
|
||||
DataGrid::make([
|
||||
'name' => 'admin',
|
||||
'name' => 'authors',
|
||||
'table' => 'authors as a',
|
||||
'select' => 'a.id',
|
||||
'table' => 'admins as a',
|
||||
'join' => [
|
||||
'aliased' => true , //boolean to validate aliasing on the basis of this.
|
||||
'filterable' => [
|
||||
[
|
||||
'join' => 'leftjoin',
|
||||
'table' => 'roles as r',
|
||||
'primaryKey' => 'a.role_id',
|
||||
'condition' => '=',
|
||||
'secondryKey' => 'r.id',
|
||||
'column' => 'a.id',
|
||||
'type' => 'integer',
|
||||
'label' => 'Admin ID'
|
||||
], [
|
||||
'column' => 'a.email',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin E-Mail',
|
||||
], [
|
||||
'column' => 'a.first_name',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin Name',
|
||||
]
|
||||
],
|
||||
'columns' => [
|
||||
'searchables' =>[
|
||||
[
|
||||
'name' => 'a.id as aila',
|
||||
'type' => 'string',
|
||||
'label' => 'Id',
|
||||
'sortable' => true,
|
||||
'name' => 'a.id',
|
||||
'label' => 'ID',
|
||||
'label' => 'Admin ID',
|
||||
],
|
||||
[
|
||||
'name' => 'a.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'label' => 'Admin Name',
|
||||
]
|
||||
],
|
||||
'join' => [
|
||||
// [
|
||||
// 'join' => 'leftjoin',
|
||||
// 'table' => 'posts as p',
|
||||
// 'primaryKey' => 'a.id',
|
||||
// 'condition' => '=',
|
||||
// 'secondaryKey' => 'p.author_id',
|
||||
// ]
|
||||
],
|
||||
'columns' => [
|
||||
[
|
||||
'name' => 'a.id',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin ID',
|
||||
'sortable' => true,
|
||||
'filterable' => false,
|
||||
'filterable' => true
|
||||
],
|
||||
[
|
||||
'name' => 'a.email',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin E-Mail',
|
||||
'sortable' => true,
|
||||
'filterable' => true
|
||||
],
|
||||
// [
|
||||
// 'name' => 'p.content as pp',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Content',
|
||||
// 'sortable' => true,
|
||||
// 'filterable' => false,
|
||||
// ],
|
||||
[
|
||||
'name' => 'a.first_name',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin Name',
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
// will create on run time query
|
||||
// 'filter' => [
|
||||
// 'function' => 'where', // andwhere
|
||||
// 'condition' => ['u.user_id', '=', '1'] // multiarray
|
||||
// 'function' => 'where', // orwhere
|
||||
// 'condition' => ['name', '=', 'Admin'] // multiarray
|
||||
// ],
|
||||
'attributes' => [
|
||||
'class' => 'class-a class-b',
|
||||
'data-attr' => 'whatever you want',
|
||||
'onclick' => "window.alert('alert from datagrid column')"
|
||||
],
|
||||
'wrapper' => function($value, $object){
|
||||
return '<a href="'.$value.'">' . $object->name . '</a>';
|
||||
'wrapper' => function ($value, $object) {
|
||||
return '<a href="'.$value.'">' . $object->first_name . '</a>';
|
||||
},
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'operators' => [
|
||||
'eq' => "=",
|
||||
'lt' => "<",
|
||||
'gt' => ">",
|
||||
'lte' => "<=",
|
||||
'gte' => ">=",
|
||||
'neqn' => "!=",
|
||||
'ceq' => "<=>",
|
||||
'like' => "like",
|
||||
'nlike' => "not like",
|
||||
],
|
||||
'mass_operations' =>[
|
||||
[
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'method' => 'DELETE',
|
||||
'label' => 'Delete',
|
||||
'type' => 'button',
|
||||
|
||||
]
|
||||
],
|
||||
// 'css' => []
|
||||
|
||||
]);
|
||||
|
||||
$result = DataGrid::render();
|
||||
|
||||
// dump($result);
|
||||
// dd('datagrid');
|
||||
|
||||
return $result;
|
||||
// $prepareMassAction = DataGrid::massAction();
|
||||
// if ($prepareMassAction) {
|
||||
// $result = DataGrid::render();
|
||||
// return $result;
|
||||
// } else {
|
||||
// throw new \Exception('Mass Actions Attributes Have Some Unknown Problems');
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
//for performing mass actions
|
||||
public function massAction()
|
||||
{
|
||||
$make = [
|
||||
'operations' =>[
|
||||
// [
|
||||
// 'route' => 'datagrid/update',
|
||||
// 'method' => 'post',
|
||||
// 'label' => 'Update',
|
||||
// 'type' => 'select',
|
||||
// 'name' => 'status',
|
||||
// 'values' => [
|
||||
// [
|
||||
// 'label' => 'Enable',
|
||||
// 'value' => 1
|
||||
// ], [
|
||||
// 'label' => 'Disable',
|
||||
// 'value' => 0
|
||||
// ]
|
||||
// ],
|
||||
// ],
|
||||
[
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'method' => 'DELETE',
|
||||
'label' => 'Delete',
|
||||
'type' => 'button'
|
||||
]
|
||||
]
|
||||
];
|
||||
$result = DataGrid::makeMassAction($make);
|
||||
// return $result;
|
||||
}
|
||||
|
||||
public function massDelete(Request $r)
|
||||
{
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,163 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Http\ViewComposers\DataGrids;
|
||||
|
||||
use Illuminate\View\View;
|
||||
use Webkul\Ui\DataGrid\Facades\DataGrid;
|
||||
|
||||
// use App\Repositories\UserRepository;
|
||||
|
||||
class UserComposer
|
||||
{
|
||||
/**
|
||||
* The user repository implementation.
|
||||
*
|
||||
* @var UserRepository
|
||||
*/
|
||||
protected $users;
|
||||
|
||||
/**
|
||||
* Create a new profile composer.
|
||||
*
|
||||
* @param UserRepository $users
|
||||
* @return void
|
||||
*/
|
||||
// public function __construct(UserRepository $users)
|
||||
// {
|
||||
// // Dependencies automatically resolved by service container...
|
||||
// $this->users = $users;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
* @param View $view
|
||||
* @return void
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$datagrid = DataGrid::make([
|
||||
'name' => 'Admins',
|
||||
'table' => 'admins as u',
|
||||
'select' => 'u.id',
|
||||
'aliased' => true, //boolean to validate aliasing on the basis of this.
|
||||
'filterable' => [
|
||||
[
|
||||
'column' => 'u.email',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin E-Mail'
|
||||
], [
|
||||
'column' => 'u.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin Name'
|
||||
], [
|
||||
'column' => 'u.id',
|
||||
'type' => 'number',
|
||||
'label' => 'Admin ID'
|
||||
]
|
||||
],
|
||||
'searchable' => [
|
||||
[
|
||||
'column' => 'u.email',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin E-Mail'
|
||||
], [
|
||||
'column' => 'u.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin Name'
|
||||
]
|
||||
],
|
||||
'massoperations' =>[
|
||||
[
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'method' => 'DELETE',
|
||||
'label' => 'Delete',
|
||||
'type' => 'button',
|
||||
],
|
||||
// [
|
||||
// 'route' => route('admin.datagrid.index'),
|
||||
// 'method' => 'POST',
|
||||
// 'label' => 'View Grid',
|
||||
// 'type' => 'select',
|
||||
// 'options' =>[
|
||||
// 1 => 'Edit',
|
||||
// 2 => 'Set',
|
||||
// 3 => 'Change Status'
|
||||
// ]
|
||||
// ],
|
||||
],
|
||||
'join' => [
|
||||
// [
|
||||
// 'join' => 'leftjoin',
|
||||
// 'table' => 'roles as r',
|
||||
// 'primaryKey' => 'u.role_id',
|
||||
// 'condition' => '=',
|
||||
// 'secondaryKey' => 'r.id',
|
||||
// ]
|
||||
],
|
||||
'columns' => [
|
||||
[
|
||||
'name' => 'u.id',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'u.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'u.email',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin E-Mail',
|
||||
'sortable' => true,
|
||||
],
|
||||
// [
|
||||
// 'name' => 'r.name as rolename',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Role Name',
|
||||
// 'sortable' => true,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'a.first_name',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Admin Name',
|
||||
// 'sortable' => true,
|
||||
// 'filterable' => true,
|
||||
// // will create on run time query
|
||||
// // 'filter' => [
|
||||
// // 'function' => 'where', // orwhere
|
||||
// // 'condition' => ['name', '=', 'Admin'] // multiarray
|
||||
// // ],
|
||||
// 'attributes' => [
|
||||
// 'class' => 'class-a class-b',
|
||||
// 'data-attr' => 'whatever you want',
|
||||
// 'onclick' => "window.alert('alert from datagrid column')"
|
||||
// ],
|
||||
// 'wrapper' => function ($value, $object) {
|
||||
// return '<a href="'.$value.'">' . $object->first_name . '</a>';
|
||||
// },
|
||||
// ],
|
||||
|
||||
],
|
||||
'operators' => [
|
||||
'eq' => "=",
|
||||
'lt' => "<",
|
||||
'gt' => ">",
|
||||
'lte' => "<=",
|
||||
'gte' => ">=",
|
||||
'neqs' => "<>",
|
||||
'neqn' => "!=",
|
||||
'like' => "like",
|
||||
'nlike' => "not like",
|
||||
],
|
||||
// 'css' => []
|
||||
|
||||
]);
|
||||
|
||||
$view->with('datagrid', $datagrid);
|
||||
// $view->with('count', $this->users->count());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
Route::group(['middleware' => ['web']], function () {
|
||||
|
||||
Route::prefix('admin')->group(function () {
|
||||
// Login Routes
|
||||
Route::get('/login', 'Webkul\User\Http\Controllers\SessionController@create')->defaults('_config', [
|
||||
|
|
@ -122,8 +121,11 @@ Route::group(['middleware' => ['web']], function () {
|
|||
|
||||
|
||||
// Datagrid Routes
|
||||
Route::get('/datagrid', 'Webkul\Admin\Http\Controllers\DataGridController@index')->name('admin.datagrid.index');
|
||||
|
||||
//for datagrid and its loading, filtering, sorting and queries
|
||||
Route::get('datagrid', 'Webkul\Admin\Http\Controllers\DataGridController@index')->name('admin.datagrid.index');
|
||||
|
||||
Route::any('datagrid/massaction/delete', 'Webkul\Admin\Http\Controllers\DataGridController@massDelete')->name('admin.datagrid.delete');
|
||||
|
||||
// User Routes
|
||||
Route::get('/users', 'Webkul\User\Http\Controllers\UserController@index')->defaults('_config', [
|
||||
'view' => 'admin::users.users.index'
|
||||
|
|
@ -150,7 +152,7 @@ Route::group(['middleware' => ['web']], function () {
|
|||
Route::get('/roles', 'Webkul\User\Http\Controllers\RoleController@index')->defaults('_config', [
|
||||
'view' => 'admin::users.roles.index'
|
||||
])->name('admin.roles.index');
|
||||
|
||||
|
||||
Route::get('/roles/create', 'Webkul\User\Http\Controllers\RoleController@create')->defaults('_config', [
|
||||
'view' => 'admin::users.roles.create'
|
||||
])->name('admin.roles.create');
|
||||
|
|
@ -172,7 +174,7 @@ Route::group(['middleware' => ['web']], function () {
|
|||
Route::get('/locales', 'Webkul\Core\Http\Controllers\LocaleController@index')->defaults('_config', [
|
||||
'view' => 'admin::settings.locales.index'
|
||||
])->name('admin.locales.index');
|
||||
|
||||
|
||||
Route::get('/locales/create', 'Webkul\Core\Http\Controllers\LocaleController@create')->defaults('_config', [
|
||||
'view' => 'admin::settings.locales.create'
|
||||
])->name('admin.locales.create');
|
||||
|
|
@ -281,8 +283,8 @@ Route::group(['middleware' => ['web']], function () {
|
|||
Route::get('/account', 'Webkul\User\Http\Controllers\AccountController@edit')->defaults('_config', [
|
||||
'view' => 'admin::account.edit'
|
||||
])->name('admin.account.edit');
|
||||
|
||||
|
||||
Route::put('/account', 'Webkul\User\Http\Controllers\AccountController@update')->name('admin.account.update');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use Illuminate\Support\ServiceProvider;
|
|||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Webkul\Admin\Providers\EventServiceProvider;
|
||||
use Webkul\Admin\Providers\ComposerServiceProvider;
|
||||
|
||||
class AdminServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -28,7 +29,12 @@ class AdminServiceProvider extends ServiceProvider
|
|||
|
||||
$this->composeView();
|
||||
|
||||
Blade::directive('continue', function () {
|
||||
return "<?php continue; ?>";
|
||||
});
|
||||
|
||||
$this->app->register(EventServiceProvider::class);
|
||||
$this->app->register(ComposerServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -38,19 +44,19 @@ class AdminServiceProvider extends ServiceProvider
|
|||
*/
|
||||
protected function composeView()
|
||||
{
|
||||
view()->composer(['admin::layouts.nav-left', 'admin::layouts.nav-aside', 'admin::layouts.tabs'], function($view) {
|
||||
view()->composer(['admin::layouts.nav-left', 'admin::layouts.nav-aside', 'admin::layouts.tabs'], function ($view) {
|
||||
$menu = current(Event::fire('admin.menu.create'));
|
||||
|
||||
$keys = explode('.', $menu->currentKey);
|
||||
$subMenus = $tabs = [];
|
||||
if(count($keys) > 1) {
|
||||
if (count($keys) > 1) {
|
||||
$subMenus = [
|
||||
'items' => $menu->sortItems(array_get($menu->items, current($keys) . '.children')),
|
||||
'current' => $menu->current,
|
||||
'currentKey' => $menu->currentKey
|
||||
];
|
||||
|
||||
if(count($keys) > 2) {
|
||||
if (count($keys) > 2) {
|
||||
$tabs = [
|
||||
'items' => $menu->sortItems(array_get($menu->items, implode('.children.', array_slice($keys, 0, 2)) . '.children')),
|
||||
'current' => $menu->current,
|
||||
|
|
@ -68,12 +74,13 @@ class AdminServiceProvider extends ServiceProvider
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->mergeConfigFrom(
|
||||
__DIR__ . '/../Config/auth.php', 'auth'
|
||||
);
|
||||
}
|
||||
// public function register()
|
||||
// {
|
||||
// $this->mergeConfigFrom(
|
||||
// __DIR__ . '/../Config/auth.php',
|
||||
// 'auth'
|
||||
// );
|
||||
// }
|
||||
|
||||
/**
|
||||
* Merge the given configuration with the existing configuration.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use View;
|
||||
|
||||
class ComposerServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register bindings in the container.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
// Using class based composers...
|
||||
View::composer('admin::users.users.index', 'Webkul\Admin\Http\ViewComposers\DataGrids\UserComposer');
|
||||
|
||||
// Using Closure based composers...
|
||||
|
||||
// View::composer('admin::users.index', function ($view) {
|
||||
// //
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,28 @@
|
|||
window.jQuery = window.$ = $ = require('jquery');
|
||||
window.Vue = require('vue');
|
||||
window.VeeValidate = require('vee-validate');
|
||||
window.jQuery = window.$ = $ = require("jquery");
|
||||
window.Vue = require("vue");
|
||||
window.VeeValidate = require("vee-validate");
|
||||
|
||||
Vue.use(VeeValidate);
|
||||
|
||||
//register single file components here
|
||||
// import VueFlatpickr from "vue-flatpickr";
|
||||
// import "vue-flatpickr/theme/dark.css";
|
||||
// Vue.use(VueFlatpickr);
|
||||
|
||||
Vue.component("datetime", require("./components/datetime"));
|
||||
|
||||
$(document).ready(function() {
|
||||
const app = new Vue({
|
||||
el: "#app",
|
||||
|
||||
mounted: function() {
|
||||
this.addServerErrors();
|
||||
this.addFlashMessages();
|
||||
},
|
||||
|
||||
methods: {
|
||||
onSubmit: function(e) {
|
||||
this.$validator.validateAll().then(result => {
|
||||
$(document).ready(function () {
|
||||
Vue.config.ignoredElements = [
|
||||
'option-wrapper',
|
||||
|
|
@ -27,7 +46,7 @@ $(document).ready(function () {
|
|||
onSubmit (e) {
|
||||
this.$validator.validateAll().then((result) => {
|
||||
if (result) {
|
||||
e.target.submit()
|
||||
e.target.submit();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -35,6 +54,10 @@ $(document).ready(function () {
|
|||
addServerErrors () {
|
||||
var scope = null;
|
||||
for (var key in serverErrors) {
|
||||
const field = this.$validator.fields.find({
|
||||
name: key,
|
||||
scope: scope
|
||||
});
|
||||
var inputName = key;
|
||||
if(key.indexOf('.') !== -1) {
|
||||
inputName = key.replace(".", "[") + ']';
|
||||
|
|
@ -46,17 +69,17 @@ $(document).ready(function () {
|
|||
id: field.id,
|
||||
field: inputName,
|
||||
msg: serverErrors[key][0],
|
||||
scope: scope,
|
||||
scope: scope
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
addFlashMessages () {
|
||||
const flashes = this.$refs.flashes
|
||||
addFlashMessages: function() {
|
||||
const flashes = this.$refs.flashes;
|
||||
|
||||
flashMessages.forEach(function(flash) {
|
||||
flashes.addFlash(flash)
|
||||
flashes.addFlash(flash);
|
||||
}, this);
|
||||
},
|
||||
|
||||
|
|
@ -65,4 +88,4 @@ $(document).ready(function () {
|
|||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
<template>
|
||||
<Flatpickr class="datetime-field" :options="fpOptions" />
|
||||
</template>
|
||||
<script>
|
||||
window.Vue = require("vue");
|
||||
import VueFlatpickr from "vue-flatpickr";
|
||||
import "vue-flatpickr/theme/airbnb.css";
|
||||
|
||||
Vue.use(VueFlatpickr);
|
||||
|
||||
export default {
|
||||
data() {
|
||||
const now = new Date();
|
||||
console.log(now);
|
||||
return {
|
||||
fpOptions: {
|
||||
utc: false,
|
||||
defaultDate: now,
|
||||
enableTime: true
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
mounted: function() {
|
||||
console.log("Date time compoenent mounted");
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.datetime-field {
|
||||
border: 2px solid #c7c7c7;
|
||||
border-radius: 3px;
|
||||
font-family: "Montserrat", sans-serif;
|
||||
height: 35px;
|
||||
padding-left: 5px;
|
||||
color: gray;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -15,11 +15,11 @@ body {
|
|||
min-height: 100%;
|
||||
}
|
||||
|
||||
.navbar-top {
|
||||
.navbar-top {
|
||||
height: 60px;
|
||||
background: #FFFFFF;
|
||||
background: #ffffff;
|
||||
font-size: 0;
|
||||
@include box-shadow(0 3px 6px 0 rgba(0,0,0,0.05));
|
||||
@include box-shadow(0 3px 6px 0 rgba(0, 0, 0, 0.05));
|
||||
border-bottom: 1px solid $border-color;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
|
|
@ -44,7 +44,7 @@ body {
|
|||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
|
||||
.profile-info {
|
||||
.profile-info {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
text-align: left;
|
||||
|
|
@ -59,7 +59,7 @@ body {
|
|||
.dropdown-list {
|
||||
top: 63px;
|
||||
}
|
||||
|
||||
|
||||
.name {
|
||||
color: #000311;
|
||||
display: block;
|
||||
|
|
@ -67,7 +67,7 @@ body {
|
|||
}
|
||||
.role {
|
||||
font-size: 14px;
|
||||
color: #8E8E8E;
|
||||
color: #8e8e8e;
|
||||
display: block;
|
||||
text-align: left;
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ body {
|
|||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-left {
|
||||
|
|
@ -90,7 +90,6 @@ body {
|
|||
z-index: 2;
|
||||
|
||||
ul.menubar {
|
||||
|
||||
li.menu-item {
|
||||
height: 90px;
|
||||
padding: 10px 5px;
|
||||
|
|
@ -99,12 +98,12 @@ body {
|
|||
text-transform: uppercase;
|
||||
|
||||
a {
|
||||
color: #A2A2A2;
|
||||
color: #a2a2a2;
|
||||
}
|
||||
|
||||
&.active {
|
||||
a {
|
||||
color: #0041FF;
|
||||
color: #0041ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -121,14 +120,14 @@ body {
|
|||
bottom: 0px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
|
||||
.aside-nav {
|
||||
width: 280px;
|
||||
position: fixed;
|
||||
top: 60px;
|
||||
bottom: 0;
|
||||
border-right: 1px solid $border-color;
|
||||
background: #F8F9FA;
|
||||
background: #f8f9fa;
|
||||
padding-top: 10px;
|
||||
overflow-y: auto;
|
||||
z-index: 4;
|
||||
|
|
@ -163,7 +162,7 @@ body {
|
|||
&.full-page {
|
||||
padding: 25px;
|
||||
}
|
||||
|
||||
|
||||
.page-header {
|
||||
display: inline-block;
|
||||
margin-bottom: 20px;
|
||||
|
|
@ -201,4 +200,41 @@ body {
|
|||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//style for dummy datagrid
|
||||
// .page-content {
|
||||
// .table-container {
|
||||
// .search-filter-wrapper {
|
||||
// display: inline-block;
|
||||
// box-sizing: border-box;
|
||||
|
||||
// width: 100%;
|
||||
// padding-top: 7px;
|
||||
// padding-bottom: 7px;
|
||||
|
||||
// .search-products {
|
||||
// width: 300px;
|
||||
// border: 2px solid $border-color;
|
||||
// border-radius: 3px;
|
||||
// height: 30px;
|
||||
// padding-left: 5px;
|
||||
// }
|
||||
|
||||
// .icon-wrapper {
|
||||
// margin: 0px;
|
||||
// display: inline-block;
|
||||
// vertical-align: middle;
|
||||
// border: 1px solid #c7c7c7;
|
||||
// border-radius: 4px;
|
||||
// padding-left: 5px;
|
||||
// padding-right: 5px;
|
||||
|
||||
// .search-icon {
|
||||
// height: 24px;
|
||||
// width: 24px;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="page-action">
|
||||
<a href="{{ route('admin.users.create') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('Add User') }}
|
||||
|
|
@ -16,6 +20,9 @@
|
|||
|
||||
<div class="page-content">
|
||||
|
||||
{!! $datagrid->render() !!}
|
||||
{{-- <datetime></datetime> --}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
const { mix } = require('laravel-mix');
|
||||
require('laravel-mix-merge-manifest');
|
||||
const { mix } = require("laravel-mix");
|
||||
require("laravel-mix-merge-manifest");
|
||||
|
||||
// var publicPath = 'publishable/assets';
|
||||
var publicPath = '../../../public/vendor/webkul/admin/assets';
|
||||
var publicPath = "../../../public/vendor/webkul/admin/assets";
|
||||
|
||||
mix.setPublicPath(publicPath).mergeManifest();
|
||||
mix.disableNotifications();
|
||||
|
||||
mix.js(__dirname + '/src/Resources/assets/js/app.js', 'js/admin.js')
|
||||
.copyDirectory( __dirname + '/src/Resources/assets/images', publicPath + '/images')
|
||||
.sass( __dirname + '/src/Resources/assets/sass/app.scss', 'css/admin.css')
|
||||
mix.js(__dirname + "/src/Resources/assets/js/app.js", "js/admin.js")
|
||||
// .copyDirectory( __dirname + '/src/Resources/assets/images', publicPath + '/images')
|
||||
.sass(__dirname + "/src/Resources/assets/sass/app.scss", "css/admin.css")
|
||||
.options({
|
||||
'processCssUrls': false
|
||||
processCssUrls: false
|
||||
});
|
||||
|
||||
if (mix.inProduction()) {
|
||||
mix.version();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
/node_modules
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "webkul/laravel-customer",
|
||||
"description": "Customers Package for themeing and various features for customers",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "prashant-webkul",
|
||||
"email": "prashant.singh852@webkul.com"
|
||||
}
|
||||
],
|
||||
"require": {},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\Customer\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\Customer\\Providers\\CustomerServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "npm run development",
|
||||
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"watch-poll": "npm run watch -- --watch-poll",
|
||||
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"prod": "npm run production",
|
||||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^0.18",
|
||||
"cross-env": "^5.1.4",
|
||||
"laravel-mix": "^2.1",
|
||||
"laravel-mix-merge-manifest": "^0.1.1",
|
||||
"jquery": "^3.2",
|
||||
"vue": "^2.1.10"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateCustomerGroupsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('customer_groups', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('group_name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('customer_groups');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateCustomerAddressesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('customer_addresses', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('street');
|
||||
$table->string('address1');
|
||||
$table->string('address2');
|
||||
$table->string('country');
|
||||
$table->string('state');
|
||||
$table->string('city');
|
||||
$table->integer('pincode');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('customer_addresses');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateCustomersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('customers', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('first_name');
|
||||
$table->string('last_name');
|
||||
$table->string('email');
|
||||
$table->string('password');
|
||||
$table->integer('customer_group_id')->unsigned()->nullable();
|
||||
$table->integer('address_id')->unsigned()->nullable();
|
||||
$table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade');
|
||||
$table->foreign('address_id')->references('id')->on('customer_addresses')->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('customers');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddRememberTokenInCustomersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('customers', function (Blueprint $table) {
|
||||
$table->rememberToken();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Customer\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Customer\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
/**
|
||||
* Customer controlller for the customer
|
||||
* basically for the tasks of customers
|
||||
* which will be done after customer
|
||||
* authenticastion.
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class CustomerController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_config = request('_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* For taking the customer
|
||||
* to the dashboard after
|
||||
* authentication
|
||||
* @return view
|
||||
*/
|
||||
public function dashboard()
|
||||
{
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Customer\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Webkul\Customer\Models\Customer;
|
||||
|
||||
/**
|
||||
* Dashboard controller
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class RegistrationController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_config = request('_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* For showing the registration form
|
||||
* @return view
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
/**
|
||||
* For collecting the registration
|
||||
* data from the registraion form
|
||||
* @return view
|
||||
*/
|
||||
public function create(Request $request)
|
||||
{
|
||||
// return $request->except('_token'); //don't let csrf token to be openly printed
|
||||
$request->validate([
|
||||
'first_name' => 'string|required',
|
||||
'last_name' => 'string|required',
|
||||
'email' => 'email|required',
|
||||
'password' => 'confirmed|min:8|required'
|
||||
]);
|
||||
$customer = new \Webkul\Customer\Models\Customer();
|
||||
$customer->first_name = $request->first_name;
|
||||
$customer->last_name = $request->last_name;
|
||||
$customer->email = $request->email;
|
||||
$customer->password = bcrypt($request->password);
|
||||
// dd('hello1');
|
||||
if ($customer->save()) {
|
||||
session()->flash('success', 'Account created successfully.');
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
} else {
|
||||
session()->flash('error', 'Cannot Create Your Account.');
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Customer\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Webkul\Customer\Models\Customer;
|
||||
|
||||
/**
|
||||
* Session controller for the user customer
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class SessionController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_config = request('_config');
|
||||
}
|
||||
|
||||
public function show()
|
||||
{
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'email' => 'required|email',
|
||||
'password' => 'required'
|
||||
]);
|
||||
|
||||
// $remember = request('remember');
|
||||
if (!auth()->guard('customer')->attempt(request(['email', 'password']))) {
|
||||
dd('cannot be authorized');
|
||||
session()->flash('error', 'Please check your credentials and try again.');
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
auth()->guard('customer')->logout();
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Customer\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RedirectIfNotCustomer
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param string|null $guard
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next, $guard = 'customer')
|
||||
{
|
||||
if (! Auth::guard($guard)->check()) {
|
||||
return redirect()->route('customer.session.index');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
Route::group(['middleware' => ['web']], function () {
|
||||
Route::prefix('customer')->group(function () {
|
||||
|
||||
// Login Routes
|
||||
Route::get('/login', 'Webkul\Customer\Http\Controllers\SessionController@show')->defaults('_config', [
|
||||
'view' => 'customer::login.index',
|
||||
])->name('customer.session.index');
|
||||
|
||||
Route::post('/login', 'Webkul\Customer\Http\Controllers\SessionController@create')->defaults('_config', [
|
||||
'redirect' => 'customer.dashboard.index'
|
||||
])->name('customer.session.create');
|
||||
|
||||
|
||||
// Registration Routes
|
||||
Route::get('/register', 'Webkul\Customer\Http\Controllers\RegistrationController@show')->defaults('_config', [
|
||||
'view' => 'customer::signup.index' //hint path
|
||||
])->name('customer.register.index');
|
||||
|
||||
Route::post('/register', 'Webkul\Customer\Http\Controllers\RegistrationController@create')->defaults('_config', [
|
||||
'redirect' => 'customer.dashboard.index',
|
||||
])->name('customer.register.create');
|
||||
|
||||
// Auth Routes
|
||||
Route::group(['middleware' => ['customer']], function () {
|
||||
|
||||
//route for logout which will be under the auth guard of the customer by default
|
||||
Route::get('/logout', 'Webkul\Customer\Http\Controllers\SessionController@destroy')->defaults('_config', [
|
||||
'redirect' => 'customer.session.index'
|
||||
])->name('customer.session.destroy');
|
||||
|
||||
//customer dashboard
|
||||
Route::get('/dashboard', 'Webkul\Customer\Http\Controllers\CustomerController@dashboard')->defaults('_config', [
|
||||
'view' => 'customer::dashboard.index'
|
||||
])->name('customer.dashboard.index');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Customer\Models;
|
||||
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
||||
// use Webkul\User\Notifications\AdminResetPassword;
|
||||
|
||||
// use Webkul\User\Notifications\AdminResetPassword;
|
||||
|
||||
|
||||
class Customer extends Authenticatable
|
||||
{
|
||||
use Notifiable;
|
||||
|
||||
protected $table = 'customers';
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Webkul\Customer\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CustomersGroups extends Model
|
||||
{
|
||||
protected $table = 'customer_groups';
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
namespace Webkul\Customer\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CustomersAddress extends Model
|
||||
{
|
||||
protected $table = 'customer_addresses';
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\User\Notifications;
|
||||
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Auth\Notifications\ResetPassword;
|
||||
|
||||
class CustomerResetPassword extends ResetPassword
|
||||
{
|
||||
|
||||
/**
|
||||
* Build the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @return \Illuminate\Notifications\Messages\MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
if (static::$toMailCallback) {
|
||||
return call_user_func(static::$toMailCallback, $notifiable, $this->token);
|
||||
}
|
||||
|
||||
return (new MailMessage)
|
||||
->line('You are receiving this email because we received a password reset request for your account.')
|
||||
->action('Reset Password', route('customer.reset-password.create', $this->token))
|
||||
->line('If you did not request a password reset, no further action is required.');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Customer\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Routing\Router;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Webkul\Customer\Http\Middleware\RedirectIfNotCustomer;
|
||||
use Webkul\Admin\Providers\EventServiceProvider;
|
||||
|
||||
// use Webkul\Admin\Providers\ComposerServiceProvider;
|
||||
|
||||
class CustomerServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function boot(Router $router)
|
||||
{
|
||||
include __DIR__ . '/../Http/routes.php';
|
||||
|
||||
$this->publishes([
|
||||
__DIR__ . '/../../publishable/assets' => public_path('vendor/webkul/customer/assets'),
|
||||
], 'public');
|
||||
|
||||
$router->aliasMiddleware('customer', RedirectIfNotCustomer::class);
|
||||
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/migrations');
|
||||
|
||||
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'customer');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
// $this->app->bind('datagrid', 'Webkul\Ui\DataGrid\DataGrid');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
$sign-up-text-color: #5e5e5e;
|
||||
$login-text: #3a3a3a;
|
||||
$background-color: #ffffff;
|
||||
$border-color: #ffe8e8e8;
|
||||
$forgot-password-color: #0031f0;
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
@import "mixins";
|
||||
@import "variables";
|
||||
|
||||
.content {
|
||||
padding-top: 15%;
|
||||
padding-bottom: 15%;
|
||||
|
||||
.sign-up-text {
|
||||
margin-bottom: 2%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
color: $sign-up-text-color;
|
||||
letter-spacing: -0.29px;
|
||||
text-align: center;
|
||||
}
|
||||
.login-form {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: flex;
|
||||
background: $background-color;
|
||||
border: 1px solid $border-color;
|
||||
flex-direction: column;
|
||||
max-width: 530px;
|
||||
min-width: 380px;
|
||||
min-height: 345px;
|
||||
padding-left: 25px;
|
||||
padding-right: 25px;
|
||||
|
||||
.login-text {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: $login-text;
|
||||
letter-spacing: -0.23px;
|
||||
margin-top: 5%;
|
||||
margin-bottom: 3%;
|
||||
}
|
||||
|
||||
.control-group {
|
||||
margin-bottom: 15px !important;
|
||||
.control {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.forgot-password-link {
|
||||
font-size: 17px;
|
||||
color: $forgot-password-color;
|
||||
letter-spacing: -0.11px;
|
||||
margin-bottom: 5%;
|
||||
}
|
||||
.signup-confirm {
|
||||
letter-spacing: -0.11px;
|
||||
margin-bottom: 5%;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
width: 100%;
|
||||
text-transform: uppercase;
|
||||
border-radius: 0px;
|
||||
height: 45px;
|
||||
margin-bottom: 4%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dashboard-content {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border: 1px solid red;
|
||||
margin-top: 5.5%;
|
||||
margin-bottom: 5.5%;
|
||||
|
||||
.dashboard-side-menu {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
border: 1px solid #e8e8e8;
|
||||
border-right: none;
|
||||
background: #ffffff;
|
||||
width: 25%;
|
||||
text-transform: capitalize;
|
||||
font-size: 16px;
|
||||
color: #5e5e5e;
|
||||
|
||||
li {
|
||||
font-size: 16px;
|
||||
width: 95%;
|
||||
height: 50px;
|
||||
margin-left: 15px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
border: 1px solid $border-color;
|
||||
border-left: none;
|
||||
border-bottom: none;
|
||||
text-align: center;
|
||||
}
|
||||
li:first-child {
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.profile {
|
||||
margin-left: 5.5%;
|
||||
|
||||
.section-heading {
|
||||
height: 50px;
|
||||
font-size: 28px;
|
||||
color: #242424;
|
||||
text-transform: capitalize;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.profile-content {
|
||||
font-size: 16px;
|
||||
color: #5e5e5e;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
@extends('customer::layouts.master')
|
||||
@section('content-wrapper')
|
||||
<div class="dashboard-content">
|
||||
<ul class="dashboard-side-menu">
|
||||
<li>Profile</li>
|
||||
<li>Orders</li>
|
||||
<li>Address</li>
|
||||
<li>Reviews</li>
|
||||
<li>Wishlist</li>
|
||||
</ul>
|
||||
<div class="profile">
|
||||
<div class="section-heading">
|
||||
Profile
|
||||
</div>
|
||||
<div class="profile-content">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>First Name</td>
|
||||
<td>Prashant</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last Name</td>
|
||||
<td>Singh</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gender Name</td>
|
||||
<td>Male</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Date of Birth</td>
|
||||
<td>1/1/1993</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email Address</td>
|
||||
<td>Prashant@webkul.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mobile</td>
|
||||
<td>+91-9988887744</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ config('app.locale') }}">
|
||||
<head>
|
||||
<title>@yield('page_title')</title>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/webkul/shop/assets/css/shop.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/webkul/ui/assets/css/ui.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/webkul/customer/assets/css/customer.css') }}">
|
||||
@yield('head')
|
||||
@yield('css')
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
@include('shop::layouts.header')
|
||||
<div class="main-container-wrapper">
|
||||
<div class="content-container">
|
||||
@yield('content-wrapper')
|
||||
</div>
|
||||
</div>
|
||||
@include('shop::layouts.footer')
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.flashMessages = [];
|
||||
@if($success = session('success'))
|
||||
window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }];
|
||||
@elseif($warning = session('warning'))
|
||||
window.flashMessages = [{'type': 'alert-warning', 'message': "{{ $warning }}" }];
|
||||
@elseif($error = session('error'))
|
||||
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }];
|
||||
@endif
|
||||
|
||||
window.serverErrors = [];
|
||||
@if (count($errors))
|
||||
window.serverErrors = @json($errors->getMessages());
|
||||
@endif
|
||||
</script>
|
||||
<script type="text/javascript" src="{{ asset('vendor/webkul/shop/assets/js/shop.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('vendor/webkul/ui/assets/js/ui.js') }}"></script>
|
||||
@yield('javascript')
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
@extends('customer::layouts.master')
|
||||
@section('content-wrapper')
|
||||
<div class="content">
|
||||
<div class="sign-up-text">
|
||||
Don't have account - <a href="{{ route('customer.register.index') }}">Sign Up</a>
|
||||
</div>
|
||||
<form method="POST" action="{{ route('customer.session.create') }}">
|
||||
{{ csrf_field() }}
|
||||
<div class="login-form">
|
||||
<div class="login-text">Sign In</div>
|
||||
<div class="control-group">
|
||||
<label for="email">E-Mail</label>
|
||||
<input type="text" class="control" name="email">
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" class="control" name="password">
|
||||
</div>
|
||||
<div class="forgot-password-link">
|
||||
<a href="">Forgot Password?</a>
|
||||
</div>
|
||||
|
||||
<input class="btn btn-primary btn-lg" type="submit" value="sign in">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
@extends('customer::layouts.master')
|
||||
@section('content-wrapper')
|
||||
<div class="content">
|
||||
<div class="sign-up-text">
|
||||
Already have an account - <a href="{{ route('customer.session.index') }}">Sign In</a>
|
||||
</div>
|
||||
<form method="post" action="{{ route('customer.register.create') }}">
|
||||
{{ csrf_field() }}
|
||||
<div class="login-form">
|
||||
<div class="login-text">Sign Up</div>
|
||||
<div class="control-group">
|
||||
<label for="email">First Name</label>
|
||||
<input type="text" class="control" name="first_name">
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="email">Last Name</label>
|
||||
<input type="text" class="control" name="last_name">
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="email">Email</label>
|
||||
<input type="email" class="control" name="email">
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="email">Password</label>
|
||||
<input type="password" class="control" name="password">
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="email">Confirm Password</label>
|
||||
<input type="password" class="control" name="confirm_password">
|
||||
</div>
|
||||
<div class="signup-confirm">
|
||||
<span class="checkbox">
|
||||
<input type="checkbox" id="checkbox2" name="agreement" required>
|
||||
<label class="checkbox-view" for="checkbox2"></label>
|
||||
<span>Agree <a href="">Terms</a> & <a href="">Conditions</a> by using this website.</span>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<input class="btn btn-primary btn-lg" type="submit" value="sign in">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitc5f0302124cc20345d62f1a255758559::getLoader();
|
||||
|
|
@ -0,0 +1,445 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see http://www.php-fig.org/psr/psr-0/
|
||||
* @see http://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
// PSR-4
|
||||
private $prefixLengthsPsr4 = array();
|
||||
private $prefixDirsPsr4 = array();
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
private $prefixesPsr0 = array();
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
private $useIncludePath = false;
|
||||
private $classMap = array();
|
||||
private $classMapAuthoritative = false;
|
||||
private $missingClasses = array();
|
||||
private $apcuPrefix;
|
||||
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if (false === $file && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath.'\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
if (file_exists($file = $dir . $pathEnd)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Webkul\\Customer\\' => array($baseDir . '/src'),
|
||||
);
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitc5f0302124cc20345d62f1a255758559
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitc5f0302124cc20345d62f1a255758559', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitc5f0302124cc20345d62f1a255758559', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitc5f0302124cc20345d62f1a255758559::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitc5f0302124cc20345d62f1a255758559
|
||||
{
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'W' =>
|
||||
array (
|
||||
'Webkul\\Customer\\' => 16,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'Webkul\\Customer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/src',
|
||||
),
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc5f0302124cc20345d62f1a255758559::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitc5f0302124cc20345d62f1a255758559::$prefixDirsPsr4;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
const { mix } = require("laravel-mix");
|
||||
require("laravel-mix-merge-manifest");
|
||||
|
||||
// var publicPath = 'publishable/assets';
|
||||
var publicPath = "../../../public/vendor/webkul/customer/assets";
|
||||
|
||||
mix.setPublicPath(publicPath).mergeManifest();
|
||||
mix.disableNotifications();
|
||||
|
||||
mix.sass(
|
||||
__dirname + "/src/Resources/assets/sass/app.scss",
|
||||
"css/customer.css"
|
||||
).options({
|
||||
processCssUrls: false
|
||||
});
|
||||
|
||||
if (mix.inProduction()) {
|
||||
mix.version();
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
/node_modules
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "webkul/laravel-shop",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Prashant",
|
||||
"email": "prashant@webkul.com"
|
||||
}
|
||||
],
|
||||
"require": {},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\Shop\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\Shop\\Providers\\ShopServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "npm run development",
|
||||
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"watch-poll": "cross-env npm run watch -- --watch-poll --progress",
|
||||
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"prod": "npm run production",
|
||||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^0.18",
|
||||
"cross-env": "^5.1.4",
|
||||
"laravel-mix": "^2.1",
|
||||
"laravel-mix-merge-manifest": "^0.1.1",
|
||||
"jquery": "^3.2",
|
||||
"vue": "^2.1.10"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Shop\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
/**
|
||||
* Admin user session controller
|
||||
*
|
||||
* @author Jitendra Singh <jitendra@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class HomeController extends controller
|
||||
{
|
||||
protected $_config;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_config = request('_config');
|
||||
|
||||
}
|
||||
public function index(){
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
Route::group(['middleware' => ['web']], function () {
|
||||
Route::get('/', 'Webkul\Shop\Http\Controllers\HomeController@index')->defaults('_config', [
|
||||
'view' => 'shop::home.index'
|
||||
]);
|
||||
});
|
||||
|
||||
Route::group(['middleware' => ['web']], function () {
|
||||
Route::get('/foo', 'Webkul\Shop\Http\Controllers\HomeController@index1');
|
||||
});
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Shop\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class ShopServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
include __DIR__ . '/../Http/routes.php';
|
||||
|
||||
$this->publishes([
|
||||
__DIR__ . '/../../publishable/assets' => public_path('vendor/webkul/shop/assets'),
|
||||
], 'public');
|
||||
|
||||
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'shop');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 851 KiB |
|
After Width: | Height: | Size: 278 KiB |
|
After Width: | Height: | Size: 320 KiB |
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="106px" height="16px" viewBox="0 0 106 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Star-5</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Star-5" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon id="Star" fill="#242424" points="8.41169779 13.2668737 3.21298265 16 4.2058489 10.2111456 2.29816166e-14 6.11145618 5.81234022 5.26687371 8.41169779 0 11.0110554 5.26687371 16.8233956 6.11145618 12.6175467 10.2111456 13.6104129 16"></polygon>
|
||||
<polygon id="Star" fill="#242424" points="31.4116978 13.2668737 26.2129827 16 27.2058489 10.2111456 23 6.11145618 28.8123402 5.26687371 31.4116978 0 34.0110554 5.26687371 39.8233956 6.11145618 35.6175467 10.2111456 36.6104129 16"></polygon>
|
||||
<polygon id="Star" fill="#242424" points="53.4116978 13.2668737 48.2129827 16 49.2058489 10.2111456 45 6.11145618 50.8123402 5.26687371 53.4116978 0 56.0110554 5.26687371 61.8233956 6.11145618 57.6175467 10.2111456 58.6104129 16"></polygon>
|
||||
<polygon id="Star" fill="#242424" points="75.4116978 13.2668737 70.2129827 16 71.2058489 10.2111456 67 6.11145618 72.8123402 5.26687371 75.4116978 0 78.0110554 5.26687371 83.8233956 6.11145618 79.6175467 10.2111456 80.6104129 16"></polygon>
|
||||
<polygon id="Star" fill="#242424" points="97.4116978 13.2668737 92.2129827 16 93.2058489 10.2111456 89 6.11145618 94.8123402 5.26687371 97.4116978 0 100.011055 5.26687371 105.823396 6.11145618 101.617547 10.2111456 102.610413 16"></polygon>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>arrow-down</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="arrow-down" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon id="Rectangle-2" fill="#A5A5A5" transform="translate(9.000000, 8.000000) rotate(-45.000000) translate(-9.000000, -8.000000) " points="6 5 12 11 6 11"></polygon>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 633 B |
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 202 KiB |
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>icon-menu</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="icon-menu" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
|
||||
<g id="Group-2" transform="translate(4.000000, 5.000000)" stroke="#242424" stroke-width="3">
|
||||
<g id="Group" transform="translate(0.000000, 6.000000)">
|
||||
<path d="M1,1.5 L15,1.5" id="Line-2"></path>
|
||||
</g>
|
||||
<g id="Group-Copy">
|
||||
<path d="M1,1.5 L15,1.5" id="Line-2"></path>
|
||||
</g>
|
||||
<g id="Group-Copy-2" transform="translate(0.000000, 12.000000)">
|
||||
<path d="M1,1.5 L15,1.5" id="Line-2"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1002 B |
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>icon-search</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="icon-search" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<circle id="Oval-2" stroke="#242424" stroke-width="3" cx="10.5" cy="10.5" r="7"></circle>
|
||||
<path d="M15.5,15.5 L21.5,21.5" id="Line" stroke="#242424" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 694 B |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>icon-offer</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="icon-offer" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon id="Star" fill="#FF6472" points="12 21.8341033 8.29179607 23.8299999 6.46471607 20.0352146 2.29179607 19.4698579 3.04372246 15.325663 0 12.415 3.04372246 9.50433697 2.29179607 5.360142 6.46471607 4.79478531 8.29179607 1 12 2.99589665 15.7082039 1 17.5352839 4.79478531 21.7082039 5.360142 20.9562775 9.50433697 24 12.415 20.9562775 15.325663 21.7082039 19.4698579 17.5352839 20.0352146 15.7082039 23.8299999"></polygon>
|
||||
<text id="%" font-family="Montserrat-Regular, Montserrat" font-size="12" font-weight="normal" letter-spacing="-0.2879999" fill="#FFFFFF">
|
||||
<tspan x="7.8559999" y="17">%</tspan>
|
||||
</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Wishlist</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Wishlist" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
|
||||
<path d="M15.9962711,26 C15.9962711,26 3.82641602,21.6804199 5.05062701,11.3846154 C5.38182072,8.59922485 8.45774362,6 11.3052808,6 C13.3974625,6 15.1753096,7.5626878 15.9962711,9.07692308 C16.9857769,7.57771184 18.5950798,6 20.6872614,6 C23.5347986,6 26.6121993,8.59909844 26.9419152,11.3846154 C28.2089844,22.0891113 15.9962711,26 15.9962711,26 Z" id="heart" stroke="#FF6472" stroke-width="3" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 905 B |
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Wishlist-Add</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Wishlist-Add" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
|
||||
<path d="M15.9962711,26 C15.9962711,26 3.82641602,21.6804199 5.05062701,11.3846154 C5.38182072,8.59922485 8.45774362,6 11.3052808,6 C13.3974625,6 15.1753096,7.5626878 15.9962711,9.07692308 C16.9857769,7.57771184 18.5950798,6 20.6872614,6 C23.5347986,6 26.6121993,8.59909844 26.9419152,11.3846154 C28.2089844,22.0891113 15.9962711,26 15.9962711,26 Z" id="heart" stroke="#FF6472" stroke-width="3" fill="#FF6472" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 928 B |
|
|
@ -0,0 +1,92 @@
|
|||
window.jQuery = window.$ = $ = require("jquery");
|
||||
window.Vue = require("vue");
|
||||
// window.VeeValidate = require('vee-validate');
|
||||
|
||||
// Vue.use(VeeValidate);
|
||||
|
||||
//pure JS for resizing of browser purposes only
|
||||
|
||||
$(window).resize(function() {
|
||||
var w = $(document).width();
|
||||
var window = {};
|
||||
window.width = $(document).width();
|
||||
window.height = $(document).height();
|
||||
if (window.width < 785) {
|
||||
$(".header").css("margin-bottom", "0");
|
||||
$(".header-top").css("margin-bottom", "0");
|
||||
$("ul.search-container").css("display", "none");
|
||||
$(".header-bottom").css("display", "none");
|
||||
$("div.right-content").css("display", "none");
|
||||
$(".right-responsive").css("display", "inherit");
|
||||
} else if (window.width > 785) {
|
||||
$(".header").css("margin-bottom", "21px");
|
||||
$(".header-top").css("margin-bottom", "16px");
|
||||
$("ul.search-container").css("display", "inherit");
|
||||
$(".header-bottom").css("display", "block");
|
||||
$("div.right-content").css("display", "inherit");
|
||||
$(".right-responsive").css("display", "none");
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
/* Responsiveness script goes here */
|
||||
var w = $(document).width();
|
||||
var window = {};
|
||||
window.width = $(document).width();
|
||||
window.height = $(document).height();
|
||||
if (window.width < 785) {
|
||||
$(".header").css("margin-bottom", "0");
|
||||
$(".header-top").css("margin-bottom", "0");
|
||||
$("ul.search-container").css("display", "none");
|
||||
$(".header-bottom").css("display", "none");
|
||||
$("div.right-content").css("display", "none");
|
||||
$(".right-responsive").css("display", "inherit");
|
||||
}
|
||||
/* Responsiveness script ends here */
|
||||
|
||||
const app = new Vue({
|
||||
el: "#app",
|
||||
|
||||
mounted: function() {
|
||||
this.addServerErrors();
|
||||
this.addFlashMessages();
|
||||
},
|
||||
|
||||
methods: {
|
||||
onSubmit: function(e) {
|
||||
this.$validator.validateAll().then(result => {
|
||||
if (result) {
|
||||
e.target.submit();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
addServerErrors: function() {
|
||||
var scope = null;
|
||||
for (var key in serverErrors) {
|
||||
const field = this.$validator.fields.find({
|
||||
name: key,
|
||||
scope: scope
|
||||
});
|
||||
if (field) {
|
||||
this.$validator.errors.add({
|
||||
id: field.id,
|
||||
field: key,
|
||||
msg: serverErrors[key][0],
|
||||
scope: scope
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
addFlashMessages: function() {
|
||||
const flashes = this.$refs.flashes;
|
||||
|
||||
flashMessages.forEach(function(flash) {
|
||||
flashes.addFlash(flash);
|
||||
}, this);
|
||||
},
|
||||
responsiveHeader: function() {}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
$font-name: "Montserrat", sans-serif;
|
||||
$background-color: #f2f2f2;
|
||||
$list-heading-color: rgba(165, 165, 165, 1);
|
||||
$list-color: #242424;
|
||||
$subscribe-btn-color: black;
|
||||
$logo-color: #0031f0;
|
||||
$border-color: #c7c7c7;
|
||||
$offer-color: #ff6472;
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
@extends('shop::layouts.master')
|
||||
@section('slider')
|
||||
@include('shop::layouts.slider')
|
||||
@endsection
|
||||
@section('content-wrapper')
|
||||
@include('shop::layouts.featuredproductgrid')
|
||||
@include('shop::layouts.newproductgrid')
|
||||
@include('shop::layouts.newsupdategrid')
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/grid.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-lg btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<section class="featured-products">
|
||||
<div class="featured-heading">
|
||||
Featured Products<br/>
|
||||
<span class="featured-seperator" style="color:lightgrey;">_____</span>
|
||||
</div>
|
||||
|
||||
<div class="featured-grid">
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/grid.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/gogs.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/grid.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/gogs.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-md btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Foo</title>
|
||||
<style>
|
||||
.container {
|
||||
box-sizing: border-box;
|
||||
max-width: 50%;
|
||||
border: 1px solid green;
|
||||
height: 95vh;
|
||||
}
|
||||
|
||||
.last-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(47.5%, 1fr));
|
||||
grid-gap: 5%;
|
||||
}
|
||||
|
||||
.block1 {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
background: pink;
|
||||
height: 95vh;
|
||||
}
|
||||
|
||||
.block2 {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
/* background: red; */
|
||||
height: 95vh;
|
||||
display: grid;
|
||||
grid-template-rows: 47.5% 47.5%;
|
||||
grid-row-gap: 5%;
|
||||
}
|
||||
|
||||
.sub-block1 {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
background: green;
|
||||
}
|
||||
|
||||
.sub-block2 {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
background: paleturquoise;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="last-grid">
|
||||
<div class="block1"></div>
|
||||
<div class="block2">
|
||||
<div class="sub-block1"></div>
|
||||
<div class="sub-block2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<div class="footer">
|
||||
<div class="footer-content">
|
||||
<div class="footer-list-container">
|
||||
<div class="list-container">
|
||||
<span class="list-heading">Categories</span>
|
||||
<ul class="list-group">
|
||||
<li>MEN</li>
|
||||
<li>Women</li>
|
||||
<li>Kids</li>
|
||||
<li>Accessories</li>
|
||||
<li>Home & Living</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-container">
|
||||
<span class="list-heading">Quick Links</span>
|
||||
<ul class="list-group">
|
||||
<li>About Us</li>
|
||||
<li>Return Policy</li>
|
||||
<li>Refund Policy</li>
|
||||
<li>Terms and conditions</li>
|
||||
<li>Terms of Use</li>
|
||||
<li>Contact Us</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-container">
|
||||
<span class="list-heading">Connect With Us</span>
|
||||
<ul class="list-group">
|
||||
<li><span class="icon-wrapper"><span class="icon icon-dashboard"></span></span>Facebook</li>
|
||||
<li><span class="icon-wrapper"><span class="icon icon-dashboard"></span></span>Twitter</li>
|
||||
<li><span class="icon-wrapper"><span class="icon icon-dashboard"></span></span>Instagram</li>
|
||||
<li><span class="icon-wrapper"><span class="icon icon-dashboard"></span></span>Google+</li>
|
||||
<li><span class="icon-wrapper"><span class="icon icon-dashboard"></span></span>LinkedIn</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-container">
|
||||
<span class="list-heading">Subscribe Newsletter</span>
|
||||
<div class="form-container">
|
||||
<div class="control-group">
|
||||
<input type="text" class="control subscribe-field" placeholder="Email Address"><br/>
|
||||
<button class="btn btn-md btn-primary">Subscribe</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
<div class="header">
|
||||
<div class="header-top">
|
||||
<div class="left-content">
|
||||
<ul class="logo-container">
|
||||
<li>
|
||||
<img class="logo" src="vendor/webkul/shop/assets/images/logo.svg" />
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="search-container">
|
||||
<li class="search-group">
|
||||
<input type="search" class="search-field" placeholder="Search for products">
|
||||
<div class="q-c">
|
||||
<span class="icon search-icon"></span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="right-content">
|
||||
<ul class="search-dropdown-container">
|
||||
<li class="search-dropdown">
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="account-dropdown-container">
|
||||
<li class="account-dropdown">
|
||||
<span class="icon account-icon"></span>
|
||||
<span class="account">Account</span>
|
||||
<span class="icon arrow-down-icon"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="product-dropdown-container">
|
||||
<li class="product-dropdown">
|
||||
<span class="icon cart-icon"></span>
|
||||
<span class="cart"><span class="cart-count">5</span>Products</span>
|
||||
<span class="icon arrow-down-icon"></span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="ham-dropdown-container">
|
||||
<li class="ham-dropdown">
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="right-responsive">
|
||||
<ul class="right-wrapper">
|
||||
<li class="search-box"><span class="icon search-icon"></span></li>
|
||||
<li class="account-box"><span class="icon icon-account"></span></li>
|
||||
<li class="cart-box"><span class="icon icon-cart"></span></li>
|
||||
<li class="menu-box"><span class="icon sortable-icon"></span></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-bottom">
|
||||
<ul class="menu-bar">
|
||||
<li>Men</li>
|
||||
<li>Women</li>
|
||||
<li>Kids</li>
|
||||
<li>Accessories</li>
|
||||
<li>Home & Living</li>
|
||||
<li>
|
||||
<img class="icon" src="vendor/webkul/shop/assets/images/offer-zone.svg" style="margin-right:5px;" />Offer
|
||||
Zone
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ config('app.locale') }}">
|
||||
|
||||
<head>
|
||||
<title>@yield('page_title')</title>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/webkul/shop/assets/css/shop.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/webkul/ui/assets/css/ui.css') }}">
|
||||
@yield('head')
|
||||
@yield('css')
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
@include('shop::layouts.header') @yield('slider')
|
||||
<div class="main-container-wrapper">
|
||||
<div class="content-container">
|
||||
@yield('content-wrapper')
|
||||
</div>
|
||||
</div>
|
||||
@include('shop::layouts.footer')
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.flashMessages = [];
|
||||
@if($success = session('success'))
|
||||
window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }];
|
||||
@elseif($warning = session('warning'))
|
||||
window.flashMessages = [{'type': 'alert-warning', 'message': "{{ $warning }}" }];
|
||||
@elseif($error = session('error'))
|
||||
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }];
|
||||
@endif
|
||||
|
||||
window.serverErrors = [];
|
||||
@if (count($errors))
|
||||
window.serverErrors = @json($errors->getMessages());
|
||||
@endif
|
||||
</script>
|
||||
<script type="text/javascript" src="{{ asset('vendor/webkul/shop/assets/js/shop.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('vendor/webkul/ui/assets/js/ui.js') }}"></script>
|
||||
@yield('javascript')
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<section class="featured-products">
|
||||
<div class="featured-heading">
|
||||
New Products<br/>
|
||||
<span class="featured-seperator" style="color:lightgrey;">_____</span>
|
||||
</div>
|
||||
|
||||
<div class="featured-grid">
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/new.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-lg btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/new.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-lg btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/new.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-lg btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card">
|
||||
<div class="product-image">
|
||||
<img src="vendor/webkul/shop/assets/images/new.png" />
|
||||
</div>
|
||||
<div class="product-name">
|
||||
<span>Red Black Tees</span>
|
||||
</div>
|
||||
<div class="product-price">
|
||||
<span>$65.00</span>
|
||||
</div>
|
||||
<div class="product-ratings">
|
||||
<span>
|
||||
<img src="vendor/webkul/shop/assets/images/5star.svg" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="cart-fav-seg">
|
||||
<button class="btn btn-lg btn-primary addtocart">Add to Cart</button>
|
||||
<span><img src="vendor/webkul/shop/assets/images/wishadd.svg" /></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<section class="news-update">
|
||||
<div class="news-update-grid">
|
||||
<div class="block1">
|
||||
<img src="vendor/webkul/shop/assets/images/1.png" />
|
||||
</div>
|
||||
<div class="block2">
|
||||
<div class="sub-block1">
|
||||
<img src="vendor/webkul/shop/assets/images/2.png" />
|
||||
</div>
|
||||
<div class="sub-block2">
|
||||
<img src="vendor/webkul/shop/assets/images/3.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<section class="slider-block">
|
||||
<div class="slider-content">
|
||||
<ul class="slider-images">
|
||||
<li>
|
||||
<img class="slider-item" src="vendor/webkul/shop/assets/images/banner.png" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
const { mix } = require("laravel-mix");
|
||||
require("laravel-mix-merge-manifest");
|
||||
|
||||
// var publicPath = 'publishable/assets';
|
||||
var publicPath = "../../../public/vendor/webkul/shop/assets";
|
||||
|
||||
mix.setPublicPath(publicPath).mergeManifest();
|
||||
mix.disableNotifications();
|
||||
|
||||
mix.js([__dirname + "/src/Resources/assets/js/app.js"], "js/shop.js")
|
||||
// .copyDirectory(
|
||||
// __dirname + "/src/Resources/assets/images",
|
||||
// publicPath + "/images"
|
||||
// )
|
||||
.sass(__dirname + "/src/Resources/assets/sass/app.scss", "css/shop.css")
|
||||
.options({
|
||||
processCssUrls: false
|
||||
});
|
||||
|
||||
if (mix.inProduction()) {
|
||||
mix.version();
|
||||
}
|
||||
|
|
@ -1,26 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Ui\DataGrid;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Validate;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
use Webkul\Ui\DataGrid\Helpers\Column;
|
||||
use Webkul\Ui\DataGrid\Helpers\Pagination;
|
||||
use Webkul\Ui\DataGrid\Helpers\Css;
|
||||
use Webkul\Ui\DataGrid\Helpers\MassAction;
|
||||
|
||||
class DataGrid
|
||||
{
|
||||
{
|
||||
/**
|
||||
* Name of DataGrid
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* select from table(s)
|
||||
*
|
||||
|
|
@ -28,18 +26,24 @@ class DataGrid
|
|||
*/
|
||||
protected $select;
|
||||
|
||||
/**
|
||||
* Table
|
||||
* @var Boolean for aliasing
|
||||
*/
|
||||
protected $aliased;
|
||||
|
||||
/**
|
||||
* Table
|
||||
*
|
||||
* @var String Classs name $table
|
||||
*/
|
||||
protected $table;
|
||||
|
||||
protected $table;
|
||||
/**
|
||||
* Join
|
||||
*
|
||||
* @var Array name $join
|
||||
*
|
||||
*
|
||||
* [
|
||||
* 'join' => 'left',
|
||||
* 'table' => 'posts',
|
||||
|
|
@ -50,7 +54,6 @@ class DataGrid
|
|||
* ]
|
||||
*/
|
||||
protected $join;
|
||||
|
||||
/**
|
||||
* Collection Object of Column $columns
|
||||
*
|
||||
|
|
@ -58,20 +61,46 @@ class DataGrid
|
|||
*/
|
||||
protected $columns;
|
||||
|
||||
/**
|
||||
* array of columns
|
||||
* to be filtered
|
||||
* @var Array
|
||||
*/
|
||||
protected $filterable;
|
||||
|
||||
/**
|
||||
* array of columns
|
||||
* to be searched
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
protected $searchable;
|
||||
|
||||
/**
|
||||
* mass operations
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
protected $massoperations;
|
||||
|
||||
/**
|
||||
* Pagination $pagination
|
||||
*
|
||||
* @var Pagination
|
||||
*/
|
||||
protected $pagination;
|
||||
|
||||
/**
|
||||
* Css $css
|
||||
*
|
||||
* @var Css
|
||||
*/
|
||||
protected $css;
|
||||
|
||||
|
||||
/**
|
||||
* URL parse $parsed
|
||||
* @var parse
|
||||
*/
|
||||
protected $parsed;
|
||||
/*
|
||||
public function __construct(
|
||||
$name = null ,
|
||||
|
|
@ -87,38 +116,52 @@ class DataGrid
|
|||
$columns,
|
||||
$pagination
|
||||
);
|
||||
|
||||
return $this;
|
||||
|
||||
Separates the bags in the array of make attributes
|
||||
}
|
||||
*/
|
||||
public function make($args){
|
||||
|
||||
public function make($args)
|
||||
{
|
||||
// list($name, $select, $table, $join, $columns) = array_values($args);
|
||||
$name = $select = $table = false;
|
||||
$join = $columns = $css = [];
|
||||
$name = $select = $aliased = $table = false;
|
||||
$join = $columns = $filterable = $searchable =
|
||||
$massoperations = $css = $operators = [];
|
||||
extract($args);
|
||||
return $this->build($name, $select, $table, $join, $columns, $css);
|
||||
return $this->build($name, $select, $filterable, $searchable, $massoperations, $aliased, $table, $join, $columns, $css, $operators);
|
||||
}
|
||||
|
||||
//starts buikding the queries on the basis of selects, joins and filter with
|
||||
//attributes for class names and styles.
|
||||
|
||||
public function build(
|
||||
$name = null,
|
||||
$select = false,
|
||||
$select = false,
|
||||
array $filterable = [],
|
||||
array $searchable = [],
|
||||
array $massoperations = [],
|
||||
bool $aliased = false,
|
||||
$table = null,
|
||||
array $join = [],
|
||||
array $columns = null,
|
||||
array $css = [],
|
||||
array $operators = [],
|
||||
Pagination $pagination = null
|
||||
){
|
||||
) {
|
||||
$this->request = Request::capture();
|
||||
|
||||
$this->setName($name);
|
||||
$this->setSelect($select);
|
||||
$this->setFilterable($filterable);
|
||||
$this->setSearchable($filterable);
|
||||
$this->setMassOperations($massoperations);
|
||||
$this->setAlias($aliased);
|
||||
$this->setTable($table);
|
||||
$this->setJoin($join);
|
||||
|
||||
$this->addColumns($columns, true);
|
||||
$this->setCss($css);
|
||||
$this->setOperators($operators);
|
||||
// $this->addPagination($pagination);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
@ -127,6 +170,7 @@ class DataGrid
|
|||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function setName(string $name)
|
||||
{
|
||||
$this->name = $name ?: 'Default' . time();
|
||||
|
|
@ -138,6 +182,7 @@ class DataGrid
|
|||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function setSelect($select)
|
||||
{
|
||||
$this->select = $select ?: false;
|
||||
|
|
@ -145,10 +190,58 @@ class DataGrid
|
|||
}
|
||||
|
||||
/**
|
||||
* Add Columns.
|
||||
* Set Filterable
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function setFilterable(array $filterable)
|
||||
{
|
||||
$this->filterable = $filterable ?: [];
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Searchable columns
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function setSearchable($searchable)
|
||||
{
|
||||
$this->searchable = $searchable ?: [];
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mass operations
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function setMassOperations($massops)
|
||||
{
|
||||
$this->massoperations = $massops ?: [];
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set alias parameter
|
||||
* to know whether
|
||||
* aliasing is true or not.
|
||||
*
|
||||
* @return $this.
|
||||
*/
|
||||
|
||||
public function setAlias(bool $aliased)
|
||||
{
|
||||
$this->aliased = $aliased ? : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set table name in front
|
||||
* of query scope.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function setTable(string $table)
|
||||
{
|
||||
$this->table = $table ?: false;
|
||||
|
|
@ -156,33 +249,53 @@ class DataGrid
|
|||
}
|
||||
|
||||
/**
|
||||
* Add Columns.
|
||||
* Set join bag if
|
||||
* present.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function setJoin(array $join)
|
||||
{
|
||||
$this->join = $join ?: [];
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the custom css rules
|
||||
* @retun $this
|
||||
*/
|
||||
|
||||
private function setCss($css = [])
|
||||
{
|
||||
$this->css = new Css($css);
|
||||
return $this->css;
|
||||
}
|
||||
|
||||
/**
|
||||
* setFilterableColumns
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
// public function setFilterableColumns($filterable_columns = [])
|
||||
// {
|
||||
// $this->join = $filterable_columns ?: [];
|
||||
// return $this;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Add Columns.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function addColumns($columns = [], $reCreate = false)
|
||||
{
|
||||
if($reCreate) $this->columns = new Collection();
|
||||
|
||||
if($columns){
|
||||
foreach($columns as $column){
|
||||
if ($reCreate) {
|
||||
$this->columns = new Collection();
|
||||
}
|
||||
if ($columns) {
|
||||
foreach ($columns as $column) {
|
||||
$this->addColumn($column);
|
||||
}
|
||||
}
|
||||
|
|
@ -194,49 +307,63 @@ class DataGrid
|
|||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function addColumn($column = [])
|
||||
{
|
||||
if($column instanceof Column){
|
||||
if ($column instanceof Column) {
|
||||
$this->columns->push($column);
|
||||
}elseif(gettype($column) == 'array' && $column){
|
||||
} elseif (gettype($column) == 'array' && $column) {
|
||||
$this->columns->push(new Column($column, $this->request));
|
||||
}else{
|
||||
} else {
|
||||
throw new \Exception("DataGrid: Add Column argument is not valid!");
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add ColumnMultiple.
|
||||
*
|
||||
* Currently is not
|
||||
* of any use.
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
private function addColumnMultiple($column = [], $multiple = false)
|
||||
{
|
||||
if($column instanceof Column){
|
||||
if($multiple){
|
||||
if($this->columns->offsetExists($column->getName()))
|
||||
if ($column instanceof Column) {
|
||||
if ($multiple) {
|
||||
if ($this->columns->offsetExists($column->getName())) {
|
||||
$this->columns->offsetSet($column->getName(). time(), $column);
|
||||
else
|
||||
} else {
|
||||
$this->columns->offsetSet($column->getName(), $column);
|
||||
}else{
|
||||
}
|
||||
} else {
|
||||
$this->columns->offsetSet($column->getName(), $column);
|
||||
}
|
||||
}elseif(gettype($column) == 'array' && $column){
|
||||
} elseif (gettype($column) == 'array' && $column) {
|
||||
$columnObj = new Column($column);
|
||||
if($multiple){
|
||||
if($this->columns->offsetExists($columnObj->getName()))
|
||||
if ($multiple) {
|
||||
if ($this->columns->offsetExists($columnObj->getName())) {
|
||||
$this->columns->offsetSet($columnObj->getName(). time(), $columnObj);
|
||||
else
|
||||
} else {
|
||||
$this->columns->offsetSet($columnObj->getName(), $columnObj);
|
||||
}else{
|
||||
}
|
||||
} else {
|
||||
$this->columns->offsetSet($columnObj->getName(), $columnObj);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
throw new \Exception("DataGrid: Add Column argument is not valid!");
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds expressional verbs to be used
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function setOperators(array $operators)
|
||||
{
|
||||
$this->operators = $operators ?: [];
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
@ -245,125 +372,406 @@ class DataGrid
|
|||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function addPagination($pagination = [])
|
||||
{
|
||||
if($pagination instanceof Pagination){
|
||||
if ($pagination instanceof Pagination) {
|
||||
$this->pagination = $pagination;
|
||||
}elseif(gettype($pagination) == 'array' && $pagination){
|
||||
} elseif (gettype($pagination) == 'array' && $pagination) {
|
||||
$this->pagination = new Pagination($pagination);
|
||||
}else{
|
||||
} else {
|
||||
throw new \Exception("DataGrid: Pagination argument is not valid!");
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the URL
|
||||
* and get it ready
|
||||
* to be used.
|
||||
*/
|
||||
|
||||
// private function parse()
|
||||
// {
|
||||
// //parse the url here
|
||||
// if (isset($_SERVER['QUERY_STRING'])) {
|
||||
// $qr = $_SERVER['QUERY_STRING'];
|
||||
// parse_str($qr, $parsed);
|
||||
// foreach ($parsed as $k=>$v) {
|
||||
// parse_str($v, $parsed[$k]);
|
||||
// }
|
||||
// return $parsed;
|
||||
// } else {
|
||||
// return $parsed = [];
|
||||
// }
|
||||
// }
|
||||
|
||||
private function parse()
|
||||
{
|
||||
$parsed = [];
|
||||
$unparsed = $_SERVER['QUERY_STRING'];
|
||||
if (isset($unparsed)) {
|
||||
parse_str($unparsed, $parsed);
|
||||
return $parsed;
|
||||
} else {
|
||||
return $parsed;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for selecting
|
||||
* the columns got in
|
||||
* make from controller.
|
||||
* @return $this
|
||||
*/
|
||||
private function getSelect()
|
||||
{
|
||||
$select = [];
|
||||
foreach($this->columns as $column){
|
||||
foreach ($this->columns as $column) {
|
||||
$select[] = $column->name;
|
||||
}
|
||||
|
||||
$this->query->select(...$select);
|
||||
if($this->select) $this->query->addselect($this->select);
|
||||
if ($this->select) {
|
||||
$this->query->addselect($this->select);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ->join('contacts', 'users.id', '=', 'contacts.user_id')
|
||||
* @return $this->query
|
||||
*/
|
||||
|
||||
private function getQueryWithJoin()
|
||||
{
|
||||
foreach($this->join as $join){
|
||||
$this->query->{$join['join']}($join['table'], $join['primaryKey'], $join['condition'], $join['secondryKey']);
|
||||
foreach ($this->join as $join) {
|
||||
$this->query->{$join['join']}($join['table'], $join['primaryKey'], $join['condition'], $join['secondaryKey']);
|
||||
}
|
||||
}
|
||||
|
||||
private function getQueryWithColumnFilters()
|
||||
{
|
||||
foreach($this->columns as $column){
|
||||
if($column->filter){
|
||||
if (count($column->filter['condition']) == count($column->filter['condition'], COUNT_RECURSIVE)){
|
||||
$this->query->{$column->filter['function']}(current($column->filter['condition']));
|
||||
}else{
|
||||
if(count($column->filter['condition']) == 3)
|
||||
foreach ($this->columns as $column) {
|
||||
if ($column->filter) { // if the filter bag in array exists then these will be applied.
|
||||
if (count($column->filter['condition']) == count($column->filter['condition'], COUNT_RECURSIVE)) {
|
||||
$this->query->{$column->filter['function']}(...$column->filter['condition']);
|
||||
} else {
|
||||
if (count($column->filter['condition']) == 3) {
|
||||
$this->query->{$column->filter['function']}(
|
||||
extract(
|
||||
array_combine(
|
||||
// ['key', 'condition', 'value'],
|
||||
// ['key', 'condition', 'value'],
|
||||
array_fill( //will work with all kind of where conditions
|
||||
0,
|
||||
( count( $column->filter['condition']) - 1 ),
|
||||
0,
|
||||
(count($column->filter['condition']) - 1),
|
||||
'array_fill_nikhil'.time()
|
||||
),
|
||||
$column->filter['condition']
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function getQueryWithFilters(){
|
||||
foreach($this->columns as $column){
|
||||
dd($this->request);
|
||||
if($column->filterable){
|
||||
if ($filter = $this->request->offsetGet($column->correct(false))){
|
||||
if($condition = $this->request->offsetGet($column->correct(false).'.condition')){
|
||||
$this->query->andwhere(
|
||||
$this->correct(false),
|
||||
$condition,
|
||||
$filter
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$query = ['sort' => $this->correct(false)];
|
||||
/**
|
||||
* Used to get the filter
|
||||
* params from the Url
|
||||
* and processed manually
|
||||
*/
|
||||
|
||||
if(($sort = $this->request->offsetGet('sort')) && $sort == $this->correct(false)){
|
||||
if(!$order = $this->request->offsetGet('order')){
|
||||
$query['order'] = self::ORDER_DESC;
|
||||
}else{
|
||||
$query['order'] = ($order == self::ORDER_DESC ? self::ORDER_ASC : self::ORDER_DESC);
|
||||
// private function getQueryWithFilters()
|
||||
// {
|
||||
// // the only use case remaining is making and testing the full validation and testing of
|
||||
// // aliased case with alias used in column names also.
|
||||
// if ($this->aliased) {
|
||||
// //n of joins can lead to n number of aliases for columns and neglect the as for columns
|
||||
// $parsed = $this->parse();
|
||||
// // dump($parsed);
|
||||
// foreach ($parsed as $key => $value) {
|
||||
// foreach ($value as $column => $filter) {
|
||||
// if (array_keys($filter)[0]=="like") {
|
||||
// $this->query->where(
|
||||
// str_replace('_', '.', $column), //replace the logic of making the column name and consider the case for _ in column name already
|
||||
// $this->operators[array_keys($filter)[0]],
|
||||
// '%'.array_values($filter)[0].'%'
|
||||
// );
|
||||
// } elseif (array_keys($filter)[0]=="sort") {
|
||||
// $this->query->orderBy(
|
||||
// str_replace('_', '.', $column), //replace the logic of making the column name and consider the case for _
|
||||
// array_values($filter)[0]
|
||||
// );
|
||||
// } elseif ($column == "search") {
|
||||
// $this->query->where(function ($query) use ($filter) {
|
||||
// foreach ($this->searchable as $search) {
|
||||
// $query->orWhere($search['column'], 'like', '%'.array_values($filter)[0].'%');
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// $this->query->where(
|
||||
// str_replace('_', '.', $column),
|
||||
// $this->operators[array_keys($filter)[0]],
|
||||
// array_values($filter)[0]
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// $parsed = $this->parse();
|
||||
// foreach ($parsed as $key => $value) {
|
||||
// foreach ($value as $column => $filter) {
|
||||
// if (array_keys($filter)[0]=="like") {
|
||||
// $this->query->where(
|
||||
// $column,
|
||||
// $this->operators[array_keys($filter)[0]],
|
||||
// '%'.array_values($filter)[0].'%'
|
||||
// );
|
||||
// } elseif ($column == "search") {
|
||||
// $this->query->where(function ($query) use ($filter) {
|
||||
// foreach ($this->searchable as $search) {
|
||||
// $query->orWhere($search['column'], 'like', '%'.array_values($filter)[0].'%');
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// $this->query->where(
|
||||
// $column,
|
||||
// $this->operators[array_keys($filter)[0]],
|
||||
// array_values($filter)[0]
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
private function getQueryWithFilters()
|
||||
{
|
||||
$parsed = $this->parse();
|
||||
|
||||
if ($this->aliased) {
|
||||
foreach ($parsed as $key=>$value) {
|
||||
if ($key=="sort") {
|
||||
|
||||
//resolve the case with the column helper class
|
||||
if (strpos($key, ' as ') !== false) {
|
||||
dd('This column cannot be sorted');
|
||||
} else {
|
||||
$column_name = str_replace('_', '.', $key);
|
||||
}
|
||||
|
||||
//case that don't need any resolving
|
||||
$count_keys = count(array_keys($value));
|
||||
if ($count_keys==1) {
|
||||
$this->query->orderBy(
|
||||
str_replace('_', '.', array_keys($value)[0]),
|
||||
array_values($value)[0]
|
||||
);
|
||||
} else {
|
||||
dump('Sort on two columns cannot exist in backend');
|
||||
}
|
||||
} elseif ($key=="search") {
|
||||
if (strpos($key, ' as ') !== false) {
|
||||
dd('This column cannot be searched');
|
||||
} else {
|
||||
$column_name = str_replace('_', '.', $key);
|
||||
}
|
||||
$this->query->where(function ($query) use ($parsed) {
|
||||
foreach ($this->searchable as $search) {
|
||||
$query->orWhere($search['column'], 'like', '%'.$parsed['search']['all'].'%');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (strpos($key, ' as ') !== false) {
|
||||
dd('This column cannot be filtered');
|
||||
} else {
|
||||
$column_name = str_replace('_', '.', $key);
|
||||
}
|
||||
|
||||
if (array_keys($value)[0]=="like" || array_keys($value)[0]=="nlike") {
|
||||
foreach ($value as $condition => $filter_value) {
|
||||
$this->query->where(
|
||||
$column_name,
|
||||
$this->operators[$condition],
|
||||
'%'.$filter_value.'%'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
foreach ($value as $condition => $filter_value) {
|
||||
$this->query->where(
|
||||
$column_name,
|
||||
$this->operators[$condition],
|
||||
$filter_value
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$query['order'] = self::ORDER_DESC;
|
||||
} else {
|
||||
dd('left to be run plainly');
|
||||
}
|
||||
|
||||
return '?'.http_build_query(array_merge($this->request->query->all(), $query));
|
||||
}
|
||||
|
||||
private function getDbQueryResults()
|
||||
{
|
||||
$this->query = DB::table($this->table);
|
||||
$parsed = $this->parse();
|
||||
|
||||
$this->getSelect();
|
||||
$this->getQueryWithJoin();
|
||||
$this->getQueryWithColumnFilters();
|
||||
$this->getQueryWithFilters();
|
||||
if ($this->aliased==true) {
|
||||
//flags
|
||||
$table_alias = false;
|
||||
$join_table_alias = false;
|
||||
$allowed_joins = false;
|
||||
$other_joins = false;
|
||||
$join_good = false;
|
||||
|
||||
dd($this->query);
|
||||
//prepare query object
|
||||
$this->query = DB::table($this->table);
|
||||
|
||||
$this->results = $this->query->get();
|
||||
return $this->results;
|
||||
//explode if alias is available
|
||||
if (strpos('.', $this->table)) {
|
||||
throw new \Exception("dot/s cannot be used in table names in mysql");
|
||||
} else {
|
||||
$exploded = explode('as', $this->table);
|
||||
}
|
||||
|
||||
//check whether exploded string still has same table name
|
||||
if ($exploded[0]==$this->table) {
|
||||
$table_alias = false;
|
||||
} else { // (isset($exploded))
|
||||
$table_alias = true;
|
||||
$table_name = trim($exploded[0]);
|
||||
$table_alias = trim($exploded[1]);
|
||||
}
|
||||
//Run this if there are any selects priorly.
|
||||
if (!empty($this->select)) {
|
||||
$this->getSelect();
|
||||
}
|
||||
|
||||
//Run this if there are joins
|
||||
if (!empty($this->join)) {
|
||||
foreach ($this->join as $join) {
|
||||
$name = strtolower($join['join']);
|
||||
//Allow joins i.e left or right
|
||||
if ($name=='leftjoin' || $name=='left join' || $name=='rightjoin' || $name=='right join') {
|
||||
|
||||
//check if the aliasing on the primary table and primaryKey in join is also the same
|
||||
$primary_key_alias = trim(explode('.', $join['primaryKey'])[0]);
|
||||
|
||||
if ($primary_key_alias == $table_alias) {
|
||||
$join_table_alias = explode('as', $join['table']);
|
||||
|
||||
if (isset($join_table_alias)) {
|
||||
$alias1 = trim($join_table_alias[1]); //important!!!!!
|
||||
|
||||
//check if the secondary table match column is not having '.' and has proper alias
|
||||
$secondary_join_column = $join['secondaryKey'];
|
||||
if (isset($secondary_join_column)) {
|
||||
$exploded_secondary = explode('.', $secondary_join_column);
|
||||
$alias2 = trim($exploded_secondary[0]);
|
||||
if ($alias1 == $alias2) {
|
||||
|
||||
//check whether secondary table columns are properly aliased
|
||||
$alias_proper_secondary = true;
|
||||
foreach ($this->columns as $column) {
|
||||
if ($x = explode('.', $column->name)[0]) {
|
||||
if (isset($x) && $x == $alias1) {
|
||||
//check if this secondary column is using independent column alias
|
||||
if (!strpos($column->name, 'as')) {
|
||||
$alias_proper_secondary = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($alias_proper_secondary) {
|
||||
$this->getQueryWithJoin();
|
||||
} else {
|
||||
throw new \Exception('Due to a bug in laravel, you can\'t use secondary table columns without aliasing');
|
||||
}
|
||||
} else {
|
||||
throw new \Exception('Aliases of Join table and the secondary key columns do not match');
|
||||
}
|
||||
} else {
|
||||
throw new \Exception('Improper aliasing on secondary/join column for join');
|
||||
}
|
||||
} else {
|
||||
throw new \Exception('Join/Secondary table alias is not found for join');
|
||||
}
|
||||
} else {
|
||||
throw new \Exception('Primary key and primary table aliases do not match for join');
|
||||
}
|
||||
} else {
|
||||
$other_joins = true;
|
||||
throw new \Exception('Please check if there is some fault in your aliasing and do not use as in column names or you might have been using a join that is not allowed i.e cross, inner, etc use left and right join only');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check for column filter bags and resolve aliasing
|
||||
//run this if there are columns with filter bag
|
||||
$this->getQueryWithColumnFilters();
|
||||
|
||||
//Run this if there are filters or sort params or range params in the urls
|
||||
// if (isset($_SERVER['QUERY_STRING'])) {
|
||||
// $qr = $_SERVER['QUERY_STRING'];
|
||||
// $parsed;
|
||||
// parse_str($qr, $parsed);
|
||||
// }
|
||||
$parsed = $this->parse();
|
||||
|
||||
if (!empty($parsed)) {
|
||||
$this->getQueryWithFilters();
|
||||
} else {
|
||||
$this->results = $this->query->get();
|
||||
return $this->results;
|
||||
}
|
||||
$this->results = $this->query->get();
|
||||
return $this->results;
|
||||
} else {
|
||||
$this->query = DB::table($this->table);
|
||||
if (!empty($this->select)) {
|
||||
$this->getSelect();
|
||||
}
|
||||
|
||||
$this->getQueryWithColumnFilters();
|
||||
|
||||
$parsed = $this->parse();
|
||||
if (!empty($parsed)) {
|
||||
$this->getQueryWithFilters();
|
||||
} else {
|
||||
$this->results = $this->query->get();
|
||||
return $this->results;
|
||||
}
|
||||
$this->results = $this->query->get();
|
||||
return $this->results;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render mass
|
||||
* action instance
|
||||
* @return view
|
||||
*/
|
||||
|
||||
// private function renderMassAction(array $attributes)
|
||||
// {
|
||||
|
||||
// //probably render some view when mass action is needed
|
||||
// //the rendered view will have the needed javascript also.
|
||||
// }
|
||||
|
||||
/**
|
||||
* @return view
|
||||
*/
|
||||
|
||||
public function render()
|
||||
{
|
||||
{
|
||||
$this->getDbQueryResults();
|
||||
|
||||
dump($this->columns);
|
||||
|
||||
return view('ui::datagrid.index', [
|
||||
'css' => $this->css,
|
||||
'results' => $this->results,
|
||||
'columns' => $this->columns,
|
||||
'filterable' =>$this->filterable,
|
||||
'operators' => $this->operators,
|
||||
'massoperations' => $this->massoperations,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace Webkul\Ui\DataGrid\Helpers;
|
|||
use Illuminate\Http\Request;
|
||||
|
||||
class Column extends AbstractFillable
|
||||
{
|
||||
{
|
||||
const SORT = 'sort';
|
||||
const ORDER_DESC = 'DESC';
|
||||
const ORDER_ASC = 'ASC';
|
||||
|
|
@ -13,6 +13,7 @@ class Column extends AbstractFillable
|
|||
private $readableName = false;
|
||||
private $value = false;
|
||||
private $sortHtml = '<a href="%s">%s</a>';
|
||||
// private $sortHtml = '<span href="%s">%s</span>';
|
||||
|
||||
// protected $name;
|
||||
// protected $type;
|
||||
|
|
@ -25,8 +26,8 @@ class Column extends AbstractFillable
|
|||
|
||||
|
||||
/**
|
||||
* Without Array it will treat it like string
|
||||
*
|
||||
* Without Array it will treat it like string
|
||||
*
|
||||
* [
|
||||
* 'name',
|
||||
* 'Name',
|
||||
|
|
@ -45,7 +46,8 @@ class Column extends AbstractFillable
|
|||
* },
|
||||
* ]
|
||||
*/
|
||||
protected function setFillable(){
|
||||
protected function setFillable()
|
||||
{
|
||||
$this->fillable = [
|
||||
'name',
|
||||
'type',
|
||||
|
|
@ -69,56 +71,89 @@ class Column extends AbstractFillable
|
|||
];
|
||||
}
|
||||
|
||||
public function __construct($args, $request = null){
|
||||
public function __construct($args, $request = null)
|
||||
{
|
||||
parent::__construct($args);
|
||||
$this->request = $request ?: Request::capture();
|
||||
}
|
||||
|
||||
private function correct($tillDot = true){
|
||||
public function correctFilterSorting()
|
||||
{
|
||||
$return = $this->name;
|
||||
$as = explode('as', $this->name);
|
||||
if(count($as) > 1) return trim(end($as));
|
||||
if (count($as) > 1) {
|
||||
$return = trim(current($as));
|
||||
}
|
||||
|
||||
if(!$tillDot) return $this->name;
|
||||
|
||||
$dot = explode('.', $this->name);
|
||||
if($dot) return trim(end($dot));
|
||||
return $return;
|
||||
}
|
||||
|
||||
private function wrap($obj){
|
||||
if($this->wrapper && is_callable($this->wrapper)){
|
||||
public function correctDotOnly()
|
||||
{
|
||||
$col_name = explode('.', $this->name);
|
||||
if (isset($col_name)) {
|
||||
$col_name = trim($col_name[1]);
|
||||
return $col_name;
|
||||
}
|
||||
}
|
||||
|
||||
public function correct($tillDot = true)
|
||||
{
|
||||
$as = explode('as', $this->name);
|
||||
if (count($as) > 1) {
|
||||
return trim(end($as));
|
||||
}
|
||||
|
||||
if (!$tillDot) {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
$dot = explode('.', $this->name);
|
||||
if ($dot) {
|
||||
return trim(end($dot));
|
||||
}
|
||||
}
|
||||
|
||||
private function wrap($obj)
|
||||
{
|
||||
if ($this->wrapper && is_callable($this->wrapper)) {
|
||||
$this->value = call_user_func($this->wrapper, $this->value, $obj);
|
||||
}
|
||||
}
|
||||
|
||||
private function sortingUrl(){
|
||||
private function sortingUrl()
|
||||
{
|
||||
$query = ['sort' => $this->correct(false)];
|
||||
|
||||
if(($sort = $this->request->offsetGet('sort')) && $sort == $this->correct(false)){
|
||||
if(!$order = $this->request->offsetGet('order')){
|
||||
if (($sort = $this->request->offsetGet('sort')) && $sort == $this->correct(false)) {
|
||||
if (!$order = $this->request->offsetGet('order')) {
|
||||
$query['order'] = self::ORDER_DESC;
|
||||
}else{
|
||||
} else {
|
||||
$query['order'] = ($order == self::ORDER_DESC ? self::ORDER_ASC : self::ORDER_DESC);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$query['order'] = self::ORDER_DESC;
|
||||
}
|
||||
|
||||
|
||||
return '?'.http_build_query(array_merge($this->request->query->all(), $query));
|
||||
}
|
||||
|
||||
/**
|
||||
* need to process xss check on properties like label shouln't include <script>alert('Kaboom!')</script>
|
||||
* need to process css check on properties like label shouln't include <script>alert('Kaboom!')</script>
|
||||
*/
|
||||
public function sorting(){
|
||||
if($this->sortable){
|
||||
public function sorting()
|
||||
{
|
||||
return $this->label;
|
||||
if ($this->sortable) {
|
||||
return vsprintf($this->sortHtml, [$this->sortingUrl(), $this->label]);
|
||||
}else{
|
||||
} else {
|
||||
return $this->label;
|
||||
}
|
||||
}
|
||||
|
||||
public function render($obj){
|
||||
if(property_exists($obj, ( $this->readableName = $this->correct()) ) ){
|
||||
public function render($obj)
|
||||
{
|
||||
if (property_exists($obj, ($this->readableName = $this->correct()))) {
|
||||
$this->value = $obj->{$this->readableName};
|
||||
$this->wrap($obj);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
namespace Webkul\Ui\DataGrid\Helpers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MassAction
|
||||
{
|
||||
public function validateSchemaMassAction($attributes)
|
||||
{
|
||||
$operations_validated = false;
|
||||
$columns_validated = true;
|
||||
foreach ($attributes['operations'] as $operation) {
|
||||
if (array_key_exists('route', $operation) && array_key_exists('method', $operation) && array_key_exists('label', $operation) && array_key_exists('columns', $operation)) {
|
||||
$operations_validated = true;
|
||||
}
|
||||
if ($operations_validated) {
|
||||
foreach ($operation['columns'] as $column) {
|
||||
if (array_key_exists('name', $operation) && array_key_exists('label', $operation) && array_key_exists('type', $operation)) {
|
||||
$columns_validated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($columns_validated && $operations_validated) {
|
||||
return true;
|
||||
} else {
|
||||
throw new \Exception('Schema is invalid for mass actions');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51 (57462) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Checkbox-Dash</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Checkbox-Dash" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<rect id="Base" stroke="#0041FF" stroke-width="2" fill="#FFFFFF" x="1" y="1" width="22" height="22" rx="2"></rect>
|
||||
<path d="M6,12 L17.215332,12" id="Path-8" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 721 B |
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Icon-Crossed</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Icon-Crossed" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M9,8.35557738 L12.2221131,5.13346429 C12.4000655,4.9555119 12.6885833,4.9555119 12.8665357,5.13346429 C13.0444881,5.31141669 13.0444881,5.59993452 12.8665357,5.77788691 L9.64442262,9 L12.8665357,12.2221131 C13.0444881,12.4000655 13.0444881,12.6885833 12.8665357,12.8665357 C12.6885833,13.0444881 12.4000655,13.0444881 12.2221131,12.8665357 L9,9.64442262 L5.77788691,12.8665357 C5.59993452,13.0444881 5.31141669,13.0444881 5.13346429,12.8665357 C4.9555119,12.6885833 4.9555119,12.4000655 5.13346429,12.2221131 L8.35557738,9 L5.13346429,5.77788691 C4.9555119,5.59993452 4.9555119,5.31141669 5.13346429,5.13346429 C5.31141669,4.9555119 5.59993452,4.9555119 5.77788691,5.13346429 L9,8.35557738 Z" id="Combined-Shape" fill="#8E8E8E"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Check-Accent</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Check-Accent" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline id="Path-2" stroke="#0041FF" stroke-width="3" points="2 10 6 14 15 5"></polyline>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 606 B |
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Cross-Accent</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Cross-Accent" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M4.5,13.5 L13.5,4.5" id="Path-2" stroke="#0041FF" stroke-width="3" transform="translate(9.000000, 9.000000) scale(-1, 1) translate(-9.000000, -9.000000) "></path>
|
||||
<path d="M4.5,13.5 L13.5,4.5" id="Path-2" stroke="#0041FF" stroke-width="3"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 778 B |