mstdmstd

mstdmstd

Member Since 2 Years Ago

Experience Points 11,360
Experience Level 3

3,640 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 2
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

12 Jul
5 days ago

mstdmstd started a new conversation How To Run App With Puppeteer On Remote Server

Hello,

In my laravel 5.8 app I managed to generate file with spatie/browsershot and download it ok, but to run it locally at my Ubuntu 18 I had ro run

    npm i [email protected]

as I got error :

    Error Output: ================ module.js:549 throw err; ^ Error: Cannot find module 'puppeteer' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load 

This decision I found at https://github.com/GoogleChrome/puppeteer/issues/2119 branch.

But after I installed the app at my server I got error :

    The command "PATH=$PATH:/usr/local/bin NODE_PATH=`npm root -g` node '/var/www/html/votes/vendor/spatie/browsershot/src/../bin/browser.js' '{"url":"file:\/\/\/tmp\/0046339001562826751\/index.html","action":"pdf","options":{"path":"generate_profile_card_ohTcbPxIiVNo5CUp8nIDJHbO8mKU2MhwCq4UFIbB_filename.pdf","args":[],"viewport":{"width":800,"height":600},"displayHeaderFooter":false,"printBackground":true}}'" failed. Exit Code: 1(General error) Working directory: /var/www/html/votes/public Output: ================ Error Output: ================ module.js:549 throw err; ^ Error: Cannot find module 'puppeteer' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object.<anonymous> (/var/www/html/votes/vendor/spatie/browsershot/bin/browser.js:1:81) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3)

Installing laravel app on server I need to run

    composer install 

But not

    npm install

Yes ?

But I have to include /public/js/app.js file in /layouts/frontend.blade.php of my template. I suppose that puppeteer must be in this file?

my composer.json :


    {
        "name": "laravel/laravel",
        "description": "The Laravel Framework.",
        "keywords": ["framework", "laravel"],
        "license": "MIT",
        "type": "project",
        "require": {
            "php": "^7.1.3",
            "alaouy/youtube": "^2.2",
            "aloha/twilio": "^4.0",
            "arrilot/laravel-widgets": "^3.12",
            "cviebrock/eloquent-sluggable": "^4.5",
            "davejamesmiller/laravel-breadcrumbs": "5.x",
            "doctrine/dbal": "^2.8",
            "elasticquent/elasticquent": "dev-master",
            "facebook/graph-sdk": "^5.7",
            "fideloper/proxy": "^4.0",
            "google/apiclient": "^2.2",
            "intervention/image": "^2.4",
            "itsgoingd/clockwork": "^3.0",
            "jrean/laravel-user-verification": "^7.0",
            "laravel/framework": "5.8.*",
            "laravel/socialite": "^3.2",
            "laravel/tinker": "^1.0",
            "laravelium/sitemap": "^3.1",
            "maatwebsite/excel": "^3.1",
            "mews/captcha": "^2.2",
            "mews/purifier": "^2.1",
            "paypal/rest-api-sdk-php": "*",
            "proengsoft/laravel-jsvalidation": ">2.2.0",
            "s-ichikawa/laravel-sendgrid-driver": "~2.0",
            "snowfire/beautymail": "dev-master",
            "socialiteproviders/instagram": "^3.0",
            "spatie/browsershot": "^3.27",
            "spatie/laravel-activitylog": "^3.1",
            "spatie/laravel-backup": "^6.1",
            "spatie/laravel-feed": "^2.1",
            "spatie/laravel-image-optimizer": "^1.4",
            "spatie/laravel-newsletter": "^4.2",
            "spatie/laravel-sitemap": "^5.3",
            "spatie/laravel-tags": "^2.1",
            "spipu/html2pdf": "^5.2",
            "symfony/psr-http-message-bridge": "^1.2",
            "themsaid/laravel-mail-preview": "^2.0",
            "unisharp/laravel-filemanager": "^1.9",
            "wboyz/laravel-enum": "^0.2.1",
            "willvincent/feeds": "1.1.*",
            "yajra/laravel-datatables-oracle": "^9.0.0",
            "zendframework/zend-diactoros": "^2.1"
        },
        "require-dev": {
            "barryvdh/laravel-debugbar": "^3.1",
            "filp/whoops": "^2.0",
            "fzaninotto/faker": "^1.4",
            "mockery/mockery": "^1.0",
            "nunomaduro/collision": "^2.0",
            "orangehill/iseed": "^2.6",
            "phpunit/phpunit": "^7.0",
            "xethron/migrations-generator": "^2.0"
        },
        "autoload": {
            "classmap": [
                "database/seeds",
                "database/factories"
            ],
            "psr-4": {
                "App\": "app/"
            }
        },
        "autoload-dev": {
            "psr-4": {
                "Tests\": "tests/"
            }
        },
        "extra": {
            "laravel": {
                "dont-discover": [
                ]
            }
        },
        "scripts": {
            "post-root-package-install": [
                "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
            ],
            "post-create-project-cmd": [
                "@php artisan key:generate"
            ],
            "post-autoload-dump": [
                "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
                "@php artisan package:discover"
            ],
    
    
            "post-update-cmd": [
                "php artisan vendor:publish --provider=\"Proengsoft\JsValidation\JsValidationServiceProvider\" --tag=public --force"
            ]
    
        },
        "config": {
            "preferred-install": "dist",
            "sort-packages": true,
            "optimize-autoloader": true
        },
        "minimum-stability": "dev",
        "prefer-stable": true
    }

package.json:


    {
        "private": true,
        "scripts": {
            "dev": "npm run development",
            "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
            "watch": "npm run development -- --watch",
            "watch-poll": "npm run watch -- --watch-poll",
            "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
            "prod": "npm run production",
            "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
        },
        "devDependencies": {
            "axios": "^0.19.0",
            "bootstrap": "^4.3.1",
            "cross-env": "^5.1",
            "laravel-mix": "^4.0.16",
            "lodash": "^4.17.11",
            "popper.js": "^1.14.6",
            "vue": "^2.5.7"
        },
        "dependencies": {
            "bootstrap-colorpicker": "^3.1.2",
            "datatables.net-bs": "^1.10.19",
            "font-awesome": "^4.7.0",
            "jquery": "^3.4.1",
            "jquery-confirm": "^3.3.2",
            "laravel-echo": "^1.5.2",
            "mustache": "^2.3.0",
            "node-sass": "^4.12.0",
            "resolve-url-loader": "^2.3.1",
            "sass-loader": "^7.1.0",
            "vue-template-compiler": "^2.6.10"
        }
    }

How to fix this error on server(ubuntu 18 inder Digital Ocean) ?

Thanks!

09 Jul
1 week ago

mstdmstd left a reply on How To Use Vars In *.vue Files From _variables.scss ?

Thank you, I read this, but I wander what in laravel app is already installed from this article and what must be done? I am not inside of Laravel 5/vuejs 2. Which steps have I to take next ?

mstdmstd started a new conversation How To Use Vars In *.vue Files From _variables.scss ?

Hello!

In my Laravel 5/vuejs 2/ vuex app I use vars in resources/sass/_variables.scss file, like $text-color: #636b6f; which can be used in all

