2 |
3 | # AvoRed an laravel headless e commerce
4 |
5 | A headless e commerce GraphQL API which uses Laravel as a backend.
6 |
7 | ## Installation
8 |
9 | ##### Backend APP setup
10 |
11 | First thing first we will install laravel backend api service. First thing first we will install the laravel app.
12 |
13 | composer create-project laravel/laravel avored-backend
14 | cd avored-backend
15 | composer require avored/framework
16 | composer require avored/dummy-data
17 | composer require avored/cash-on-delivery
18 | composer require avored/pickup
19 |
20 | Set up your .env values and CORS
21 |
22 | To fixed the CORS in your laravel8 app. You can open `config/cors.php` and replace the code like below in the file.
23 |
24 | 'allowed_origins' => ['http://localhost:8080'],
25 |
26 |
27 | Once the .env setup is done then we can install the AvoRed E commerce
28 |
29 | php artisan avored:install
30 | php artisan vendor:publish --provider="AvoRed\Framework\AvoRedServiceProvider"
31 | yoursite.com/graphiql
32 |
33 | Once the avored/framework has been installed after that we will make sure we setup the CORS to allow access of an graphql api via any frontend.
34 |
35 | ##### Frontend APP Setup
36 |
37 | git clone https://github.com/avored/laravel-ecommerce avored-frontend
38 | cd avored-frontend
39 | npm install
40 | npm run serve
41 |
42 |
43 | #### Installation via Docker
44 |
45 | Execute the below command:
46 |
47 | git clone https://github.com/avored/docker-dev.git
48 | cd docker-dev
49 |
50 | git clone https://github.com/avored/laravel-ecommerce ./src/frontend
51 | docker-compose up -d
52 | docker-compose run --rm composer create-project laravel/laravel:8.6 ./
53 | docker-compose run --rm composer require avored/framework
54 | docker-compose run --rm composer require avored/dummy-data avored/cash-on-delivery avored/pickup
55 |
56 | Now setup `.env` file. Open a avored app .env file which is located at `./src/backend/.env` then setup your database and any other env as per your docker-compose.yml file
57 |
58 | DB_HOST=mysql
59 | DB_DATABASE=homestead
60 | DB_USERNAME=homestead
61 | DB_PASSWORD=secret
62 |
63 | Now we just have to install the AvoRed and create an avored admin user account
64 |
65 | docker-compose run --rm artisan avored:install
66 | docker-compose run --rm artisan vendor:publish --provider="AvoRed\Framework\AvoRedServiceProvider"
67 |
68 | Now we need to setup CORS so frontend application can receive api call from backnd.
69 | Open `./src/backend/config/cors.php` then replace the below line
70 |
71 | 'paths' => ['/graphql', 'sanctum/csrf-cookie'],
72 | 'allowed_origins' => ['http://localhost:8060'],
73 |
74 | That's It. Now you can visit `http://localhost:8060` for frontend and for backend you can visit `http://localhost:8050/admin`
75 |
--------------------------------------------------------------------------------
/RoadMap.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # AvoRed E commerce Road Map
4 |
5 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/deploy.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | # abort on errors
3 | set -e
4 | # build
5 | npm run build
6 | # navigate into the build output directory
7 | cd dist
8 | # if you are deploying to a custom domain
9 | # echo 'www.example.com' > CNAME
10 | git init
11 | git add -A
12 | git commit -m 'deploy'
13 | git remote add origin git@github.com:avored/laravel-ecommerce.git
14 | git push -u -f origin master:gh-pages
15 |
--------------------------------------------------------------------------------
/docs/mutation.md:
--------------------------------------------------------------------------------
1 | # AvoRed GraphQL API mutations
2 |
3 | AvoRed GraphQL API mutation is one way of modifying or creating the avored GraphQL server-side data and in return, it will send the success information or created or newly updated server data.
4 |
5 | #### Login Mutation
6 |
7 | Login mutation is used to login a customer to a server and so in response you will get the token to validate the user.
8 |
9 | Query Request:
10 |
11 | mutation VisitorLogin (
12 | $password: String!
13 | $email: String!
14 | ){
15 | login (
16 | email: $email
17 | password: $password
18 | ){
19 | token_type
20 | access_token
21 | expires_in
22 | refresh_token
23 | }
24 | }
25 |
26 | Query Response:
27 |
28 | {
29 | "data": {
30 | "login": {
31 | "token_type": "Bearer",
32 | "access_token": "eyJ0eXAi********",
33 | "expires_in": 31536000,
34 | "refresh_token": "25847f285271*********"
35 | }
36 | }
37 | }
38 |
39 | #### Register Mutation
40 |
41 | Register mutation is used to register a customer to a server and so in response you will get the token to validate the user.
42 |
43 | Query Request:
44 |
45 | mutation CustomerRegistration (
46 | $email: String!
47 | $password: String!
48 | $first_name: String!
49 | $last_name: String!
50 | ) {
51 | register (
52 | first_name: $first_name,
53 | last_name: $last_name,
54 | email: $email,
55 | password: $password
56 | ) {
57 | access_token
58 | }
59 | }
60 |
61 | Query Response:
62 |
63 | {
64 | "data": {
65 | "register": {
66 | "token_type": "Bearer",
67 | "access_token": "eyJ0eXAiOiJKV1QiLCJh*********",
68 | "expires_in": 31536000,
69 | "refresh_token": "def50200aff4577346c64f7eaabdfbdda9b3ae7d641f48a*****"
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/laravel-backend/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | indent_size = 4
7 | indent_style = space
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.{yml,yaml}]
15 | indent_size = 2
16 |
17 | [docker-compose.yml]
18 | indent_size = 4
19 |
--------------------------------------------------------------------------------
/laravel-backend/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 | LOG_DEPRECATIONS_CHANNEL=null
9 | LOG_LEVEL=debug
10 |
11 | DB_CONNECTION=mysql
12 | DB_HOST=127.0.0.1
13 | DB_PORT=3306
14 | DB_DATABASE=laravel
15 | DB_USERNAME=root
16 | DB_PASSWORD=
17 |
18 | BROADCAST_DRIVER=log
19 | CACHE_DRIVER=file
20 | FILESYSTEM_DISK=local
21 | QUEUE_CONNECTION=sync
22 | SESSION_DRIVER=file
23 | SESSION_LIFETIME=120
24 |
25 | MEMCACHED_HOST=127.0.0.1
26 |
27 | REDIS_HOST=127.0.0.1
28 | REDIS_PASSWORD=null
29 | REDIS_PORT=6379
30 |
31 | MAIL_MAILER=smtp
32 | MAIL_HOST=mailhog
33 | MAIL_PORT=1025
34 | MAIL_USERNAME=null
35 | MAIL_PASSWORD=null
36 | MAIL_ENCRYPTION=null
37 | MAIL_FROM_ADDRESS="hello@example.com"
38 | MAIL_FROM_NAME="${APP_NAME}"
39 |
40 | AWS_ACCESS_KEY_ID=
41 | AWS_SECRET_ACCESS_KEY=
42 | AWS_DEFAULT_REGION=us-east-1
43 | AWS_BUCKET=
44 | AWS_USE_PATH_STYLE_ENDPOINT=false
45 |
46 | PUSHER_APP_ID=
47 | PUSHER_APP_KEY=
48 | PUSHER_APP_SECRET=
49 | PUSHER_HOST=
50 | PUSHER_PORT=443
51 | PUSHER_SCHEME=https
52 | PUSHER_APP_CLUSTER=mt1
53 |
54 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
55 | VITE_PUSHER_HOST="${PUSHER_HOST}"
56 | VITE_PUSHER_PORT="${PUSHER_PORT}"
57 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
58 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
59 |
--------------------------------------------------------------------------------
/laravel-backend/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
3 | *.blade.php diff=html
4 | *.css diff=css
5 | *.html diff=html
6 | *.md diff=markdown
7 | *.php diff=php
8 |
9 | /.github export-ignore
10 | CHANGELOG.md export-ignore
11 | .styleci.yml export-ignore
12 |
--------------------------------------------------------------------------------
/laravel-backend/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/build
3 | /public/hot
4 | /public/storage
5 | /storage/*.key
6 | /vendor
7 | .env
8 | .env.backup
9 | .env.production
10 | .phpunit.result.cache
11 | Homestead.json
12 | Homestead.yaml
13 | auth.json
14 | npm-debug.log
15 | yarn-error.log
16 | /.fleet
17 | /.idea
18 | /.vscode
19 |
--------------------------------------------------------------------------------
/laravel-backend/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')->hourly();
19 | }
20 |
21 | /**
22 | * Register the commands for the application.
23 | *
24 | * @return void
25 | */
26 | protected function commands()
27 | {
28 | $this->load(__DIR__.'/Commands');
29 |
30 | require base_path('routes/console.php');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/laravel-backend/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | , \Psr\Log\LogLevel::*>
14 | */
15 | protected $levels = [
16 | //
17 | ];
18 |
19 | /**
20 | * A list of the exception types that are not reported.
21 | *
22 | * @var array>
23 | */
24 | protected $dontReport = [
25 | //
26 | ];
27 |
28 | /**
29 | * A list of the inputs that are never flashed to the session on validation exceptions.
30 | *
31 | * @var array
32 | */
33 | protected $dontFlash = [
34 | 'current_password',
35 | 'password',
36 | 'password_confirmation',
37 | ];
38 |
39 | /**
40 | * Register the exception handling callbacks for the application.
41 | *
42 | * @return void
43 | */
44 | public function register()
45 | {
46 | $this->reportable(function (Throwable $e) {
47 | //
48 | });
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/laravel-backend/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | protected $middleware = [
17 | // \App\Http\Middleware\TrustHosts::class,
18 | \App\Http\Middleware\TrustProxies::class,
19 | \Illuminate\Http\Middleware\HandleCors::class,
20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
22 | \App\Http\Middleware\TrimStrings::class,
23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
24 | ];
25 |
26 | /**
27 | * The application's route middleware groups.
28 | *
29 | * @var array>
30 | */
31 | protected $middlewareGroups = [
32 | 'web' => [
33 | \App\Http\Middleware\EncryptCookies::class,
34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
35 | \Illuminate\Session\Middleware\StartSession::class,
36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
37 | \App\Http\Middleware\VerifyCsrfToken::class,
38 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
39 | ],
40 |
41 | 'api' => [
42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
43 | 'throttle:api',
44 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
45 | ],
46 | ];
47 |
48 | /**
49 | * The application's route middleware.
50 | *
51 | * These middleware may be assigned to groups or used individually.
52 | *
53 | * @var array
54 | */
55 | protected $routeMiddleware = [
56 | 'auth' => \App\Http\Middleware\Authenticate::class,
57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
58 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
63 | 'signed' => \App\Http\Middleware\ValidateSignature::class,
64 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
65 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
66 | ];
67 | }
68 |
--------------------------------------------------------------------------------
/laravel-backend/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/laravel-backend/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/laravel-backend/app/Http/Middleware/PreventRequestsDuringMaintenance.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/laravel-backend/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | check()) {
26 | return redirect(RouteServiceProvider::HOME);
27 | }
28 | }
29 |
30 | return $next($request);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/laravel-backend/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | 'current_password',
16 | 'password',
17 | 'password_confirmation',
18 | ];
19 | }
20 |
--------------------------------------------------------------------------------
/laravel-backend/app/Http/Middleware/TrustHosts.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | public function hosts()
15 | {
16 | return [
17 | $this->allSubdomainsOfApplicationUrl(),
18 | ];
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/laravel-backend/app/Http/Middleware/TrustProxies.php:
--------------------------------------------------------------------------------
1 | |string|null
14 | */
15 | protected $proxies;
16 |
17 | /**
18 | * The headers that should be used to detect proxies.
19 | *
20 | * @var int
21 | */
22 | protected $headers =
23 | Request::HEADER_X_FORWARDED_FOR |
24 | Request::HEADER_X_FORWARDED_HOST |
25 | Request::HEADER_X_FORWARDED_PORT |
26 | Request::HEADER_X_FORWARDED_PROTO |
27 | Request::HEADER_X_FORWARDED_AWS_ELB;
28 | }
29 |
--------------------------------------------------------------------------------
/laravel-backend/app/Http/Middleware/ValidateSignature.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | // 'fbclid',
16 | // 'utm_campaign',
17 | // 'utm_content',
18 | // 'utm_medium',
19 | // 'utm_source',
20 | // 'utm_term',
21 | ];
22 | }
23 |
--------------------------------------------------------------------------------
/laravel-backend/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/laravel-backend/app/Models/User.php:
--------------------------------------------------------------------------------
1 |
19 | */
20 | protected $fillable = [
21 | 'name',
22 | 'email',
23 | 'password',
24 | ];
25 |
26 | /**
27 | * The attributes that should be hidden for serialization.
28 | *
29 | * @var array
30 | */
31 | protected $hidden = [
32 | 'password',
33 | 'remember_token',
34 | ];
35 |
36 | /**
37 | * The attributes that should be cast.
38 | *
39 | * @var array
40 | */
41 | protected $casts = [
42 | 'email_verified_at' => 'datetime',
43 | ];
44 | }
45 |
--------------------------------------------------------------------------------
/laravel-backend/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | protected $policies = [
16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | *
22 | * @return void
23 | */
24 | public function boot()
25 | {
26 | $this->registerPolicies();
27 |
28 | //
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/laravel-backend/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | >
16 | */
17 | protected $listen = [
18 | Registered::class => [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | ];
22 |
23 | /**
24 | * Register any events for your application.
25 | *
26 | * @return void
27 | */
28 | public function boot()
29 | {
30 | //
31 | }
32 |
33 | /**
34 | * Determine if events and listeners should be automatically discovered.
35 | *
36 | * @return bool
37 | */
38 | public function shouldDiscoverEvents()
39 | {
40 | return false;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/laravel-backend/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | configureRateLimiting();
30 |
31 | $this->routes(function () {
32 | Route::middleware('api')
33 | ->prefix('api')
34 | ->group(base_path('routes/api.php'));
35 |
36 | Route::middleware('web')
37 | ->group(base_path('routes/web.php'));
38 | });
39 | }
40 |
41 | /**
42 | * Configure the rate limiters for the application.
43 | *
44 | * @return void
45 | */
46 | protected function configureRateLimiting()
47 | {
48 | RateLimiter::for('api', function (Request $request) {
49 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
50 | });
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/laravel-backend/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/laravel-backend/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 | return $app;
55 |
--------------------------------------------------------------------------------
/laravel-backend/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/laravel-backend/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "type": "project",
4 | "description": "The Laravel Framework.",
5 | "keywords": ["framework", "laravel"],
6 | "license": "MIT",
7 | "require": {
8 | "php": "^8.0.2",
9 | "avored/cash-on-delivery": "^5.0",
10 | "avored/dummy-data": "^5.0",
11 | "avored/framework": "^5.0",
12 | "avored/pickup": "^5.0",
13 | "guzzlehttp/guzzle": "^7.2",
14 | "laravel/framework": "^9.19",
15 | "laravel/sanctum": "^3.0",
16 | "laravel/tinker": "^2.7"
17 | },
18 | "require-dev": {
19 | "fakerphp/faker": "^1.9.1",
20 | "laravel/pint": "^1.0",
21 | "laravel/sail": "^1.0.1",
22 | "mockery/mockery": "^1.4.4",
23 | "nunomaduro/collision": "^6.1",
24 | "phpunit/phpunit": "^9.5.10",
25 | "spatie/laravel-ignition": "^1.0"
26 | },
27 | "autoload": {
28 | "psr-4": {
29 | "App\\": "app/",
30 | "Database\\Factories\\": "database/factories/",
31 | "Database\\Seeders\\": "database/seeders/"
32 | }
33 | },
34 | "autoload-dev": {
35 | "psr-4": {
36 | "Tests\\": "tests/"
37 | }
38 | },
39 | "scripts": {
40 | "post-autoload-dump": [
41 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
42 | "@php artisan package:discover --ansi"
43 | ],
44 | "post-update-cmd": [
45 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
46 | ],
47 | "post-root-package-install": [
48 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
49 | ],
50 | "post-create-project-cmd": [
51 | "@php artisan key:generate --ansi"
52 | ]
53 | },
54 | "extra": {
55 | "laravel": {
56 | "dont-discover": []
57 | }
58 | },
59 | "config": {
60 | "optimize-autoloader": true,
61 | "preferred-install": "dist",
62 | "sort-packages": true,
63 | "allow-plugins": {
64 | "pestphp/pest-plugin": true,
65 | "composer/installers": true,
66 | "avored/module-installer": true
67 | }
68 | },
69 | "minimum-stability": "dev",
70 | "prefer-stable": true
71 | }
72 |
--------------------------------------------------------------------------------
/laravel-backend/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
40 | 'port' => env('PUSHER_PORT', 443),
41 | 'scheme' => env('PUSHER_SCHEME', 'https'),
42 | 'encrypted' => true,
43 | 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
44 | ],
45 | 'client_options' => [
46 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
47 | ],
48 | ],
49 |
50 | 'ably' => [
51 | 'driver' => 'ably',
52 | 'key' => env('ABLY_KEY'),
53 | ],
54 |
55 | 'redis' => [
56 | 'driver' => 'redis',
57 | 'connection' => 'default',
58 | ],
59 |
60 | 'log' => [
61 | 'driver' => 'log',
62 | ],
63 |
64 | 'null' => [
65 | 'driver' => 'null',
66 | ],
67 |
68 | ],
69 |
70 | ];
71 |
--------------------------------------------------------------------------------
/laravel-backend/config/cors.php:
--------------------------------------------------------------------------------
1 | ['/graphql'],
19 |
20 | 'allowed_methods' => ['*'],
21 |
22 | 'allowed_origins' => ['*'],
23 |
24 | 'allowed_origins_patterns' => [],
25 |
26 | 'allowed_headers' => ['Origin', 'Content-Type', 'authorization'],
27 |
28 | 'exposed_headers' => [],
29 |
30 | 'max_age' => 0,
31 |
32 | 'supports_credentials' => true,
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/laravel-backend/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DISK', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Filesystem Disks
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure as many filesystem "disks" as you wish, and you
24 | | may even configure multiple disks of the same driver. Defaults have
25 | | been set up for each driver as an example of the required values.
26 | |
27 | | Supported Drivers: "local", "ftp", "sftp", "s3"
28 | |
29 | */
30 |
31 | 'disks' => [
32 |
33 | 'local' => [
34 | 'driver' => 'local',
35 | 'root' => storage_path('app'),
36 | 'throw' => false,
37 | ],
38 |
39 | 'public' => [
40 | 'driver' => 'local',
41 | 'root' => storage_path('app/public'),
42 | 'url' => env('APP_URL').'/storage',
43 | 'visibility' => 'public',
44 | 'throw' => false,
45 | ],
46 |
47 | 's3' => [
48 | 'driver' => 's3',
49 | 'key' => env('AWS_ACCESS_KEY_ID'),
50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
51 | 'region' => env('AWS_DEFAULT_REGION'),
52 | 'bucket' => env('AWS_BUCKET'),
53 | 'url' => env('AWS_URL'),
54 | 'endpoint' => env('AWS_ENDPOINT'),
55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
56 | 'throw' => false,
57 | ],
58 |
59 | ],
60 |
61 | /*
62 | |--------------------------------------------------------------------------
63 | | Symbolic Links
64 | |--------------------------------------------------------------------------
65 | |
66 | | Here you may configure the symbolic links that will be created when the
67 | | `storage:link` Artisan command is executed. The array keys should be
68 | | the locations of the links and the values should be their targets.
69 | |
70 | */
71 |
72 | 'links' => [
73 | public_path('storage') => storage_path('app/public'),
74 | ],
75 |
76 | ];
77 |
--------------------------------------------------------------------------------
/laravel-backend/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 65536,
48 | 'threads' => 1,
49 | 'time' => 4,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/laravel-backend/config/sanctum.php:
--------------------------------------------------------------------------------
1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
19 | '%s%s',
20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
21 | Sanctum::currentApplicationUrlWithPort()
22 | ))),
23 |
24 | /*
25 | |--------------------------------------------------------------------------
26 | | Sanctum Guards
27 | |--------------------------------------------------------------------------
28 | |
29 | | This array contains the authentication guards that will be checked when
30 | | Sanctum is trying to authenticate a request. If none of these guards
31 | | are able to authenticate the request, Sanctum will use the bearer
32 | | token that's present on an incoming request for authentication.
33 | |
34 | */
35 |
36 | 'guard' => ['web'],
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Expiration Minutes
41 | |--------------------------------------------------------------------------
42 | |
43 | | This value controls the number of minutes until an issued token will be
44 | | considered expired. If this value is null, personal access tokens do
45 | | not expire. This won't tweak the lifetime of first-party sessions.
46 | |
47 | */
48 |
49 | 'expiration' => null,
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | Sanctum Middleware
54 | |--------------------------------------------------------------------------
55 | |
56 | | When authenticating your first-party SPA with Sanctum you may need to
57 | | customize some of the middleware Sanctum uses while processing the
58 | | request. You may change the middleware listed below as required.
59 | |
60 | */
61 |
62 | 'middleware' => [
63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
65 | ],
66 |
67 | ];
68 |
--------------------------------------------------------------------------------
/laravel-backend/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | 'scheme' => 'https',
22 | ],
23 |
24 | 'postmark' => [
25 | 'token' => env('POSTMARK_TOKEN'),
26 | ],
27 |
28 | 'ses' => [
29 | 'key' => env('AWS_ACCESS_KEY_ID'),
30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
32 | ],
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/laravel-backend/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/laravel-backend/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite*
2 |
--------------------------------------------------------------------------------
/laravel-backend/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 |
10 | */
11 | class UserFactory extends Factory
12 | {
13 | /**
14 | * Define the model's default state.
15 | *
16 | * @return array
17 | */
18 | public function definition()
19 | {
20 | return [
21 | 'name' => fake()->name(),
22 | 'email' => fake()->unique()->safeEmail(),
23 | 'email_verified_at' => now(),
24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
25 | 'remember_token' => Str::random(10),
26 | ];
27 | }
28 |
29 | /**
30 | * Indicate that the model's email address should be unverified.
31 | *
32 | * @return static
33 | */
34 | public function unverified()
35 | {
36 | return $this->state(fn (array $attributes) => [
37 | 'email_verified_at' => null,
38 | ]);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/laravel-backend/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('name');
19 | $table->string('email')->unique();
20 | $table->timestamp('email_verified_at')->nullable();
21 | $table->string('password');
22 | $table->rememberToken();
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('users');
35 | }
36 | };
37 |
--------------------------------------------------------------------------------
/laravel-backend/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token');
19 | $table->timestamp('created_at')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('password_resets');
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/laravel-backend/database/migrations/2019_08_19_000000_create_failed_jobs_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->string('uuid')->unique();
19 | $table->text('connection');
20 | $table->text('queue');
21 | $table->longText('payload');
22 | $table->longText('exception');
23 | $table->timestamp('failed_at')->useCurrent();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('failed_jobs');
35 | }
36 | };
37 |
--------------------------------------------------------------------------------
/laravel-backend/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->morphs('tokenable');
19 | $table->string('name');
20 | $table->string('token', 64)->unique();
21 | $table->text('abilities')->nullable();
22 | $table->timestamp('last_used_at')->nullable();
23 | $table->timestamp('expires_at')->nullable();
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('personal_access_tokens');
36 | }
37 | };
38 |
--------------------------------------------------------------------------------
/laravel-backend/database/seeders/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | create();
18 |
19 | // \App\Models\User::factory()->create([
20 | // 'name' => 'Test User',
21 | // 'email' => 'test@example.com',
22 | // ]);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/laravel-backend/lang/en/auth.php:
--------------------------------------------------------------------------------
1 | 'These credentials do not match our records.',
17 | 'password' => 'The provided password is incorrect.',
18 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
19 |
20 | ];
21 |
--------------------------------------------------------------------------------
/laravel-backend/lang/en/pagination.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/laravel-backend/lang/en/passwords.php:
--------------------------------------------------------------------------------
1 | 'Your password has been reset!',
17 | 'sent' => 'We have emailed your password reset link!',
18 | 'throttled' => 'Please wait before retrying.',
19 | 'token' => 'This password reset token is invalid.',
20 | 'user' => "We can't find a user with that email address.",
21 |
22 | ];
23 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | /node_modules
3 | package-lock.json
4 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 AvoRed E commerce
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "avored/cash-on-delivery",
3 | "description" : "AvoRed Laravel E commerce - Cash On Delivery Module",
4 | "keywords" : [
5 | "framework",
6 | "banner",
7 | "cart",
8 | "laravel",
9 | "e commerce",
10 | "laravel5",
11 | "shop",
12 | "shopping-cart",
13 | "e-commerce",
14 | "shopping cart",
15 | "e commerce"
16 | ],
17 | "license" : "MIT",
18 | "authors" : [{
19 | "name" : "Purvesh ",
20 | "email" : "ind.purvesh@gmail.com"
21 | }
22 | ],
23 | "type" : "avored-module",
24 | "require" : {
25 | "php": ">=7.1.3",
26 | "avored/module-installer" : "1.*"
27 | },
28 | "autoload" : {
29 | "psr-4" : {
30 | "AvoRed\\CashOnDelivery\\" : "src/"
31 | }
32 | },
33 | "homepage" : "https://avored.com",
34 | "support" : {
35 | "email" : "ind.purvesh@gmail.com",
36 | "issues" : "https://avored.com/discussion",
37 | "forum" : "https://avored.com/discussion",
38 | "wiki" : "https://avored.com/docs",
39 | "source" : "https://github.com/avored/banner"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/dist/js/cash-on-delivery.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=1)}([function(e,t,n){"use strict";function o(e,t,n,o,r,i,a,s){var u,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),o&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),a?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},l._ssrRegister=u):r&&(u=s?function(){r.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:r),u)if(l.functional){l._injectStyles=u;var c=l.render;l.render=function(e,t){return u.call(t),c(e,t)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,u):[u]}return{exports:e,options:l}}n.d(t,"a",(function(){return o}))},function(e,t,n){e.exports=n(2)},function(e,t,n){AvoRed.initialize((function(e){e.component("avored-cash-on-delivery",n(3).default),e.component("cash-on-delivery-config",n(4).default)}))},function(e,t,n){"use strict";n.r(t);var o={name:"avored-cash-on-delivery",props:[],data:function(){return{selectedCashOnDeliveryPaymentOption:!1}},methods:{handlePaymentChange:function(e,t){this.selectedCashOnDeliveryPaymentOption=!!e,window.EventBus.$emit("selectedPaymentIdentifier",t)}},mounted:function(){var e=this,t=window.EventBus;t.$on("placeOrderBefore",(function(){e.selectedCashOnDeliveryPaymentOption&&t.$emit("placeOrderAfter")}))}},r=n(0),i=Object(r.a)(o,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("avored-toggle",{attrs:{"label-text":"Cash On Delivery","field-name":"payment_option","toggle-on-value":"a-cash-on-delivery"}})],1)}),[],!1,null,null,null);t.default=i.exports},function(e,t,n){"use strict";n.r(t);var o={name:"cash-on-delivery-config",props:["data","options"],data:function(){return{status:!1}},methods:{},mounted:function(){}},r=n(0),i=Object(r.a)(o,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("avored-select",{attrs:{"field-name":"a_cash_on_delivery_status",options:this.options,"init-value":this.data.a_cash_on_delivery_status}})],1)}),[],!1,null,null,null);t.default=i.exports}]);
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/dist/mix-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "/vendor/avored/js/cash-on-delivery.js": "/vendor/avored/js/cash-on-delivery.js"
3 | }
4 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/dist/vendor/avored/js/cash-on-delivery.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=1)}([function(e,t,n){"use strict";function o(e,t,n,o,r,i,a,s){var u,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),o&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),a?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=u):r&&(u=s?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),u)if(c.functional){c._injectStyles=u;var l=c.render;c.render=function(e,t){return u.call(t),l(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,u):[u]}return{exports:e,options:c}}n.d(t,"a",(function(){return o}))},function(e,t,n){e.exports=n(2)},function(e,t,n){AvoRed.initialize((function(e){e.component("avored-cash-on-delivery",n(4).default),e.component("cash-on-delivery-config",n(3).default)}))},function(e,t,n){"use strict";n.r(t);var o={name:"cash-on-delivery-config",props:["data","options"],data:function(){return{status:!1}},methods:{},mounted:function(){}},r=n(0),i=Object(r.a)(o,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("avored-select",{attrs:{"field-name":"a_cash_on_delivery_status",options:this.options,"init-value":this.data.a_cash_on_delivery_status}})],1)}),[],!1,null,null,null);t.default=i.exports},function(e,t,n){"use strict";n.r(t);var o={name:"avored-cash-on-delivery",props:[],data:function(){return{selectedCashOnDeliveryPaymentOption:!1}},methods:{handlePaymentChange:function(e,t){this.selectedCashOnDeliveryPaymentOption=!!e,window.EventBus.$emit("selectedPaymentIdentifier",t)}},mounted:function(){var e=this,t=window.EventBus;t.$on("placeOrderBefore",(function(){e.selectedCashOnDeliveryPaymentOption&&t.$emit("placeOrderAfter")}))}},r=n(0),i=Object(r.a)(o,void 0,void 0,!1,null,null,null);t.default=i.exports}]);
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6 | "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",
7 | "watch-poll": "npm run watch -- --watch-poll",
8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --https --key ~/.config/valet/Certificates/laravel-ecommerce.test.key --cert ~/.config/valet/Certificates/laravel-ecommerce.test.crt --config=node_modules/laravel-mix/setup/webpack.config.js",
9 | "prod": "npm run production",
10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 | },
12 | "dependencies": {
13 | "cross-env": "^6.0.0",
14 | "laravel-mix": "^4.1.4",
15 | "vue": "^2.5.17"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/readme.md:
--------------------------------------------------------------------------------
1 | # AvoRed Cash On Delivery Payment Module
2 |
3 | ### Installation
4 |
5 | composer require avored/cash-on-delivery
6 |
7 | php artisan migrate
8 |
9 | ### How to Use
10 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/register.yml:
--------------------------------------------------------------------------------
1 | name: avored cash-on-delivery
2 | identifier: avored-cash-on-delivery
3 | status: active
4 | description: avored cash-on-delivery Module
5 | namespace: AvoRed\CashOnDelivery\
6 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/resources/components/AvoRedCashOnDelivery.vue:
--------------------------------------------------------------------------------
1 |
32 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/resources/components/CashOnDeliveryConfig.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
29 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/resources/js/cash-on-delivery.js:
--------------------------------------------------------------------------------
1 | AvoRed.initialize((Vue) => {
2 | Vue.component('avored-cash-on-delivery', require('../components/AvoRedCashOnDelivery.vue').default)
3 | Vue.component('cash-on-delivery-config', require('../components/CashOnDeliveryConfig.vue').default)
4 | })
5 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/resources/lang/en/cash-on-delivery.php:
--------------------------------------------------------------------------------
1 | 'Cash On Delivery',
5 | 'enabled' => 'Enabled',
6 | 'disabled' => 'Disabled',
7 | 'status' => 'Status'
8 | ];
9 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/resources/views/index.blade.php:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/resources/views/system/configuration/payment-card.blade.php:
--------------------------------------------------------------------------------
1 | @php
2 | $data = collect();
3 | $data->put('a_cash_on_delivery_status', $repository->getValueByCode('a_cash_on_delivery_status'));
4 |
5 | $options = collect();
6 | $options->put('ENABLED', 'Enabled');
7 | $options->put('DISABLED', 'Disabled');
8 | @endphp
9 |
10 |
14 |
15 | @push('scripts')
16 |
17 | @endpush
18 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/src/CashOnDelivery.php:
--------------------------------------------------------------------------------
1 | identifier;
38 | }
39 |
40 | public function enable()
41 | {
42 | return true;
43 | }
44 |
45 | public function process()
46 | {
47 | //
48 | }
49 |
50 | /**
51 | * Get Title for this Payment Option.
52 | *
53 | * return boolean
54 | */
55 | public function name()
56 | {
57 | return $this->name;
58 | }
59 |
60 | /**
61 | * Payment Option View Path.
62 | * return String
63 | */
64 | public function view()
65 | {
66 | return $this->view;
67 | }
68 |
69 | /**
70 | * Render Payment Option
71 | * return String
72 | */
73 | public function render()
74 | {
75 | return view($this->view())->with($this->with());
76 | }
77 |
78 |
79 | /**
80 | * Payment Option View Data.
81 | *
82 | * return Array
83 | */
84 | public function with()
85 | {
86 | return ['payment' => $this];
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/src/Module.php:
--------------------------------------------------------------------------------
1 | registerResources();
20 | $this->registerPaymentOption();
21 | $this->registerTab();
22 | $this->publishFiles();
23 | }
24 |
25 | /**
26 | * Register any application services.
27 | *
28 | * @return void
29 | */
30 | public function register()
31 | {
32 | //
33 | }
34 |
35 | /**
36 | * Registering avored cash-on-delivery Resource
37 | * e.g. Route, View, Database & Translation Path
38 | *
39 | * @return void
40 | */
41 | protected function registerResources()
42 | {
43 | //$this->loadRoutesFrom(__DIR__ . '/../routes/web.php');
44 | $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'a-cash-on-delivery');
45 | $this->loadViewsFrom(__DIR__ . '/../resources/views', 'a-cash-on-delivery');
46 | }
47 |
48 | /**
49 | * Register Shippiong Option for App.
50 | *
51 | * @return void
52 | */
53 | protected function registerPaymentOption()
54 | {
55 | $payment = new CashOnDelivery();
56 | Payment::put($payment);
57 | }
58 |
59 | /**
60 | * Publish Files for AvoRed Banner Modules.
61 | * @return void
62 | */
63 | public function publishFiles()
64 | {
65 | $this->publishes([
66 | __DIR__ . '/../dist/js' => public_path('vendor/avored/js'),
67 | ]);
68 | }
69 |
70 | public function registerTab()
71 | {
72 | // Tab::put('system.configuration', function (TabItem $tab) {
73 | // $tab->key('system.configuration.cash-on-delivery')
74 | // ->label('a-cash-on-delivery::cash-on-delivery.config-title')
75 | // ->view('a-cash-on-delivery::system.configuration.payment-card');
76 | // });
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/cash-on-delivery/webpack.mix.js:
--------------------------------------------------------------------------------
1 | let mix = require('laravel-mix')
2 |
3 | // let publicPath = 'dist'
4 | let publicPath = '../../../public'
5 |
6 | mix.setPublicPath(publicPath)
7 | .js('resources/js/cash-on-delivery.js', 'vendor/avored/js/cash-on-delivery.js')
8 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | .DS_Store
3 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 AvoRed E commerce
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/README.md:
--------------------------------------------------------------------------------
1 | # AvoRed E commerce Dummy Data
2 |
3 | AvoRed E commerce Dummy Data
4 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/avored-bunk-bed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/avored-bunk-bed.jpg
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/avored-double-bed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/avored-double-bed.jpg
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/avored-queen-bed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/avored-queen-bed.jpg
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/avored-single-bed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/avored-single-bed.jpg
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/avored-sofa-set.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/avored-sofa-set.jpg
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/blue-attribute.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/blue-attribute.png
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/laravel-bedside-table.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/laravel-bedside-table.jpg
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/laravel-sofa-set.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/laravel-sofa-set.jpg
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/php-single-mattress.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/php-single-mattress.jpg
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/php-sofa-set.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/php-sofa-set.jpg
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/red-attribute.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/red-attribute.jpg
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/yellow-attribute.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/modules/avored/dummy-data/assets/uploads/catalog/yellow-attribute.png
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "avored/dummy-data",
3 | "type" : "avored-module",
4 | "description" : "AvoRed Laravel 5 E commerce Dummy Data",
5 | "keywords" : [
6 | "framework",
7 | "install",
8 | "cart",
9 | "laravel",
10 | "e commerce",
11 | "laravel5",
12 | "shop",
13 | "shopping-cart",
14 | "e-commerce",
15 | "shopping cart",
16 | "e commerce"
17 | ],
18 | "license" : "MIT",
19 | "authors" : [{
20 | "name" : "Purvesh ",
21 | "email" : "ind.purvesh@gmail.com"
22 | }
23 | ],
24 | "require" : {
25 | "php" : ">=7.1.3",
26 | "avored/module-installer" : "1.*"
27 | },
28 | "autoload" : {
29 | "psr-4" : {
30 | "AvoRed\\DummyData\\" : "src"
31 | }
32 | },
33 | "homepage" : "https://www.avored.com/",
34 | "support" : {
35 | "email" : "ind.purvesh@gmail.com",
36 | "issues" : "https://www.avored.com/discussion",
37 | "forum" : "https://www.avored.com/discussion",
38 | "wiki" : "https://www.avored.com/docs",
39 | "source" : "https://www.github.com/avored/dummy-data"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/register.yml:
--------------------------------------------------------------------------------
1 | name: AvoRed Dummy Data
2 | identifier: avored-dummy-data
3 | description: AvoRed Dummy Data Module
4 | namespace: AvoRed\DummyData\
5 | status: active
6 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/dummy-data/src/Module.php:
--------------------------------------------------------------------------------
1 |
5 | * @copyright 2017-2018 AvoRed
6 | * @license https://opensource.org/licenses/MIT MIT
7 | * @link https://www.avored.com
8 | */
9 |
10 | namespace AvoRed\DummyData;
11 |
12 | use Illuminate\Support\ServiceProvider;
13 |
14 | class Module extends ServiceProvider
15 | {
16 | /**
17 | * Indicates if loading of the provider is deferred.
18 | *
19 | * @var bool
20 | */
21 | ///protected $defer = true;
22 |
23 | /**
24 | * Bootstrap any application services.
25 | *
26 | * @return void
27 | */
28 | public function boot()
29 | {
30 | $this->publishFiles();
31 | }
32 |
33 | /**
34 | * Register any application services.
35 | *
36 | * @return void
37 | */
38 | public function register()
39 | {
40 | }
41 |
42 | public function publishFiles()
43 | {
44 | $this->publishes([__DIR__ . '/../assets' => storage_path('app/public')], 'public');
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | /node_modules
3 | package-lock.json
4 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 AvoRed E commerce
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "avored/pickup",
3 | "description" : "AvoRed Laravel E commerce - Pickup Module",
4 | "keywords" : [
5 | "framework",
6 | "banner",
7 | "cart",
8 | "laravel",
9 | "e commerce",
10 | "laravel5",
11 | "shop",
12 | "shopping-cart",
13 | "e-commerce",
14 | "shopping cart",
15 | "e commerce"
16 | ],
17 | "license" : "MIT",
18 | "authors" : [{
19 | "name" : "Purvesh ",
20 | "email" : "ind.purvesh@gmail.com"
21 | }
22 | ],
23 | "type" : "avored-module",
24 | "require" : {
25 | "php" : ">=7.1.3",
26 | "avored/module-installer" : "1.*"
27 | },
28 | "autoload" : {
29 | "psr-4" : {
30 | "AvoRed\\CashOnDelivery\\" : "src/"
31 | }
32 | },
33 | "homepage" : "https://avored.com",
34 | "support" : {
35 | "email" : "ind.purvesh@gmail.com",
36 | "issues" : "https://avored.com/discussion",
37 | "forum" : "https://avored.com/discussion",
38 | "wiki" : "https://avored.com/docs",
39 | "source" : "https://github.com/avored/banner"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6 | "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",
7 | "watch-poll": "npm run watch -- --watch-poll",
8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --https --key ~/.config/valet/Certificates/laravel-ecommerce.test.key --cert ~/.config/valet/Certificates/laravel-ecommerce.test.crt --config=node_modules/laravel-mix/setup/webpack.config.js",
9 | "prod": "npm run production",
10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 | },
12 | "dependencies": {
13 | "cross-env": "^6.0.0",
14 | "laravel-mix": "^4.1.4",
15 | "vue": "^2.5.17"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/readme.md:
--------------------------------------------------------------------------------
1 | # AvoRed Cash On Delivery Payment Module
2 |
3 | ### Installation
4 |
5 | composer require avored/pickup
6 |
7 | php artisan migrate
8 |
9 | ### How to Use
10 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/register.yml:
--------------------------------------------------------------------------------
1 | name: AvoRed Pickup
2 | identifier: avored-pickup
3 | status: active
4 | description: AvoRed Pickup Module
5 | namespace: AvoRed\Pickup\
6 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/resources/lang/en/pickup.php:
--------------------------------------------------------------------------------
1 | 'Pickup',
5 | 'status-field' => 'Pickup Status'
6 | ];
7 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/resources/views/pickup.blade.php:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/resources/views/system/configuration/pickup.blade.php:
--------------------------------------------------------------------------------
1 | @php
2 | $value = $repository->getValueByCode('a_pickup_status');
3 |
4 | $options = collect();
5 | $options->put('ENABLED', 'Enabled');
6 | $options->put('DISABLED', 'Disabled');
7 |
8 | @endphp
9 |
10 |
16 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/src/Module.php:
--------------------------------------------------------------------------------
1 | registerResources();
20 | $this->registerShippingOption();
21 | $this->registerTab();
22 | }
23 |
24 | /**
25 | * Register any application services.
26 | *
27 | * @return void
28 | */
29 | public function register()
30 | {
31 | //
32 | }
33 |
34 | /**
35 | * Registering AvoRed Pickup Resource
36 | * e.g. Route, View, Database & Translation Path
37 | *
38 | * @return void
39 | */
40 | protected function registerResources()
41 | {
42 | //$this->loadRoutesFrom(__DIR__ . '/../routes/web.php');
43 | $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'avored-pickup');
44 | $this->loadViewsFrom(__DIR__ . '/../resources/views', 'avored-pickup');
45 | }
46 |
47 | /**
48 | * Register Shippiong Option for App.
49 | * @return void
50 | */
51 | protected function registerShippingOption()
52 | {
53 | $shipping = new Pickup();
54 | Shipping::put($shipping);
55 | }
56 |
57 | public function registerTab()
58 | {
59 | // Tab::put('system.configuration', function (TabItem $tab) {
60 | // $tab->key('system.configuration.pickup')
61 | // ->label('avored-pickup::pickup.config-title')
62 | // ->view('avored-pickup::system.configuration.pickup');
63 | // });
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/src/Pickup.php:
--------------------------------------------------------------------------------
1 | identifier;
38 | }
39 |
40 | public function enable()
41 | {
42 | return true;
43 | }
44 |
45 | /**
46 | * Get Title for this Payment Option.
47 | *
48 | * return boolean
49 | */
50 | public function name()
51 | {
52 | return $this->name;
53 | }
54 |
55 | /**
56 | * Payment Option View Path.
57 | *
58 | * return String
59 | */
60 | public function view()
61 | {
62 | return $this->view;
63 | }
64 |
65 | /**
66 | * Payment Option View Data.
67 | *
68 | * return Array
69 | */
70 | public function with()
71 | {
72 | return [];
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/laravel-backend/modules/avored/pickup/webpack.mix.js:
--------------------------------------------------------------------------------
1 | let mix = require('laravel-mix')
2 |
3 | // let publicPath = 'dist'
4 | let publicPath = '../../../public'
5 |
6 | mix.setPublicPath(publicPath)
7 | .js('resources/js/cash-on-delivery.js', 'vendor/avored/js/cash-on-delivery.js')
8 |
--------------------------------------------------------------------------------
/laravel-backend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "vite",
5 | "build": "vite build"
6 | },
7 | "devDependencies": {
8 | "axios": "^1.1.2",
9 | "laravel-vite-plugin": "^0.6.0",
10 | "lodash": "^4.17.19",
11 | "postcss": "^8.1.14",
12 | "vite": "^3.0.0"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/laravel-backend/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | ./tests/Unit
10 |
11 |
12 | ./tests/Feature
13 |
14 |
15 |
16 |
17 | ./app
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/laravel-backend/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | Options -MultiViews -Indexes
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Handle Authorization Header
9 | RewriteCond %{HTTP:Authorization} .
10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
11 |
12 | # Redirect Trailing Slashes If Not A Folder...
13 | RewriteCond %{REQUEST_FILENAME} !-d
14 | RewriteCond %{REQUEST_URI} (.+)/$
15 | RewriteRule ^ %1 [L,R=301]
16 |
17 | # Send Requests To Front Controller...
18 | RewriteCond %{REQUEST_FILENAME} !-d
19 | RewriteCond %{REQUEST_FILENAME} !-f
20 | RewriteRule ^ index.php [L]
21 |
22 |
--------------------------------------------------------------------------------
/laravel-backend/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/public/favicon.ico
--------------------------------------------------------------------------------
/laravel-backend/public/index.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class);
49 |
50 | $response = $kernel->handle(
51 | $request = Request::capture()
52 | )->send();
53 |
54 |
55 | $kernel->terminate($request, $response);
56 |
--------------------------------------------------------------------------------
/laravel-backend/public/mix-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "/vendor/avored/js/app.js": "/vendor/avored/js/app.js",
3 | "/vendor/avored/css/app.css": "/vendor/avored/css/app.css",
4 | "/vendor/avored/images/avored_logo.ico": "/vendor/avored/images/avored_logo.ico",
5 | "/vendor/avored/images/logo_only.svg": "/vendor/avored/images/logo_only.svg"
6 | }
7 |
--------------------------------------------------------------------------------
/laravel-backend/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/laravel-backend/public/vendor/avored/images/avored_logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/public/vendor/avored/images/avored_logo.ico
--------------------------------------------------------------------------------
/laravel-backend/resources/css/app.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/laravel-backend/resources/css/app.css
--------------------------------------------------------------------------------
/laravel-backend/resources/js/app.js:
--------------------------------------------------------------------------------
1 | import './bootstrap';
2 |
--------------------------------------------------------------------------------
/laravel-backend/resources/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | import _ from 'lodash';
2 | window._ = _;
3 |
4 | /**
5 | * We'll load the axios HTTP library which allows us to easily issue requests
6 | * to our Laravel back-end. This library automatically handles sending the
7 | * CSRF token as a header based on the value of the "XSRF" token cookie.
8 | */
9 |
10 | import axios from 'axios';
11 | window.axios = axios;
12 |
13 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
14 |
15 | /**
16 | * Echo exposes an expressive API for subscribing to channels and listening
17 | * for events that are broadcast by Laravel. Echo and event broadcasting
18 | * allows your team to easily build robust real-time web applications.
19 | */
20 |
21 | // import Echo from 'laravel-echo';
22 |
23 | // import Pusher from 'pusher-js';
24 | // window.Pusher = Pusher;
25 |
26 | // window.Echo = new Echo({
27 | // broadcaster: 'pusher',
28 | // key: import.meta.env.VITE_PUSHER_APP_KEY,
29 | // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
30 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
31 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
32 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
33 | // enabledTransports: ['ws', 'wss'],
34 | // });
35 |
--------------------------------------------------------------------------------
/laravel-backend/routes/api.php:
--------------------------------------------------------------------------------
1 | get('/user', function (Request $request) {
18 | return $request->user();
19 | });
20 |
--------------------------------------------------------------------------------
/laravel-backend/routes/channels.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
18 | });
19 |
--------------------------------------------------------------------------------
/laravel-backend/routes/console.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
19 | })->purpose('Display an inspiring quote');
20 |
--------------------------------------------------------------------------------
/laravel-backend/routes/web.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
19 |
20 | return $app;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/laravel-backend/tests/Feature/ExampleTest.php:
--------------------------------------------------------------------------------
1 | get('/');
18 |
19 | $response->assertStatus(200);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/laravel-backend/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | assertTrue(true);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/laravel-backend/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import laravel from 'laravel-vite-plugin';
3 |
4 | export default defineConfig({
5 | plugins: [
6 | laravel({
7 | input: ['resources/css/app.css', 'resources/js/app.js'],
8 | refresh: true,
9 | }),
10 | ],
11 | });
12 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel-ecommerce",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint",
9 | "deploy": "sh deploy.sh"
10 | },
11 | "dependencies": {
12 | "@urql/vue": "^0.6.0",
13 | "core-js": "^3.6.5",
14 | "feather-icons": "^4.28.0",
15 | "graphql": "^15.7.2",
16 | "graphql-tag": "^2.12.6",
17 | "lodash": "^4.17.21",
18 | "vue": "^3.2.20",
19 | "vue-class-component": "^8.0.0-0",
20 | "vue-content-loader": "^2.0.1",
21 | "vue-feather": "^2.0.0-rc.1",
22 | "vue-i18n": "^9.1.9",
23 | "vue-router": "^4.0.0-0",
24 | "vuex": "^4.0.0-0"
25 | },
26 | "devDependencies": {
27 | "@tailwindcss/postcss7-compat": "^2.2.17",
28 | "@types/lodash": "^4.14.176",
29 | "@typescript-eslint/eslint-plugin": "^4.18.0",
30 | "@typescript-eslint/parser": "^4.18.0",
31 | "@vue/cli-plugin-babel": "~5.0.8",
32 | "@vue/cli-plugin-eslint": "~5.0.8",
33 | "@vue/cli-plugin-router": "~5.0.8",
34 | "@vue/cli-plugin-typescript": "~5.0.8",
35 | "@vue/cli-plugin-vuex": "~5.0.8",
36 | "@vue/cli-service": "~5.0.8",
37 | "@vue/compiler-sfc": "^3.0.0",
38 | "@vue/eslint-config-typescript": "^7.0.0",
39 | "cssnano": "^5.1.13",
40 | "eslint": "^6.7.2",
41 | "eslint-plugin-vue": "^7.0.0",
42 | "typescript": "^4.5.5"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | '@tailwindcss/postcss7-compat': {},
4 | autoprefixer: {},
5 | cssnano: {}
6 | },
7 | }
--------------------------------------------------------------------------------
/public/avored_logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/public/avored_logo.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/react-frontend/.env.example:
--------------------------------------------------------------------------------
1 | REACT_APP_GRAPHQL_URL="http://localhost:8000/graphql"
--------------------------------------------------------------------------------
/react-frontend/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | /.fleet
16 | .DS_Store
17 | .env.local
18 | .env.development.local
19 | .env.test.local
20 | .env.production.local
21 |
22 | npm-debug.log*
23 | yarn-debug.log*
24 | yarn-error.log*
25 |
--------------------------------------------------------------------------------
/react-frontend/.graphqlrc.yml:
--------------------------------------------------------------------------------
1 | schema: https://laravel-backend.test/graphql/
2 |
--------------------------------------------------------------------------------
/react-frontend/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app), using the [Redux](https://redux.js.org/) and [Redux Toolkit](https://redux-toolkit.js.org/) TS template.
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `npm start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13 |
14 | The page will reload if you make edits.\
15 | You will also see any lint errors in the console.
16 |
17 | ### `npm test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `npm run build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `npm run eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35 |
36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39 |
40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
--------------------------------------------------------------------------------
/react-frontend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "my-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@headlessui/react": "^1.7.4",
7 | "@heroicons/react": "^2.0.13",
8 | "@reduxjs/toolkit": "^1.9.0",
9 | "@testing-library/jest-dom": "^5.16.5",
10 | "@testing-library/react": "^13.4.0",
11 | "@testing-library/user-event": "^14.4.3",
12 | "@types/jest": "^27.5.2",
13 | "@types/lodash": "^4.14.190",
14 | "@types/node": "^17.0.45",
15 | "@types/react": "^18.0.25",
16 | "@types/react-dom": "^18.0.8",
17 | "@types/react-router-dom": "^5.3.3",
18 | "@urql/exchange-multipart-fetch": "^1.0.1",
19 | "graphql": "^16.8.1",
20 | "lodash": "^4.17.21",
21 | "react": "^18.2.0",
22 | "react-dom": "^18.2.0",
23 | "react-intl": "^6.2.5",
24 | "react-redux": "^8.0.5",
25 | "react-router-dom": "^6.4.3",
26 | "react-scripts": "5.0.1",
27 | "urql": "^3.0.3",
28 | "web-vitals": "^2.1.4"
29 | },
30 | "scripts": {
31 | "start": "react-scripts start",
32 | "build": "react-scripts build",
33 | "test": "react-scripts test",
34 | "eject": "react-scripts eject",
35 | "codegen": "graphql-codegen"
36 | },
37 | "eslintConfig": {
38 | "extends": [
39 | "react-app",
40 | "react-app/jest"
41 | ]
42 | },
43 | "browserslist": {
44 | "production": [
45 | ">0.2%",
46 | "not dead",
47 | "not op_mini all"
48 | ],
49 | "development": [
50 | "last 1 chrome version",
51 | "last 1 firefox version",
52 | "last 1 safari version"
53 | ]
54 | },
55 | "devDependencies": {
56 | "@graphql-codegen/cli": "^2.13.12",
57 | "@graphql-codegen/client-preset": "^1.1.3",
58 | "@graphql-codegen/typescript-urql": "^3.7.3",
59 | "@tailwindcss/forms": "^0.5.3",
60 | "@types/query-string": "^6.3.0",
61 | "autoprefixer": "^10.4.13",
62 | "graphql.macro": "^1.4.2",
63 | "jest": "^27.5.1",
64 | "postcss": "^8.4.19",
65 | "tailwindcss": "^3.2.4",
66 | "typescript": "^4.8.4"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/react-frontend/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/react-frontend/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/react-frontend/public/favicon.ico
--------------------------------------------------------------------------------
/react-frontend/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | AvoRed a headless ecommerce for Laravel
28 |
29 |
30 |
31 |
32 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/react-frontend/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/react-frontend/public/logo192.png
--------------------------------------------------------------------------------
/react-frontend/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avored/laravel-ecommerce/9e58310553e15273a433c80f96ee1264978593f8/react-frontend/public/logo512.png
--------------------------------------------------------------------------------
/react-frontend/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/react-frontend/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/react-frontend/src/app/hooks.ts:
--------------------------------------------------------------------------------
1 | import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
2 | import type { RootState, AppDispatch } from './store';
3 |
4 | // Use throughout your app instead of plain `useDispatch` and `useSelector`
5 | export const useAppDispatch = () => useDispatch();
6 | export const useAppSelector: TypedUseSelectorHook = useSelector;
7 |
--------------------------------------------------------------------------------
/react-frontend/src/app/store.ts:
--------------------------------------------------------------------------------
1 | import { configureStore, ThunkAction, Action } from '@reduxjs/toolkit';
2 | import counterReducer from '../features/counter/counterSlice';
3 | import userLoginReducer from '../features/userLogin/userLoginSlice';
4 | import cartReducer from '../features/cart/cartSlice';
5 | import checkoutReducer from '../features/checkout/checkoutSlice';
6 | import flashSlice from '../features/flash/flashSlice';
7 |
8 | export const store = configureStore({
9 | reducer: {
10 | counter: counterReducer,
11 | userLogin: userLoginReducer,
12 | cart: cartReducer,
13 | checkout: checkoutReducer,
14 | flash: flashSlice
15 | },
16 | });
17 |
18 | export type AppDispatch = typeof store.dispatch;
19 | export type RootState = ReturnType;
20 | export type AppThunk = ThunkAction<
21 | ReturnType,
22 | RootState,
23 | unknown,
24 | Action
25 | >;
26 |
--------------------------------------------------------------------------------
/react-frontend/src/codegen.ts:
--------------------------------------------------------------------------------
1 | import { CodegenConfig } from '@graphql-codegen/cli';
2 |
3 | const config: CodegenConfig = {
4 | schema: 'http://localhost:8000/graphql',
5 | documents: ['src/**/*.tsx'],
6 | ignoreNoDocuments: true, // for better experience with the watcher
7 | generates: {
8 | './src/gql/': {
9 | preset: 'client',
10 | plugins: [],
11 | },
12 | },
13 | };
14 |
15 | export default config;
--------------------------------------------------------------------------------
/react-frontend/src/components/DebugGraphqlErrorMessage.tsx:
--------------------------------------------------------------------------------
1 | import { isEmpty } from 'lodash'
2 | import React from 'react'
3 |
4 |
5 | interface DebugGraphqlErrorMessageProps {
6 | message: string
7 | }
8 |
9 |
10 | export const DebugGraphqlErrorMessage = (props: DebugGraphqlErrorMessageProps) => {
11 | return(
12 | <>
13 | {(!isEmpty(props.message)) ?
14 | (
15 |