resources/sass/*.scss

files ok, but I can not use them in resources/js/components/*.vue file, like

<style scoped>
    .element {
        color: $text-color;
    }

</style>

I have no any errors in console but I do not see these vars are applied... If there is a way to use vars in components/*.vue file from resources/sass/_variables.scss ?

Thanks!

06 Jul
1 week ago

mstdmstd left a reply on Many Errors Running Npm Run Watch-poll Command

No Did not help :

$ npm install vue-template-compiler --dev
npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
added 2 packages from 1 contributor and audited 15462 packages in 8.548s
found 0 vulnerabilities

[email protected]:/mnt/_work_sdb8/wwwroot/lar/votes$ npm run watch -- --watch-poll

> @ watch /mnt/_work_sdb8/wwwroot/lar/votes
> npm run development -- --watch "--watch-poll"


> @ development /mnt/_work_sdb8/wwwroot/lar/votes
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"

        Additional dependencies must be installed. This will only take a moment.
 
        Running: yarn add [email protected]* [email protected] --dev --production=false
 
Usage: yarn [options]

yarn: error: no such option: --dev
/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/cli.js:93
                                throw err;
                                ^

Error: Command failed: yarn add [email protected]* [email protected] --dev --production=false
Usage: yarn [options]

yarn: error: no such option: --dev

    at checkExecSyncError (child_process.js:616:11)
    at Object.execSync (child_process.js:653:13)
    at Dependencies.execute (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Dependencies.js:53:22)
    at dependencies.reject.tap.dependencies (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Dependencies.js:32:22)
    at Array.value (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/helpers.js:24:13)
    at Dependencies.install (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Dependencies.js:31:14)
    at Function.dependencies (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Assert.js:77:40)                                                                                                          
    at concat.filter.tap.dependencies (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/components/ComponentFactory.js:131:24)                                                                           
    at Array.value (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/helpers.js:24:13)                                                                                                                   
    at ComponentFactory.installDependencies (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/components/ComponentFactory.js:130:14)                                                                     
    at Mix.listen (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/components/ComponentFactory.js:55:44)                                                                                                
    at events.(anonymous function).forEach.handler (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Dispatcher.js:34:47)                                                                                
    at Array.forEach (<anonymous>)                                                                                                                                                                                     
    at Dispatcher.fire (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Dispatcher.js:34:28)                                                                                                            
    at Mix.dispatch (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Mix.js:119:25)                                                                                                                     
    at Object.<anonymous> (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/setup/webpack.config.js:19:5)                                                                                                    
    at Module._compile (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at WEBPACK_OPTIONS (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/utils/convert-argv.js:116:13)
    at requireConfig (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/utils/convert-argv.js:118:6)
    at /mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/utils/convert-argv.js:125:17
    at Array.forEach (<anonymous>)
    at module.exports (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/utils/convert-argv.js:123:15)
    at yargs.parse (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/cli.js:71:45)
    at Object.parse (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/node_modules/yargs/yargs.js:567:18)
    at /mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/cli.js:49:8
    at Object.<anonymous> (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/cli.js:365:3)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/serge/.npm/_logs/2019-07-06T10_52_19_466Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `npm run development -- --watch "--watch-poll"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/serge/.npm/_logs/2019-07-06T10_52_19_497Z-debug.log

I see error message :

yarn: error: no such option: --dev
/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/cli.js:93
                                throw err;
                                ^

?

mstdmstd started a new conversation Many Errors Running Npm Run Watch-poll Command

Hello, I tried to remove unused packeges("beyondcode/laravel-websockets": "^1.0" and "pusher/pusher-php-server": "~3.0") from my composer and after that I got error running npm run watch-poll in which I see yarn dependencies :

Actually from the start of the project I use npm , not yarn :

php artisan --version
Laravel Framework 5.8.27

npm -v
6.9.0

$ nodejs -v
v10.15.3

$ composer --version
Composer 1.6.3 2018-01-31 16:28:17

I am not sure what these messages are and how happened that how my app has yarn dependencies. I think I need to remove these yarn dependencies ? How ? Some config files ?

Full error output :

$ npm run watch-poll

> @ watch-poll /mnt/_work_sdb8/wwwroot/lar/votes
> npm run watch -- --watch-poll


> @ watch /mnt/_work_sdb8/wwwroot/lar/votes
> npm run development -- --watch "--watch-poll"


> @ development /mnt/_work_sdb8/wwwroot/lar/votes
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"

        Additional dependencies must be installed. This will only take a moment.
 
        Running: yarn add vue-template-compiler --dev --production=false
 
Usage: yarn [options]

yarn: error: no such option: --dev
/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/cli.js:93
                                throw err;
                                ^

Error: Command failed: yarn add vue-template-compiler --dev --production=false
Usage: yarn [options]

yarn: error: no such option: --dev

    at checkExecSyncError (child_process.js:616:11)
    at Object.execSync (child_process.js:653:13)
    at Dependencies.execute (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Dependencies.js:53:22)
    at dependencies.reject.tap.dependencies (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Dependencies.js:32:22)
    at Array.value (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/helpers.js:24:13)
    at Dependencies.install (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Dependencies.js:31:14)
    at Function.dependencies (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Assert.js:77:40)
    at concat.filter.tap.dependencies (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/components/ComponentFactory.js:131:24)
    at Array.value (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/helpers.js:24:13)
    at ComponentFactory.installDependencies (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/components/ComponentFactory.js:130:14)
    at Mix.listen (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/components/ComponentFactory.js:55:44)
    at events.(anonymous function).forEach.handler (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Dispatcher.js:34:47)
    at Array.forEach (<anonymous>)
    at Dispatcher.fire (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Dispatcher.js:34:28)
    at Mix.dispatch (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/src/Mix.js:119:25)
    at Object.<anonymous> (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/laravel-mix/setup/webpack.config.js:19:5)
    at Module._compile (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at WEBPACK_OPTIONS (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/utils/convert-argv.js:116:13)
    at requireConfig (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/utils/convert-argv.js:118:6)
    at /mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/utils/convert-argv.js:125:17
    at Array.forEach (<anonymous>)
    at module.exports (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/utils/convert-argv.js:123:15)
    at yargs.parse (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/cli.js:71:45)
    at Object.parse (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/node_modules/yargs/yargs.js:567:18)
    at /mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/cli.js:49:8
    at Object.<anonymous> (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/webpack-cli/bin/cli.js:365:3)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/serge/.npm/_logs/2019-07-05T14_34_47_549Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `npm run development -- --watch "--watch-poll"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/serge/.npm/_logs/2019-07-05T14_34_47_571Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch-poll: `npm run watch -- --watch-poll`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch-poll script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/serge/.npm/_logs/2019-07-05T14_34_47_590Z-debug.log

Mentioned files has content :

2019-07-05T14_34_47_549Z-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli   '/usr/bin/npm',
1 verbose cli   'run',
1 verbose cli   'development',
1 verbose cli   '--',
1 verbose cli   '--watch',
1 verbose cli   '--watch-poll' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predevelopment', 'development', 'postdevelopment' ]
5 info lifecycle @~predevelopment: @
6 info lifecycle @~development: @
7 verbose lifecycle @~development: unsafe-perm in lifecycle true
8 verbose lifecycle @~development: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/.bin:/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/.bin:/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/.bin:/home/serge/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/serge/.composer/vendor/bin
9 verbose lifecycle @~development: CWD: /mnt/_work_sdb8/wwwroot/lar/votes
10 silly lifecycle @~development: Args: [ '-c',
10 silly lifecycle   'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"' ]
11 silly lifecycle @~development: Returned: code: 1  signal: null
12 info lifecycle @~development: Failed to exec development script
13 verbose stack Error: @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid @
15 verbose cwd /mnt/_work_sdb8/wwwroot/lar/votes
16 verbose Linux 4.15.0-54-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "development" "--" "--watch" "--watch-poll"
18 verbose node v10.15.3
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"`
22 error Exit status 1
23 error Failed at the @ development script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

2019-07-05T14_34_47_571Z-debug.log :

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli   '/usr/bin/npm',
1 verbose cli   'run',
1 verbose cli   'watch',
1 verbose cli   '--',
1 verbose cli   '--watch-poll' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle @~prewatch: @
6 info lifecycle @~watch: @
7 verbose lifecycle @~watch: unsafe-perm in lifecycle true
8 verbose lifecycle @~watch: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/.bin:/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/.bin:/home/serge/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/serge/.composer/vendor/bin
9 verbose lifecycle @~watch: CWD: /mnt/_work_sdb8/wwwroot/lar/votes
10 silly lifecycle @~watch: Args: [ '-c', 'npm run development -- --watch "--watch-poll"' ]
11 silly lifecycle @~watch: Returned: code: 1  signal: null
12 info lifecycle @~watch: Failed to exec watch script
13 verbose stack Error: @ watch: `npm run development -- --watch "--watch-poll"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid @
15 verbose cwd /mnt/_work_sdb8/wwwroot/lar/votes
16 verbose Linux 4.15.0-54-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "watch" "--" "--watch-poll"
18 verbose node v10.15.3
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ watch: `npm run development -- --watch "--watch-poll"`
22 error Exit status 1
23 error Failed at the @ watch script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

2019-07-05T14_34_47_590Z-debug.log :

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'watch-poll' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prewatch-poll', 'watch-poll', 'postwatch-poll' ]
5 info lifecycle @~prewatch-poll: @
6 info lifecycle @~watch-poll: @
7 verbose lifecycle @~watch-poll: unsafe-perm in lifecycle true
8 verbose lifecycle @~watch-poll: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/.bin:/home/serge/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/serge/.composer/vendor/bin
9 verbose lifecycle @~watch-poll: CWD: /mnt/_work_sdb8/wwwroot/lar/votes
10 silly lifecycle @~watch-poll: Args: [ '-c', 'npm run watch -- --watch-poll' ]
11 silly lifecycle @~watch-poll: Returned: code: 1  signal: null
12 info lifecycle @~watch-poll: Failed to exec watch-poll script
13 verbose stack Error: @ watch-poll: `npm run watch -- --watch-poll`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid @
15 verbose cwd /mnt/_work_sdb8/wwwroot/lar/votes
16 verbose Linux 4.15.0-54-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "watch-poll"
18 verbose node v10.15.3
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ watch-poll: `npm run watch -- --watch-poll`
22 error Exit status 1
23 error Failed at the @ watch-poll script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

My composer.json :

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "alaouy/youtube": "^2.2",
        "aloha/twilio": "^4.0",
        "arrilot/laravel-widgets": "^3.12",
        "cviebrock/eloquent-sluggable": "^4.5",
        "davejamesmiller/laravel-breadcrumbs": "5.x",
        "doctrine/dbal": "^2.8",
        "elasticquent/elasticquent": "dev-master",
        "facebook/graph-sdk": "^5.7",
        "fideloper/proxy": "^4.0",
        "google/apiclient": "^2.2",
        "intervention/image": "^2.4",
        "itsgoingd/clockwork": "^3.0",
        "jrean/laravel-user-verification": "^7.0",
        "laravel/framework": "5.8.*",
        "laravel/socialite": "^3.2",
        "laravel/tinker": "^1.0",
        "laravelium/sitemap": "^3.1",
        "maatwebsite/excel": "^3.1",
        "mews/captcha": "^2.2",
        "mews/purifier": "^2.1",
        "paypal/rest-api-sdk-php": "*",
        "proengsoft/laravel-jsvalidation": ">2.2.0",
        "s-ichikawa/laravel-sendgrid-driver": "~2.0",
        "snowfire/beautymail": "dev-master",
        "socialiteproviders/instagram": "^3.0",
        "spatie/browsershot": "^3.27",
        "spatie/laravel-activitylog": "^3.1",
        "spatie/laravel-backup": "^6.1",
        "spatie/laravel-feed": "^2.1",
        "spatie/laravel-image-optimizer": "^1.4",
        "spatie/laravel-newsletter": "^4.2",
        "spatie/laravel-sitemap": "^5.3",
        "spatie/laravel-tags": "^2.1",
        "spipu/html2pdf": "^5.2",
        "themsaid/laravel-mail-preview": "^2.0",
        "unisharp/laravel-filemanager": "^1.9",
        "wboyz/laravel-enum": "^0.2.1",
        "willvincent/feeds": "1.1.*",
        "yajra/laravel-datatables-oracle": "^9.0.0"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.1",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "orangehill/iseed": "^2.6",
        "phpunit/phpunit": "^7.0",
        "xethron/migrations-generator": "^2.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ],


        "post-update-cmd": [
            "php artisan vendor:publish --provider=\"Proengsoft\JsValidation\JsValidationServiceProvider\" --tag=public --force"
        ]

    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

package.json:

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.19.0",
        "bootstrap": "^4.3.1",
        "cross-env": "^5.1",
        "laravel-mix": "^4.0.16",
        "lodash": "^4.17.11",
        "popper.js": "^1.14.6",
        "vue": "^2.5.7"
    },
    "dependencies": {
        "bootstrap-colorpicker": "^3.1.2",
        "datatables.net-bs": "^1.10.19",
        "font-awesome": "^4.7.0",
        "jquery": "^3.4.1",
        "jquery-confirm": "^3.3.2",
        "laravel-echo": "^1.5.2",
        "mustache": "^2.3.0",
        "node-sass": "^4.12.0",
        "pusher-js": "^4.3.1"
    }
}

Also I commented all pusher vars in .env file. I do not know is this error related to cleraring of packeges ? Why error and how to fix it?

Thanks!

05 Jul
1 week ago

mstdmstd left a reply on There Are No Automatic Redirection With Paypal/rest-api-sdk-php

I remade in proposed way and strange thing I remade in proposed way :

                                    payment: function(data, actions) {
                                        var payment = actions.payment.create({

                                            "note_to_payer": "Contact us for any questions on your order.",

                                            "intent": "sale",
                                            "payer": {
                                                "payment_method": "paypal"
                                            },

                                            redirect_urls : { //redirect_urls
                                                return_url : 'https://www.votes.nilov-sergey-demo-apps.tk/paypal_payment',
                                                cancel_url : 'https://www.votes.nilov-sergey-demo-apps.tk/paypal_payment_cancel'
                                            },
                                            
                                            transactions: [{
                                                amount: {
                                                    total: '0.01',
                                                    currency: 'USD'
                                                }
                                            }]
                                        });

                                        console.log("payment payment::")
                                        console.log(payment);
                                        // alert( "::"+var_dump(-88) )
                                        return payment;
                                        
                                    },

and noteced warnings :

Firefox can’t establish a connection to the server at wss://www.votes.nilov-sergey-demo-apps.tk/app/123?protocol=7&client=js&version=4.3.1&flash=false. app.js:1767:16
The connection to wss://www.votes.nilov-sergey-demo-apps.tk/app/123?protocol=7&client=js&version=4.3.1&flash=false was interrupted while the page was loading.

printscreen with console payment output and and error messages looks like : https://imgur.com/a/znKtMGw

What raised these errors ?

mstdmstd left a reply on There Are No Automatic Redirection With Paypal/rest-api-sdk-php

I do not see a difference. You created a var and cionsole it and returned it in method. In my case object returns an object:

                               payment: function(data, actions) {
                                    return actions.payment.create({

                                        "note_to_payer": "Contact us for any questions on your order.",

                                        "intent": "sale",
                                        "payer": {

Has it difference ?

mstdmstd started a new conversation There Are No Automatic Redirection With Paypal/rest-api-sdk-php

Hello, Implementing paypal in my laravel 5.8 app and looking at the code snippet : https://developer.paypal.com/docs/archive/checkout/integrate/?mark=get%20the%20code#set-up-your-development-environment

I do not seer which is returns valid format?

here https://developer.paypal.com/docs/integration/direct/payments/paypal-payments/#create-paypal-payment I found that redirect_urls must be used , so my button definition is :

                        <script>
                            paypal.Button.render({
                                // Configure environment
                                env: 'sandbox',
                                client: {
                                    sandbox: 'CLIENTID',
                                    production: 'demo_production_client_id'
                                },
                                // Customize button (optional)
                                locale: 'en_US',
                                style: {
                                    size: 'small',
                                    color: 'blue',
                                    shape: 'pill',
                                },

                                commit: true,

                                payment: function(data, actions) {
                                    return actions.payment.create({

                                        "note_to_payer": "Contact us for any questions on your order.",

                                        "intent": "sale",
                                        "payer": {
                                            "payment_method": "paypal"
                                        },

                                        redirect_urls : { //redirect_urls
                                            return_url : 'https://www.votes.nilov-sergey-demo-apps.tk/paypal_payment',
                                            cancel_url : 'https://www.votes.nilov-sergey-demo-apps.tk/paypal_payment_cancel'
                                        },
                                        
                                        transactions: [{
                                            amount: {
                                                total: '0.01',
                                                currency: 'USD'
                                            }
                                        }]
                                    });
                                },
                                // Execute the payment
                                onAuthorize: function(data, actions) {
                                    console.log("onAuthorize data::")
                                    console.log( data )

                                    console.log("onAuthorize actions::")
                                    console.log( actions )

                                    return actions.payment.execute().then(function() {
                                        // Show a confirmation message to the buyer

                                        window.alert('Thank you for your purchase! 0');
                                    });
                                }
                            }, '#paypal-button');

                        </script>

I see alert in actions.payment.execute method, but no automatic rederection at url specified in return_url, as I expected. I uploaded my site live at https://www.votes.nilov-sergey-demo-apps.tk under LAMP, Ubuntu 18 , Digital Ocean. Why there are no automatic redirection ?

    $ php artisan --version
    Laravel Framework 5.8.24
In composer.json:
    "paypal/rest-api-sdk-php": "*",

Thanks!

03 Jul
2 weeks ago

mstdmstd left a reply on How To Save On Disk File Generated With Spatie/browsershot

I tried to make as :

            $save_to_file = storage_path( 'generate_profile_card_' . Session::getId() . '/' . $filename_to_save );
            // it has value /mnt/_work_sdb8/wwwroot/lar/votes/storage/generate_profile_card/5/filename.pdf

            Browsershot::html(htmlspecialchars_decode($pdf_content))
                ->showBackground()
                ->save($save_to_file);

and got error :

Symfony \ Component \ Process \ Exception \ ProcessFailedException
The command "PATH=$PATH:/usr/local/bin NODE_PATH=`npm root -g` node '/mnt/_work_sdb8/wwwroot/lar/votes/vendor/spatie/browsershot/src/../bin/browser.js' '{"url":"file:\/\/\/tmp\/0712247001562138587\/index.html","action":"pdf","options":{"path":"\/mnt\/_work_sdb8\/wwwroot\/lar\/votes\/storage\/generate_profile_card_Qwr94TQ4MqSagLRDf7jWP0ygk0rpcdbtCBWXz3az\/filename.pdf","args":[],"viewport":{"width":800,"height":600},"displayHeaderFooter":false,"printBackground":true}}'" failed. Exit Code: 1(General error) Working directory: /mnt/_work_sdb8/wwwroot/lar/votes/public Output: ================ Error Output: ================ ┌──────────────────────────────────────────────────────┐ │ npm update check failed │ │ Try running with sudo or get access │ │ to the local update config store via │ │ sudo chown -R $USER:$(id -gn $USER) /var/www/.config │ └──────────────────────────────────────────────────────┘ { Error: ENOENT: no such file or directory, open '/mnt/_work_sdb8/wwwroot/lar/votes/storage/generate_profile_card_Qwr94TQ4MqSagLRDf7jWP0ygk0rpcdbtCBWXz3az/filename.pdf' -- ASYNC -- at Page.<anonymous> (/mnt/_work_sdb8/wwwroot/lar/votes/node_modules/puppeteer/lib/helper.js:110:27) at getOutput (/mnt/_work_sdb8/wwwroot/lar/votes/vendor/spatie/browsershot/bin/browser.js:26:40) at callChrome (/mnt/_work_sdb8/wwwroot/lar/votes/vendor/spatie/browsershot/bin/browser.js:148:24) at process._tickCallback (internal/process/next_tick.js:68:7) errno: -2, code: 'ENOENT', syscall: 'open', path: '/mnt/_work_sdb8/wwwroot/lar/votes/storage/generate_profile_card_Qwr94TQ4MqSagLRDf7jWP0ygk0rpcdbtCBWXz3az/filename.pdf' }

/mnt/_work_sdb8/wwwroot/lar/votes/ - root of the app OR
/_wwwroot/lar/votes                - with linked path 

I tried to run a command in error message above:

$ sudo chown -R $USER:$(id -gn $USER) /var/www/.config
chown: cannot access '/var/www/.config': No such file or directory

?

02 Jul
2 weeks ago

mstdmstd started a new conversation How To Save On Disk File Generated With Spatie/browsershot

Hello, In my laravel 5.8/blade/jQuery v3.3.1 app with https://github.com/spatie/browsershot plugin I managed in my kubuntu 18 to upload my file with path

     $save_to_file= '/home/username/Downloads/file.pdf';
     Browsershot::html(htmlspecialchars_decode($pdf_content))
         ->showBackground()
         ->save($save_to_file);

But to run it without error I had to run in my console :

    sudo chmod -R 777 /home/username/Downloads/

otherwize I got error access permission

  1. I wonder if there is a way to escape this error on client's OS, as I can not run
    sudo chmod -R 777 /home/username/Downloads/

on client's site. I search OS independently decision

  1. Can you advice some Javascript/Jquery script to open "SaveAs" dialog for choosing of saving location? And maybe somehow to check if app has not write access to info user?

Thanks!

01 Jul
2 weeks ago

mstdmstd left a reply on Integration To Paypal At Local Server

I fixed this error with setting redirect_urls property:

                                    payment: function(data, actions) {
                                        return actions.payment.create({

                                            "intent": "sale",
                                            "payer": {
                                                "payment_method": "paypal"
                                            },

                                            redirect_urls : {
                                                return_url : 'http://local-votes.com/paypal_payment',
                                                cancel_url : 'http://local-votes.com/paypal_payment_cancel'
                                            },
                                            
                                            transactions: [{
                                                amount: {
                                                    total: '0.01',
                                                    currency: 'USD'
                                                }
                                            }]
                                        });
                                    },
                                    // Execute the payment
                                    onAuthorize: function(data, actions) {
                                            window.alert('Thank you for your purchase! 0');
                                        });
                                    }

I see alert message in onAuthorize function, but I have no any redirection set in return_url or in cancel_url.

  1. I uploaded my changes on remote server ( hosting with https under LAMP/Ubuntu 18 on Digital Ocean ) and replaced redirect_urls to this
  2. remote hosting and still no redirection. Which is valid way ?
30 Jun
2 weeks ago

mstdmstd started a new conversation Integration To Paypal At Local Server

Hello! In laravel 5.8 app I make integration to paypal with paypal/rest-api-sdk-php and I make as :

// Set up a payment
 payment: function(data, actions) {
     return actions.payment.create({

         return_urls : {
             return_url : 'http://local-votes.com/paypal_payment'
         },
                             
         transactions: [{
             amount: {
                 total: '0.01',
                 currency: 'USD'
             }
         }]
     });
 },
 // Execute the payment

if return_urls is uncomment I got error in console :

VM19:1 POST https://www.sandbox.paypal.com/v1/payments/payment 400 (Bad Request)
(anonymous) @ VM19:1
(anonymous) @ http.js:147
ZalgoPromise @ promise.js:41
request @ http.js:48
(anonymous) @ rest.js:243
_loop @ promise.js:162
_proto.dispatch @ promise.js:153
_proto.then @ promise.js:242
(anonymous) @ rest.js:225
_loop @ promise.js:162
_proto.dispatch @ promise.js:153
_proto.then @ promise.js:242
(anonymous) @ rest.js:217
_loop @ promise.js:162
_proto.dispatch @ promise.js:153
_proto.resolve @ promise.js:96
_loop @ promise.js:213
_proto.dispatch @ promise.js:153
_proto.resolve @ promise.js:96
(anonymous) @ promise.js:43
(anonymous) @ http.js:117
load (async)
(anonymous) @ http.js:78
ZalgoPromise @ promise.js:41
request @ http.js:48
Object.time @ rest.js:37
(anonymous) @ util.js:54
createPayment @ rest.js:209
(anonymous) @ serialize.js:34
ZalgoPromise.try @ promise.js:401
(anonymous) @ serialize.js:33
(anonymous) @ types.js:68
ZalgoPromise.try @ promise.js:401
_RECEIVE_MESSAGE_TYPE.(anonymous function) @ types.js:56
receiveMessage @ index.js:114
messageListener @ index.js:140
serialize.js:175 Uncaught Error: Error: Request to post https://www.sandbox.paypal.com/v1/payments/payment failed with 400 error. Correlation id: 987ea0c89740a, 987ea0c89740a

{
    "name": "MALFORMED_REQUEST",
    "message": "Incoming JSON request does not map to API request",
    "information_link": "https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST",
    "debug_id": "987ea0c89740a"
}

    at XMLHttpRequest.<anonymous> (http.js:114)
    at Object._RECEIVE_MESSAGE_TYPE.(anonymous function) [as postrobot_message_response] (https://www.paypalobjects.com/api/checkout.js:4206:27)
    at receiveMessage (index.js:114)
    at messageListener (index.js:140)
    at Object._RECEIVE_MESSAGE_TYPE.(anonymous function) [as postrobot_message_response] (https://www.paypalobjects.com/api/checkout.js:4206:27)
    at receiveMessage (index.js:114)
    at messageListener (index.js:140)
    at serialize.js:175
    at serialize.js:212
    at util.js:140
    at util.js:102
    at util.js:116
    at replaceObject (util.js:138)
    at util.js:147
    at util.js:109
    at util.js:118
    at replaceObject (util.js:138)

where http://local-votes.com is my local host LAMP/Ubuntu 18

if to comment return_urls payment works ok but I do not have payment retun action. If there is a way to work with it locally. Lookung at some example code, looks like that is possible...

Thanks!

29 Jun
2 weeks ago

mstdmstd left a reply on In Laravel 5 Problem With Checking/reading Uploaded File

sure , I run in console command :

php artisan storage:link

but what I missed how correctly got valid file path and url ? I dislike using string literals /app/, as I want to be independant from app directoriesa modified...

mstdmstd started a new conversation In Laravel 5 Problem With Checking/reading Uploaded File

Hello! In laravel 5.7 app uploading file under storage

   // $dest_image = "/page-contents/-page-content-1/1.png"
    Storage::disk('local')->put($dest_image, File::get($page_content_file_path));

file is uploaded as

myapp/storage/app/page-contents/-page-content-1/1.png

Reading file I want to check if file exists and read it with all its props( size, width, height, system full path)

        //$file_full_path= ‘page-contents/-page-content-1/1.png’
        $file_exists    = ( !empty($image) and Storage::disk('local')->exists( $file_full_path) );

I got false, but file really exists

  1. I can check as :
        $file_exists    = ( !empty($image) and Storage::disk('local')->exists('public/' . $file_full_path) );

if shows true if file exists, but I am not sure if it a valid way ?

  1. Reading full fiel path
         $image_full_path = storage_path( $image_path);

I got string myapp/storage/page-contents/-page-content-1/1.png, but it is without /app/ as it was stored

I have all storage options default.

Which is valid way ?

26 Jun
3 weeks ago

mstdmstd left a reply on How To Make Working Properly MetisMenu In Vue App

Sorry, I still search for decision, any idea why I failed to run properly MetisMenu in vuejs app? Who did such way ? MetisMenu is very popular ...

25 Jun
3 weeks ago

mstdmstd started a new conversation How To Make Working Properly MetisMenu In Vue App

Hello, I want to use SB Admin 2 template from https://github.com/dpwilhelmsen/sb-admin-2-bootstrap-4

In my Laravel 5.7 / Vuejs 2.6 / Vuex 3.1/ Bootstrap 4.3 app and I take some steps for it :

As it is based in metismenu In console I run next commands :

npm install --save metismenu
npm i popper

npm audit fix

In resources/js/app.js I included metismenu:

require('./bootstrap');


//require('popper');
/* If to uncomment line above in console I got lot of errors :
 WARNING in ./node_modules/popper/index.js 235:35-58
Critical dependency: the request of a dependency is an expression
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js ./resources/sass/sb2/app.scss ./resources/sass/sb2/sb-admin-2.scss
 */

require('metismenu');

require('jquery');

window.Vue = require('vue');
...

In resources/js/helpers/commonFuncs.js which is used in all vue pages I init menu at method :

export function checkAuthorization(store, router) {


    router.beforeEach((to, from, next) => {
        jQueryInit();

        next();


    ...
    
    function jQueryInit() {
    // alert( "jQueryInit"+(-55) )

    $(function () {
        // alert( "INSIDE::"+var_dump(-11) )
        $('#side-menu').metisMenu();
        console.log("Inside $('#side-menu')::")
        console.log($('#side-menu'))

    });

//Loads the correct sidebar on window load,
//collapses the sidebar on window resize.
// Sets the min-height of #page-wrapper to window size
    $(function () {
        var setupPage = function () {
            var topOffset = 50;

            console.log("++1 typeof window::")
            console.log(typeof window)
            console.log(window)

            var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
            if (width < 768) {
                $('div.navbar-collapse').removeClass('show');
                topOffset = 100; // 2-row-menu
            } else {
                $('div.navbar-collapse').addClass('show');
            }

            console.log("++2 typeof window::")
            console.log(typeof window)
            console.log(window)
            var height = ((window.innerHeight > 0) ? window.innerHeight : screen.height) - 1;
            height = height - topOffset;
            if (height < 1) height = 1;
            if (height > topOffset) {
                $("#page-wrapper").css("min-height", (height) + "px");
            }

        };
        // debugger


        $(window).bind("load resize", setupPage);

        var url = window.location;
        var element = $('ul.nav a').filter(function () {
            return this.href == url;
        }).addClass('active').parent();

        while (true) {
            if (element.is('li')) {
                element = element.parent().addClass('in').parent();
            } else {
                break;
            }
        }

        setupPage();
    });
    alert( "AFTER jQueryInit"+(-55) )
}

looking at console I do not see any JS errors and it looks that window is proper JS object.

I suppose that is best place for init of metismenu.

I did not attache any metisMenu.js / css files manually sopposing that command asbove

require('metismenu');

made it.

But layout of my page is broken. You can look at it live at http://hostels-tours.nilov-sergey-demo-apps.tk/admin/dashboard Please, pay attention at console output : https://imgur.com/a/xZ0EVNg

I added style definition :

#wrapper {
  width: 100%;
  background-color: yellow;
  border: 2px dotted red;
}

to be sure that styling in resources/sass/sb2/sb-admin-2.scss are applied. What is wrong and is it possible to work in vue app metisMenu.js ?

Thanks!

19 Jun
4 weeks ago

mstdmstd left a reply on I Search Sb-admin-2-bootstrap-4 With Vuejs

I saw this resource and communicated with support of it. I got answer :

Hello, currently there are no packages that include both Vuejs and Laravel, so there is also no documentation > regarding both technologies implemented together.

I asked here https://laracasts.com/discuss/channels/vue/how-to-install-vue-argon-design-system-template-into-my-laravel-57-app how to install vue non laravel template, but that seems too complicated. Did anybody make this?

Are there some other templates ?

mstdmstd started a new conversation I Search Sb-admin-2-bootstrap-4 With Vuejs

Hello, Some time ago I used https://github.com/dpwilhelmsen/sb-admin-2-bootstrap-4 template, which seemed to very good. Does it has vuejs(>=2.5) version ?

or something similar with vuejs?

Thanks!

18 Jun
4 weeks ago

mstdmstd left a reply on Downloaded Csv File With Maatwebsite/excel Has No Content

I tried to import vuecsv in my *.vue file and after installing of vuecsv.min.js I have /node_modules/vuecsv/dist/vuecsv.min.js file and in my vue file I tried to make like :

<script>

    import {bus} from '../../../../app';
    import appMixin from '../../../../appMixin';

    //import
    import VueCSV from '/vuecsv/dist/vuecsv.min.js';    // /node_modules/vuecsv/dist/vuecsv.min.js
    Vue.use(VueCSV);

    Vue.component("csv-download" , VueCSV.CsvDownload )

but in console I see error :

ERROR in ./resources/js/components/Horizontal/personal/userLists/list.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Horizontal/personal/userLists/list.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve '/vuecsv/dist/vuecsv.min.js' in '/mnt/_work_sdb8/wwwroot/lar/wiznext/msg-laravel-application/resources/js/components/Horizontal/personal/userLists'
 @ ./resources/js/components/Horizontal/personal/userLists/list.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Horizontal/personal/userLists/list.vue?vue&type=script&lang=js&) 124:0-48 127:8-14 132:30-36
 @ ./resources/js/components/Horizontal/personal/userLists/list.vue?vue&type=script&lang=js&
 @ ./resources/js/components/Horizontal/personal/userLists/list.vue
 @ ./resources/js/routes.js
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js ./resources/sass/Horizontal/app.scss ./resources/sass/Horizontal/style_lg.scss ./resources/sass/Horizontal/style_md.scss ./resources/sass/Horizontal/style_sm.scss ./resources/sass/Horizontal/style_xs_320.scss ./resources/sass/Horizontal/style_xs_480.scss ./resources/sass/Horizontal/style_xs_600.scss

If i modify import line as :

    import VueCSV from 'vuecsv';    // /node_modules/vuecsv/dist/vuecsv.min.js

I see error in npm console :

This dependency was not found:

* Vue in ./node_modules/vuecsv/dist/vuecsv.min.js

To install it, you can run: npm install --save Vue

sure I have vue installed.

Which way is right? Can it be that this plugin is not working at? Can you propose similar ?

17 Jun
1 month ago

mstdmstd left a reply on How To Install Vue-argon-design-system Template Into My Laravel 5.7 App?

Thank you, though that is different template my client selected, I hope to get some usefull info as for its installation But I got error running command :

$ composer require laravel-frontend-presets/argon
Using version ^1.0 for laravel-frontend-presets/argon
./composer.json has been updated
Root package 'laravel-frontend-presets/argon' cannot require itself in its composer.json
Did you accidentally name your root package after an external package?
File composer.json: 
{
    "name": "laravel-frontend-presets/argon",
    "description": "Laravel 5.x Front-end preset for argon",
    "license": "MIT",
    "homepage": "https://github.com/creativetimofficial/argon-dashboard",
    "keywords": ["Laravel", "Preset", "Argon"],
    "require": {
        "laravel/framework": "^5.5",
        "laravel-frontend-presets/argon": "^1.0"
    },
    "autoload": {
        "psr-4": {
            "LaravelFrontendPresets\ArgonPreset\": "src/"
        }
    },
    "extra": {
        "laravel": {
            "providers": [
                "LaravelFrontendPresets\ArgonPreset\ArgonPresetServiceProvider"
            ]
        }
    }
}

How to deal it ?

mstdmstd left a reply on Downloaded Csv File With Maatwebsite/excel Has No Content

I found this https://github.com/ynishi/vuecsv plugin and tried to install it.

$ npm install ynishi/vuecsv

> [email protected] postinstall /mnt/_work_sdb8/wwwroot/lar/wiznext/msg-laravel-application/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> [email protected] postinstall /mnt/_work_sdb8/wwwroot/lar/wiznext/msg-laravel-application/node_modules/bootstrap-vue
> opencollective postinstall || exit 0


                                                                                          Thanks for installing bootstrap-vue 
                                                                                     Please consider donating to our open collective
                                                                                            to help us maintain this package.

                                                                                               Number of contributors: 227
                                                                                                  Number of backers: 31
                                                                                                   Annual budget: 4                                                                                                 
                                                                                                 Current balance: ,190                                                                                               
                                                                                                                                                                                                                       
                                                                             Donate: https://opencollective.com/bootstrap-vue/donate                                                                                   
                                                                                                                                                                                                                       
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})                                                      
                                                                                                                                                                                                                       
+ [email protected]                                                                                                                                                                                                        
added 44 packages from 32 contributors and audited 17038 packages in 87.476s                                                                                                                                           
found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

The output above was somewhat unusaual, but was it just advirtisement. Next I run :

 npm audit fix
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

up to date in 8.632s
fixed 0 of 1 vulnerability in 17038 scanned packages
  1 vulnerability required manual review and could not be updated

After that package.json :

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.18",
        "bootstrap": "^4.0.0",
        "cross-env": "^5.1",
        "jquery": "^3.4.1",
        "laravel-mix": "^4.0.7",
        "lodash": "^4.17.5",
        "popper.js": "^1.12",
        "resolve-url-loader": "^2.3.1",
        "sass": "^1.15.2",
        "sass-loader": "^7.1.0",
        "vue": "^2.5.17",
        "vue-template-compiler": "^2.6.10"
    },
    "dependencies": {
        "cors": "^2.8.5",
        "remove": "^0.1.5",
        "v-tooltip": "^2.0.2",
        "vee-validate": "^2.2.5",
        "vee-validate-laravel": "^1.1.0",
        "vue-js-modal": "^1.3.31",
        "vue-moment": "^4.0.0",
        "vue-notification": "^1.3.16",
        "vue-router": "^3.0.6",
        "vue-select": "^3.1.0",
        "vue-slider-component": "^3.0.31",
        "vue2-filters": "^0.6.0",
        "vuecsv": "github:ynishi/vuecsv",
        "vuejs-paginate": "^2.1.0",
        "vuex": "^3.1.0"
    }
}

I tried to use this https://jsfiddle.net/ynishif/1ztu8x8q/ fiddle, But I Got error referenced at my file :

app.js?dt=1560770053:2823 Uncaught ReferenceError: VueCSV is not defined
    at Module../node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Horizontal/personal/userLists/list.vue?

in /Horizontal/personal/userLists/list.vue:

<script>
    ... 
    import Vue from 'vue';
    Vue.component("csv-download", VueCSV.CsvDownload)

I am very confused as VueCSV is not defined anywhere, but it works if mentioned fiddle.

What did I miss?

mstdmstd started a new conversation How To Install Vue-argon-design-system Template Into My Laravel 5.7 App?

Hello, In my Laravel 5.7 / Vuejs 2.6 / Vuex 3.1/ Bootstrap 4.3 app I want to use https://demos.creative-tim.com/vue-argon-design-system/ template and in it's docs https://demos.creative-tim.com/vue-argon-design-system/documentation/quick-start.html#quick-start I read :

Argon Kit is built as Vue plugin so you can simply import it and use it.

import Vue from 'vue';
import Argon from '@/plugins/argon-kit'
Vue.use(Argon);

I added such lines in my resources/js/app.js :

import Vue from 'vue';
...
import Argon from '@/plugins/argon-kit'
Vue.use(Argon);

I am not sure which files have I to copy into my project, I tried to copy files from /vue-argon-design-system/src/plugins subdirectory :

/vue-argon-design-system/src/plugins$ ls -la
-rwxrwxrwx 1 root root  415 тра  5 15:11 argon-kit.js
-rwxrwxrwx 1 root root 1182 тра  5 15:11 globalComponents.js
-rwxrwxrwx 1 root root  297 тра  5 15:11 globalDirectives.js

into /resources/js/plugins subdirectory of my project

but npm console command raised error :

This dependency was not found:
* @/plugins/argon-kit in ./resources/js/app.js
To install it, you can run: npm install --save @/plugins/argon-kit
...

ERROR in ./resources/js/app.js
Module not found: Error: Can't resolve '@/plugins/argon-kit' in '/mnt/_work_sdb8/wwwroot/lar/Hostels2/resources/js'
 @ ./resources/js/app.js 12:0-40 13:8-13
 @ multi ./resources/js/app.js ./resources/sass/BS4/app.scss

I tried to install plugin as in message above:

$ npm install --save @/plugins/argon-kit
npm ERR! code ENOLOCAL
npm ERR! Could not install from "@/plugins/argon-kit" as it does not contain a package.json file.
...

Which is valid way to install argon into my app?

Thanks!

mstdmstd left a reply on Downloaded Csv File With Maatwebsite/excel Has No Content

  1. I generate csv file but failed to download it in browser's download method. This way seemed preferable to me. But I can move generated csv file to some directory(say /home/user/ ) and to open it in client's csv app.

  2. How can I with vue js to define name of current user and his download directory (bearing in mind that clients can have different OS)

16 Jun
1 month ago

mstdmstd left a reply on How To Add Nuxt To Existing Laravel/Vuejs/Vuex/axios App ?

I search for information how to use laravel and nuxt JS in 1 apop and I found this article https://dev.to/skyrpex/create-a-spa-with-laravel-and-nuxt--54k I created the app y it and it works ok. I tried to search for more examples based on https://github.com/skyrpex/laravel-nuxt plugin, but failed. How do you think is it good start point for laravel and nuxt JS ? What could be next ?

15 Jun
1 month ago

mstdmstd started a new conversation How To Add Nuxt To Existing Laravel/Vuejs/Vuex/axios App ?

Hello, I have Laravel 5.7 / Vuejs 2.6 / Vuex 3.1/ Bootstrap 4.3 /axios 0.19 SPA app with 6-7 main components on frontend and 5 listing/editors in backend. I want to add more SEO freandly to frontend and found that Nuxt can be used here. But searching for mannuals I see that in most cases nuxt apps are created from the start. Can you please provide some linkto/instructuions which steps have I to take ?

Thanks!

mstdmstd left a reply on Downloaded Csv File With Maatwebsite/excel Has No Content

  1. No, that different. Name of uploaded file must be based on item title, I just tried to exclude invalid chars from file, rendering "aa%a Z$3 & iuy_65 ^"=> "aaa Z3 iuy65 .csv"

  2. Method

\Excel::store( new exportSearchResults($user_list_id), $download_path, 'local' );

works, but file is saved in app/storage/app/home/user/Downloads/itemtitle.csv subdirectory when I set path:

  $download_path= '/home/user/Downloads/'.$filename;

But that is a bit different I need, as I would like to run browsers download method...

14 Jun
1 month ago

mstdmstd left a reply on Downloaded Csv File With Maatwebsite/excel Has No Content

Thanks for your feedback, I searched and found this https://laracasts.com/discuss/channels/laravel/issue-with-laravel-response-download-and-axios-post with sample in last post and I make like :

    public function run_user_list_export_to_csv() 
    {
        $request= request();
        ...
        $filename= $title.'.csv';
        $download_path= $filename;
        $ret= \Excel::download(new exportSearchResults($user_list_id), $download_path);
        \Log::info($ret);
        $headers = ['Content-Type: application/csv','Content-Disposition: attachment; filename={$filename}'];

        return response($download_path, 200,$headers);
    } // public function storerun_user_list_export_to_csv(UserLisRequest $request)

I see in log file output :

[2019-06-14 04:46:23] local.INFO: HTTP/1.0 200 OK
Cache-Control:       public
Content-Disposition: attachment; filename="aaa Z3  iuy65 .csv"
Date:                Fri, 14 Jun 2019 04:46:23 GMT
Last-Modified:       Fri, 14 Jun 2019 04:46:23 GMT

But no file is downloaded. Which is the right way ?

13 Jun
1 month ago

mstdmstd left a reply on Downloaded Csv File With Maatwebsite/excel Has No Content

Thank you,that works in case I run laravel control in GET request, but that is laravel 5.8 / axios "^0.18", "vue": "^2.5.17" app and running request the file is not downloaded at all. I run my request in JS code :

                axios({
                    method: ( 'post' ),
                    url: this.$store.getters.apiUrl + '/personal/run-user-list-export-to-csv',
                    data: { user_id : user_id, user_list_id: user_list_id },
                }).then((response) => {
                    this.showPopupMessage("User list export", "User list successfully exported !", 'success');
                }).catch((error) => {
                    this.showPopupMessage("User list export", 'Error exporting user\'s list !', 'error');
                });

with control :

    public function run_user_list_export_to_csv() // http://127.0.0.1:8000/api/run-user-list-export-to-csv
    {
        $request= request();
        ...
        
        $ret= \Excel::download(new exportSearchResults($user_list_id), 'file.csv');  // if write RETURN this line file is not downloaded anyway...
        return response()->json( ['error_code' => 1, 'message' => '', 'ret' => $ret, HTTP_RESPONSE_INTERNAL_SERVER_ERROR ] );
    } // public function storerun_user_list_export_to_csv(UserLisRequest $request)

I browser's responce I see output :

{"error_code":1,"message":"","ret":{"headers":{}},"0":500}

But file is not downloaded. How correctly?

11 Jun
1 month ago

mstdmstd started a new conversation Downloaded Csv File With Maatwebsite/excel Has No Content

Hello, In laravel 5.8 I installed maatwebsite/excel and in my composer.json :

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "intervention/image": "^2.4",
        "laracasts/utilities": "^3.0",
        "laravel/framework": "5.8.*",
        "laravel/tinker": "^1.0",
        "maatwebsite/excel": "^3.1",
    },
...

But trying to upload data from db convirted to array as :
        $searchResultRows = SearchResult
            ::getByUserList($user_list_id)
            ->get()
            ->toArray();

//        echo '<pre>!!!count($searchResultRows))::'.print_r(count($searchResultRows),true).'</pre>';
//        echo '<pre>$searchResultRows)::'.print_r($searchResultRows,true).'</pre>';
        return \Excel::download( function ($excel) use ($searchResultRows) {
            $excel->sheet('mySheet', function ($sheet) use ($searchResultRows) {
                $sheet->fromArray($searchResultRows);
            });
        }, 'file.csv');

I have file.csv uploade, but it has 3 bytes in syze and content :

""

If to uncomment 2 lines with searchResultRows output I see my valid rows as I expected. What is wrong and how to get valid csv file uploaded?

Thanks!

10 Jun
1 month ago

mstdmstd started a new conversation Why Vee-validate-laravel Does Not Show Error For Email Field?

Hello, In laravel 5.8 / vue2.5 / vuex / axios app I use veeValidate and vee-validate-laravel to show errors from laravel on my form and I have a problems that validation error on non unique email is not rendered properly: I my form :

                            <div class="form-row mb-3">
                                <label class="col-12 col-sm-4 col-form-label" for="email">Email</label>
                                <div class="col-12 col-sm-8">
                                    <input
                                            type="text"
                                            :class="{ 'form-control':true, 'text-danger': vueErrorsList.has('email') }"
                                            id="email"
                                            v-validate="'required|max:255|email'"
                                            v-model="email"
                                            data-vv-name="email"
                                            placeholder="Enter user's email"
                                    >
                                    <span v-show="vueErrorsList.has('email')"
                                          class="text-danger">{{ clearErrorLabel(vueErrorsList.first('email'), '') }}</span>
                                </div>
                            </div>

...

            makeSignUp() {
                this.$store.dispatch('signUp');    // calling action
                signUp(this.$data.form)
                    .then((res) => {
                        this.$store.commit("signUpSuccess", res);  // calling mutation
                        this.$router.push({path: '/login'});
                    })
                    .catch((error) => {
                        console.log("error::")
                        console.log( error )

                        this.$setLaravelValidationErrorsFromResponse(error);
                        // this.$setLaravelValidationErrorsFromResponse(error.response.data);
                        this.$store.commit("signUpFailed", {error});   // calling mutation
                    });

In the error text line content is : The given data was invalid.

and request file I have rules :

    public function rules()
    {
        return [
            'email'             => 'required|email|unique:users|max:255',
            ...
        ];
    }

In browser I see error with email field : https://imgur.com/a/k2gZkpe but this error for email field is not in my vueErrorsList error, as I expected.

Why and how to fix it ?

app.js :

import VeeValidate from 'vee-validate';
import VeeValidateLaravel from 'vee-validate-laravel';

const veeValidateConfigArray = {
    errorBagName: 'vueErrorsList', // change if property conflicts
    fieldsBagName: 'fields',
    delay: 0,
    locale: 'en',
    dictionary: null,
    strict: true,
    classes: false,
    classNames: {
        touched: 'touched', // the control has been blurred
        untouched: 'untouched', // the control hasn't been blurred
        valid: 'valid', // model is valid
        invalid: 'invalid', // model is invalid
        pristine: 'pristine', // control has not been interacted with
        dirty: 'dirty' // control has been interacted with
    },
    events: 'input|blur',
    inject: true,
    validity: false,
    aria: true,
};
Vue.use(VeeValidate, veeValidateConfigArray);
Vue.use(VeeValidateLaravel);

package.json :

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.18",
        "bootstrap": "^4.0.0",
        "cross-env": "^5.1",
        "jquery": "^3.4.1",
        "laravel-mix": "^4.0.7",
        "lodash": "^4.17.5",
        "popper.js": "^1.12",
        "resolve-url-loader": "^2.3.1",
        "sass": "^1.15.2",
        "sass-loader": "^7.1.0",
        "vue": "^2.5.17",
        "vue-template-compiler": "^2.6.10"
    },
    "dependencies": {
        "cors": "^2.8.5",
        "vee-validate": "^2.2.5",
        "vee-validate-laravel": "^1.1.0",
        "vue-js-modal": "^1.3.31",
        "vue-moment": "^4.0.0",
        "vue-notification": "^1.3.16",
        "vue-router": "^3.0.6",
        "vue-select": "^3.1.0",
        "vue-slider-component": "^3.0.31",
        "vue2-filters": "^0.6.0",
        "vuejs-paginate": "^2.1.0",
        "vuex": "^3.1.0"
    }
}

Thanks!

09 Jun
1 month ago

mstdmstd left a reply on About Duplications Of The Event Deleting Item

I found decision at : https://stackoverflow.com/questions/45399302/stop-receiving-events-from-destroyed-child-component

So creating/deleting events like

        created() {
            ...
            bus.$on('onUserListDeleteSuccess', (response) => {
                this.is_page_updating = false
                this.showPopupMessage("User lists", 'User\'s list was successfully deleted!', 'success');
            })

        }, //  created() {

        beforeDestroy(){
            bus.$off( 'onUserListDeleteSuccess' )
        },

works ok for me!

06 Jun
1 month ago

mstdmstd left a reply on Scheduled Tasks In Laravel 5.7 App Triggered At Wrong Time

i modified my app/Console/Kernel.php file as :

    protected $commands = [
        'App\Console\Commands\reportAvailableSpacesByZones'
    ];

    protected function schedule(Schedule $schedule)
    {
        \Log::info( 'report:available-spaces-by-zones Report run # ' . time()  );
        $schedule
            ->command('report:available-spaces-by-zones')
            ->timezone('Asia/Dubai')
            ->daily('7:00');

    }

As as result I got am email at midnight of 'Asia/Dubai' timezone. Looks like my timezone options are ignored and run always at midnight of 'Asia/Dubai' timezone. Any ideas why so and how to fix it ?

  1. I suppose that my schedule uses settings in /cli/php.ini and can not see these settings in browser's phpinfo output.
  2. Is there is a way to check/view settings in /cli/php.ini of my server ?

mstdmstd started a new conversation About Duplications Of The Event Deleting Item

Hello, I asked here https://stackoverflow.com/questions/56096924/i-have-event-duplication-after-action-was-moved-in-store-object about of duplications of the event and the proposed decision seemed good, but after I returned to this question I have the same problems with success message duplications. In my container vue file MainApp.vue I set event handler:

<template>
   <body class="account-body">
   <v-dialog/>

   <MainHeader></MainHeader>
   <div class="content p-0 m-0" style="width: 100% !important; margin: auto !important;">
      <notifications group="wiznext_notification"/>
      <router-view></router-view>
   </div>
   </body>

</template>

<script>

    import {bus} from '../../app';
    import MainHeader from './MainHeader.vue';
    import { deleteFromUserListsKey, runDeleteFromUserLists } from "../../helpers/commonFuncs";

    export default {
        name: 'main-app',
        components: {MainHeader},
        created() {
            // console.log('resources/js/components/Horizontal/MainApp.vue Component created.')
        },
        mounted() {
            console.log('resources/js/components/Horizontal/MainApp.vue Component MOUNTED.')
            bus.$on('dialog_confirmed', (paramsArray) => {
                // alert( "resources/js/components/Horizontal/MainApp.vue dialog_confirmed  paramsArray::"+var_dump(paramsArray) )
                if (paramsArray.key == this.deleteFromUserListsKey(paramsArray.user_list_id)) {
                    this.runDeleteFromUserLists(paramsArray.user_list_id, paramsArray.user_id, paramsArray.index);
                }
            })
        },

        methods: {
            deleteFromUserListsKey, runDeleteFromUserLists
        }

    }

</script>

I call confirmation dialog with click.prevent :

<div class="card-footer">
   <div class="float-right">
      <i :class="'mr-2 '+getHeaderIcon('delete')" @click.prevent="confirmDeleteUserList( nextUserList.id, currentLoggedUser.id,
      nextUserList.title, index );" title="Delete"></i>
   </div>

method from my mixing resources/js/appMixin.js is triggered and if user selects confirm dialog_confirmed event is emitted:

confirmMsg: function (question, paramsArray, title, bus) {
    this.$modal.show('dialog', {
        title: title,
        text: question,
        buttons: [
            {
                title: 'Yes',
                default: true,    // Will be triggered by default if 'Enter' pressed.
                handler: () => {
                    bus.$emit('dialog_confirmed', paramsArray);
                    this.$modal.hide('dialog')
                }
            },
            {
                title: '',       // Button title
                handler: () => {
                } // Button click handler
            },
            {
                title: 'Cancel'
            }
        ]
    })
},

In my store resources/js/store.js OI define method for item deleting and triggering events:

userListDelete(context, paramsArray ) {
    axios({
        method: ( 'delete' ),
        url: this.getters.apiUrl + '/personal/user-lists/' + paramsArray.user_list_id,
    }).then((response) => {
        let L = this.getters.userLists.length
        for (var I = 0; I < L; I++) {
            if (response.data.id == this.getters.userLists[I].id) {
                this.getters.userLists.splice(this.getters.userLists.indexOf(this.getters.userLists[I]), 1)
                context.commit('refreshUserLists', this.getters.userLists);
                break;
            }
        }

        bus.$emit( 'onUserListDeleteSuccess', response );
    }).catch((error) => {
        bus.$emit('onUserListDeleteFailure', error);
    });

}, // userListDelete(context, paramsArray ) { 

In list.vue file from which items are deleted I define popup messages:

mounted() {
    console.log("resources/js/components/Horizontal/personal/userLists.vue Mounted()::")
    bus.$on('onUserListDeleteSuccess', (response) => {
        this.is_page_updating = false
        this.showPopupMessage("User lists", 'User\'s list was successfully deleted!', 'success');
        // bus.$off('onUserListDeleteSuccess')
    })

    bus.$on('onUserListDeleteFailure', (error) => {
        this.is_page_updating = false

        if (error.error_code != 11) {
            this.$setLaravelValidationErrorsFromResponse(error.message);
            this.showRunTimeError(error, this);
            this.showPopupMessage("User lists", 'Error adding user\'s list !', 'error');
        }
        // bus.$off('onUserListDeleteFailure')
    })
    this.is_page_loaded = true
    this.setAppTitle("Personal", 'User\'s lists', bus);
}, // mounted() {

I show messages in mount event of all pages and I see that mount event of MainApp.vue is triggered only once and when other page is opened I see relative message in console. Googling I found bus.$off method, but it does not help me, anyway I have several duplicated messages, especially if I between different pages.

How to fix these duplicated messages?

That could be viewed online http://178.128.145.48/login [email protected] wdemo

http://178.128.145.48/websites-blogs will be opened. Please, try to go to “User's lists” by link at top left menu https://prnt.sc/nq4qiy and back several times. When on “User's lists” page I try to delete 1 user list it is deleted, but I got several messages and url in “network” section of my browser : https://imgur.com/a/4ubFB0g Looks like events are duplicated.

There is “ Add Demo Data” to add more demo rows.

Thanks!

05 Jun
1 month ago

mstdmstd started a new conversation Scheduled Tasks In Laravel 5.7 App Triggered At Wrong Time

Hallo, In laravel 5.7 app I have a problem that scheduled tasks with email sending are recieved at wrong time. in my ubuntu 16 under Digital Ocean Server in crontab with command :

crontab -e

I added line :

* * * * * cd /var/www/html/the-box-booking && php artisan schedule:run >> /dev/null 2>&1

php in browser shows next :

PHP Version 7.1.17-1+ubuntu16.04.1+deb.sury.org+1
...
date
date/time support   enabled
timelib version 2016.05
"Olson" Timezone Database Version   0.system
Timezone Database   internal
Default timezone    Asia/Dubai
Directive   Local Value Master Value

date.default_latitude        31.7667     31.7667
date.default_longitude       35.2333     35.2333
date.sunrise_zenith          90.583333   90.583333
date.sunset_zenith           90.583333   90.583333
date.timezone                Asia/Dubai  Asia/Dubai

I suppose that console command use cli configurations. I check in command line :

 php -v
PHP 7.1.17-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May  5 2018 04:55:21) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.17-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

I open /etc/php/7.1/cli/php.ini and see:

[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = Asia/Dubai Timezone = Asia/Dubai

I set "timezone" of app/config.php :

    'timezone' => 'Asia/Dubai',

In bootstrap/app.php I added line :

date_default_timezone_set('Asia/Dubai');

In app/Console/Kernel.php I added line :

    protected function schedule(Schedule $schedule)
    {
        \Log::info( 'report:available-spaces-by-zones Report run # ' . time()  );
        $schedule->command('report:available-spaces-by-zones')->daily('18:00');
    }

as a result I see a lot of info lines in my logs, but time of report sent if different. Today I recieved it at 21 pm.

I restarted cron, apache and OS.

Where error and how to fix it?

Thanks!

01 Jun
1 month ago

mstdmstd started a new conversation Method HasRole Of Zizaco/entrust Always Returns False

Hello ! In my lasravel 5.7 app using https://github.com/Zizaco/entrust I have problem using hasRole method, as it always returns false, even in db I have valid rows. Calling in control app/Http/Controllers/PersonalController.php wrapped method:

    public function get($id)
    {
        $user            = User::find($id);
        $check_roles_as_text= $user->checkRolesAsText();
    ...

app/User.php :

<?php

namespace App;

use Tymon\JWTAuth\Contracts\JWTSubject;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;

use Illuminate\Auth\Passwords\CanResetPassword;
use Zizaco\Entrust\Traits\EntrustUserTrait;

class User extends Authenticatable implements JWTSubject
{
    use EntrustUserTrait;

    use Notifiable;
    protected $primaryKey = 'id';

   public function checkRolesAsText() {
        $arr= [];
        echo '<pre>$this->id::'.print_r($this->id,true).'</pre>'; // that shows 5 - my logged user
        // dd($this); // If uncomment out put below
        if ( $this->hasRole(ACCESS_ROLE_ADMIN) ) {
            $arr[]= ACCESS_ROLE_ADMIN_LABEL;
            echo '-1';
        }
        if ( $this->hasRole(ACCESS_ROLE_MANAGER) ) {
            $arr[]= ACCESS_ROLE_MANAGER_LABEL;
            echo '-2';
        }
        if ( $this->hasRole(ACCESS_ROLE_CUSTOMER) ) {
            $arr[]= ACCESS_ROLE_CUSTOMER_LABEL;
            echo '-3';
        }
        echo '<pre>$arr::'.print_r($arr,true).'</pre>';
        return $this->concatArray($arr);
    }
}

Checking slq tracement I see that user_id is null :

   SELECT `ad_roles`.*, `ad_role_user`.`user_id`     AS `pivot_user_id`, `ad_role_user`.`role_id`     AS `pivot_role_id` 
    FROM `ad_roles` 
    INNER JOIN `ad_role_user` on `ad_roles`.`id` = `ad_role_user`.`role_id` 
    WHERE `ad_role_user`.`user_id` is null 


   Output of     dd($this):

User {#368 ▼ #primaryKey: "id" #connection: "mysql" #table: "users" #keyType: "int" +incrementing: true #with: [] #withCount: [] #perPage: 15 +exists: true +wasRecentlyCreated: false #attributes: array:19 [▼ "id" => 5 "username" => "Admin" "email" => "[email protected]" "password" => "$2y$10$vxBkNOEteK5GwP/j1VEDiutmR92XVW1ixSEEQ5ZMq6WPY4RkAO97S" "remember_token" => null "status" => "A" "account_type" => "I" "verified" => 1 "verification_token" => null "first_name" => "Red" "last_name" => "Song" "phone" => "247-541-7172" "website" => "[email protected]_vote.site.com" "notes" => null "creator_id" => null "activated_at" => null "avatar" => "5.jpeg" "created_at" => "2018-03-25 12:39:36" "updated_at" => "2018-05-20 19:48:03" ] #original: array:19 [▶] #changes: [] #casts: [] #dates: [] #dateFormat: null #appends: [] #dispatchesEvents: [] #observables: [] #relations: [] #touches: [] +timestamps: true #hidden: [] #visible: [] #fillable: [] #guarded: array:1 [▶] #rememberTokenName: "remember_token"


I do not see why in sql user_id is null  and how to fix it?

Thanks!
29 May
1 month ago

mstdmstd left a reply on How From My Envoy Script To Write App Version To Database?

Thanks for your hints.In command handle I had to use : $arguments = $this->arguments();

28 May
1 month ago

mstdmstd started a new conversation How From My Envoy Script To Write App Version To Database?

Hello, With laravel 5.8 envoy command I deploy my changes and I need from my envoy script to write app version to database

For this I created console command , which is located in app/Console/Commands/envoyWriteAppVersion.php file, but I did not find how to assign additive parameter to my console commad. I tried like :

php artisan envoy:write-app-version  "654"
php artisan envoy:write-app-version  654
php artisan envoy:write-app-version  app_version=7.654

But I got error : Too many arguments, expected arguments "command". This task did not complete successfully on one of your servers

Which is the valid way ?

Thanks!

22 May
1 month ago

mstdmstd left a reply on I Have Event Duplication After Action Was Moved In Store Object

I have a hint that bus.$on inside of mounted block executed each time when page is opened. I suggest I need to move bus event handlers to some other location. app.js/ MainApp.vue ?

As I see in console that I open my page both created and mounted events are triigered.

I have common for all pages resources/js/components/Horizontal/MainApp.vue component. If to move all events under its mount event how to make reference to methods of any page, which I refere with this. ? Which decision could be good and not vey complicated here?

18 May
1 month ago

mstdmstd left a reply on I Have Event Duplication After Action Was Moved In Store Object

I still search for valid decision : I uploaded live demo at : http://178.128.145.48/login [email protected] wdemo

http://178.128.145.48/websites-blogs will be opened. Please, try to go to “User's lists” by link at top left menu https://prnt.sc/nq4qiy and back several times. When on “User's lists” page I try to delete 1 user list it is deleted, but I got several messages and url in “network” section of my browser : https://imgur.com/a/4ubFB0g Looks like events are duplicated. And looks like that is move between pages number of guplications is raised. Why and how to fix it ? I use @click.prevent in triggering the event to show confirm delete message.

There is “ Add Demo Data” to add more demo rows.

16 May
2 months ago

mstdmstd left a reply on In Axios Request I Got Has Been Blocked By CORS Policy Error

I payed attention that with internal request I see token : https://imgur.com/a/nFNwGs2 But in external request I do not see this токена : https://imgur.com/a/7sS7FtN

Could that be the issue?

I tried to add token manually(I check it in alert ):

                alert( "app_url::"+var_dump(this.app_url) + "  this.currentLoggedUser::"+var_dump(this.currentLoggedUser) )
                
                axios.post(window.REMOTE_SEARCH_WEB, {
                    "query": "pc gamers",
                    "blogger": false,
                    "company": false,
                    "influencer": false,
                    "article": false,
                    "pageId": 1,
                    "sort": null,
                    "sortOrder": null,
                    "searchType": 1,
                    "X-XSRF-TOKEN": this.currentLoggedUser.token,

But I do not see the token in external request. Which is the right way ?

15 May
2 months ago

mstdmstd left a reply on In Axios Request I Got Has Been Blocked By CORS Policy Error

I installed https://github.com/barryvdh/laravel-cors package and

  1. in file I added line in app/Http/Kernel.php
protected $middleware = [
    // ...
    \Barryvdh\Cors\HandleCors::class,
];

I added in middleware group I that is is not ‘/api’ internal, but external request. Is it correct?

  1. I left file config/cors.php without changes :
<?php

return [

    'supportsCredentials' => false,
    'allowedOrigins' => ['*'],
    'allowedOriginsPatterns' => [],
    'allowedHeaders' => ['*'],
    'allowedMethods' => ['*'],
    'exposedHeaders' => [],
    'maxAge' => 0,

];
  1. In axios.post request I removed all Access-Control parameters
        axios.post(window.REMOTE_SEARCH_WEB, {
            "query": "pc gamers",
            "blogger": false,
            "company": false,
            "influencer": false,
            "article": false,
            "pageId": 1,
            "sort": null,
            "sortOrder": null,
            "searchType": 1,
        }).then((response) => {
  1. But the same error in request : https://imgur.com/a/wbgmrps

What is wrong ?

14 May
2 months ago

mstdmstd started a new conversation In Axios Request I Got Has Been Blocked By CORS Policy Error

Hello, In laravel 5.8 / "vue": "^2.5.17" / "axios": "^0.18" I need to read external data which are read from postman ok : https://imgur.com/a/SRBmK0P

I try to read these data using axios and got error: https://imgur.com/a/o97xLm7

in browse I see details of the request : https://imgur.com/a/EUkyV43

My JS code:

        axios.post(window.REMOTE_SEARCH_WEB, {
            "query": "pc gamers",
            "blogger": false,
            "company": false,
            "influencer": false,
            "article": false,
            "pageId": 1,
            "sort": null,
            "sortOrder": null,
            "searchType": 1,
            "Access-Control-Allow-Origin": this.app_url,
            "Access-Control-Allow-Methods": "POST",
            "Access-Control-Max-Age": 86400,
            "Access-Control-Allow-Headers": "Content-Type, Authorization",
            'Access-Control-Allow-Credentials': 'true'
        }).then((response) => {

where this.app_url is home url of the site the app run at. Googling I found several parameters Access-Control-* must be filled, like in code above, but that did not help me. Can you say how I to fix it?

  1. can it be that a desicion could be from my js code with axios to run action in my control and from there to make request using php/laravel ? If yes, please provide example of such decision...

Thanks!

mstdmstd left a reply on "continue" Targeting Switch Is Equivalent To "break" Error Under Php 7.3

I found this https://medium.com/andrewmmc-io/upgrade-php-version-to-7-2-from-7-0-c005a0926642 instruction but got error in console :

# apt-get install php7.2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php7.2 is already the newest version (7.2.18-1+ubuntu16.04.1+deb.sury.org+1).

?

mstdmstd left a reply on "continue" Targeting Switch Is Equivalent To "break" Error Under Php 7.3

Running sudo update-alternatives --set php /usr/bin/php7.2 I got in console:

# php -v
PHP 7.2.18-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May  3 2019 09:23:41) ( NTS )

but phpinfo in browser shows :

PHP Version 7.0.33-0ubuntu0.16.04.4

How to refresh it?

13 May
2 months ago

mstdmstd left a reply on "continue" Targeting Switch Is Equivalent To "break" Error Under Php 7.3

I got error :

[email protected]:~# php composer.phar self-update
Could not open input file: composer.phar
[email protected]:~# sudo -H composer self-update

                                         
  [InvalidArgumentException]             
  Command "self-update" is not defined.

Is it valid command ?

mstdmstd left a reply on "continue" Targeting Switch Is Equivalent To "break" Error Under Php 7.3

I have old composer : Composer version @package_branch_alias_version@ (1.0.0-beta2) 2016-03-27 16:00:34 . How to raise it?

mstdmstd started a new conversation "continue" Targeting Switch Is Equivalent To "break" Error Under Php 7.3

Hello, I install laravel 5.8 on new Ubuntu 16 instance under Digital Ocean. I need to install php 7.2 and for this I run commands:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update 
sudo apt-get remove php7.0
sudo apt-get install php7.2

I was very surprosed that I found php 7.3:

# php -v
PHP 7.3.5-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May  3 2019 10:00:05) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.5-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

After that I got error on composer installing:

# composer  install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file

                                                                                           
  [ErrorException]                                                                         
  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?  

Googling I found that it is some specific php7.3 error and I wonder which can be decision here? To downgrade to php7.2(If yes how better to make it?)

Or some other decision ?

Thanks!

12 May
2 months ago

mstdmstd left a reply on I Have Event Duplication After Action Was Moved In Store Object

It seems that my events structure appeared rather complicated, but it seems to me that I followed vuejs common rules. Any ideas how to fix events duplication ? I use @click.prevent=" but that does not help in my case ...

mstdmstd started a new conversation I Have Event Duplication After Action Was Moved In Store Object

Hello, In my laravel 5.8 / vue 2.5.17 / vuex^3.1.0 I have a problem that with dialog opened I have event duplication. I have an event for item deletion :

In my vue file:

    <i :class="'mr-2 '+getHeaderIcon('delete')" @click.prevent="confirmDeleteUserList( nextUserList.id, nextUserList.title, index );"></i>
    ...

        mounted() {

            bus.$on('dialog_confirmed', (paramsArray) => {
                if (paramsArray.key == this.deleteFromUserListsKey(paramsArray.user_list_id)) {
                    this.runDeleteFromUserLists(paramsArray.user_list_id, paramsArray.index);
                }
            })
            bus.$on('onUserListDeleteSuccess', (response) => {
                this.is_page_updating = false
                this.showPopupMessage("User lists", 'User\'s list was successfully deleted!', 'success');
            })

            bus.$on('onUserListDeleteFailure', (error) => {
                this.$setLaravelValidationErrorsFromResponse(error.message);
                this.is_page_updating = false
                this.showRunTimeError(error, this);
                this.showPopupMessage("User lists", 'Error adding user\'s list !', 'error');
            })


        }, // mounted() {

        methods: {
            confirmDeleteUserList(user_list_id, user_list_title, index) {
                this.confirmMsg("Do you want to exclude '" + user_list_title + "' user list ?", {
                    key: this.deleteFromUserListsKey(user_list_id), user_list_id: user_list_id, index: index
                }, 'Confirm', bus);
            }, //confirmDeleteUserList(id, user_list_title, index) {

            deleteFromUserListsKey(user_list_id) {
                return 'user_list__remove_' + user_list_id;
            },

            runDeleteFromUserLists(user_list_id, index) {
                this.$store.dispatch('userListDelete', { logged_user_id : this.currentLoggedUser.id, user_list_id : user_list_id } );
            }, // runDeleteFromUserLists()  {

and in resources/js/store.js :

    state : {
        ...        
        userLists: [],
        ...        
    actions : {


        userListDelete(context, paramsArray ) {
            axios({
                method: ( 'delete' ),
                url: this.getters.apiUrl + '/personal/user-lists/' + paramsArray.user_list_id,
            }).then((response) => {
                let L = this.getters.userLists.length
                for (var I = 0; I < L; I++) {
                    if (response.data.id == this.getters.userLists[I].id) {
                        this.getters.userLists.splice(this.getters.userLists.indexOf(this.getters.userLists[I]), 1)
                        context.commit('refreshUserLists', this.getters.userLists);
                        break;
                    }
                }

                bus.$emit( 'onUserListDeleteSuccess', response );
            }).catch((error) => {
                bus.$emit('onUserListDeleteFailure', error);
            });

        }, // userListDelete(context, paramsArray ) { 

confirmMsg (based on https://github.com/euvl/vue-js-modal )is defined in my mixing :

        confirmMsg: function (question, paramsArray, title, bus) {
            this.$modal.show('dialog', {
                title: title,
                text: question,
                buttons: [
                    {
                        title: 'Yes',
                        default: true,    // Will be triggered by default if 'Enter' pressed.
                        handler: () => {
                            bus.$emit('dialog_confirmed', paramsArray);
                            this.$modal.hide('dialog')
                        }
                    },
                    {
                        title: '',       // Button title
                        handler: () => {
                        } // Button click handler
                    },
                    {
                        title: 'Cancel'
                    }
                ]
            })
        },

it worked ok, until I moved userListDelete method from my vue file into store.js. As a result on 1st event item is deleted ok, the the second item raise error that item was not found and I do not know event is doubled...

How to fix it ?

Thanks!

08 May
2 months ago

mstdmstd started a new conversation Why Suffer Error Running Migration Under Vultr Vps

Hello, Installing and running migration my laravel 5.8 app on new server under vultr vps I got error: https://imgur.com/a/87KgTQ4

php info is here : http://phpstack-231450-837582.cloudwaysapps.com/

How fix this error ?

Thanks!