mstdmstd

mstdmstd

Member Since 2 Years Ago

Experience Points 11,870
Experience Level 3

3,130 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.

10 Sep
1 week ago

mstdmstd started a new conversation How To Created Paypal Free Plan With 0 Amount?

Hello, in my laravel 5.8 app using "paypal/rest-api-sdk-php": "*", I need to create several paypal plans and one of them free with 0 amount : I created successfully paypal plan with 0 amount but activating such plan I got errpr :

{"name":"VALIDATION_ERROR","details":[{"field":"payment_definitions[0].amount.value","issue":"Amount passed in regular payment definition should be more than zero."}],"message":"Invalid request. See details.","information_link":"https://developer.paypal.com/docs/api/payments.billing-plans#errors","debug_id":"dd4befb0b2133"}

I understand the error, but can I create/activate paypal plan with 0 amount ? Has paypal any options for such cases ?

03 Sep
2 weeks ago

mstdmstd started a new conversation How To Upload Images From External Url After Page Is Loaded ?

Hello, In Laravel 5.8 / vuejs 2.6 / Bootstrap 4.3 app I make search by url on remote server and any returned row can have img_ref field and if this field is not empty I need to show in listing of items. Any Page has 20 items and 4-5 items are visible on one screen page. I do not want to upload all these image at once, as it can take long time. If there is a possibility to upload all images after page is uploaded and user can view content of the page?

Seems such teqnology called Lazy-load? Please give ref/example what can I use in this case?

Thanks!

27 Aug
3 weeks ago

mstdmstd left a reply on How To Get Client_id, Client_secret In Google +?

Thank you for the link, but this docs brings to Google+ API, which was shut down as it was mentioned above ?

26 Aug
3 weeks ago

mstdmstd left a reply on How To Get Client_id, Client_secret In Google +?

Can I use Gmail with laravel/socialite for app Login? If yes, please provide link how to make it. I tried to search but I found a lot of old Google+ links...

mstdmstd left a reply on How To Get Client_id, Client_secret In Google +?

Are there some other Google services I can use to make login with "laravel/socialite" / some other pluginS?

mstdmstd started a new conversation How To Get Client_id, Client_secret In Google +?

Hallo, In my laravel 5.8 app I make login with "laravel/socialite": "^3.2" using Google + account I made it some time ago and I had to recieve Auth Client ID parameters( client_id, client_secret ) . I tried to repeate it and opening console.developers.google.com page under my account I go by steps :

select Google + Api : https://prnt.sc/ovn8hb

cklick on manage button : https://prnt.sc/ovn943

but clicking on +client Credentils I do not see Auth Client ID menu as I expected : https://prnt.sc/ovn9jt in this page I can generate App Key, but seems that is different ?

What did I wrong and how to get client_id, client_secret ?

Thanks!

20 Aug
4 weeks ago

mstdmstd left a reply on Saving Blob Image In Laravel's Controller

I still search for decision. Who use vue-upload-component component files uploading in vuejs with laravel in control ? How do you save blob image uploaded with vue-upload-component component? Please, share working example...

15 Aug
1 month ago

mstdmstd left a reply on Saving Blob Image In Laravel's Controller

a bit more detailed : In vue file I send request using axios :

               let customerRegisterArray =
                    {
                        username: this.previewCustomerRegister.username,
                        email: this.previewCustomerRegister.email,
                        first_name: this.previewCustomerRegister.first_name,
                        last_name: this.previewCustomerRegister.last_name,
                        account_type: this.previewCustomerRegister.account_type,
                        phone: this.previewCustomerRegister.phone,
                        website: this.previewCustomerRegister.website,
                        notes: this.previewCustomerRegister.notes,
                        avatar_filename: this.previewCustomerRegister.avatarFile.name,
                        avatar_blob: this.previewCustomerRegister.avatarFile.blob,
                    };
                console.log("customerRegisterArray::")
                console.log(customerRegisterArray)

                axios({
                    method: ('post'),
                    url: window.API_VERSION_LINK + '/customer_register_store',
                    data: customerRegisterArray,
                }).then((response) => {
                    this.showPopupMessage("Customer Register", 'Customer added successfully ! Check entered email for activation link !', 'success');
alert( "SAVED!!::"+var_dump() )
                }).catch((error) => {
                });

and this.previewCustomerRegister.avatarFile.blob has value: "blob:http://local-hostels2.com/91a18493-36a7-4023-8ced-f5ea4a3c58af" where http://local-hostels2.com is my hosting... I set this value to preview image defined as :

                    <img
                        class="img-preview-wrapper"
                        :src="previewCustomerRegister.avatarFile.blob"
                        alt="Your avatar"
                        v-show="previewCustomerRegister.avatarFile.blob"
                        width="256"
                        height="auto"
                        id="preview_avatar_file"
                    >

and when previewCustomerRegister.avatarFile.blob is assigned with uploaded file I see it in preview image. I show control with saving function in first topic but when I tried to opened my generated file with kate, I found that it has content of my container file resources/views/index.blade.php...

What I did wrong and which is the valid way ?

14 Aug
1 month ago

mstdmstd started a new conversation Saving Blob Image In Laravel's Controller

Hello! In my Laravel 5/vuejs 2.6 I upload image with vue-upload-component and sending requested image blob I try to save it with controller code like :

            if ( !empty($requestData['avatar_filename']) and !empty($requestData['avatar_blob']) ) {
                $dest_image = 'public/' . Customer::getUserAvatarPath($newCustomer->id, $requestData['avatar_filename']);

                $requestData['avatar_blob']= str_replace('blob:','',$requestData['avatar_blob']);
                Storage::disk('local')->put($dest_image, file_get_contents($requestData['avatar_blob']));
                ImageOptimizer::optimize( storage_path().'/app/'.$dest_image, null );
            } // if ( !empty($page_content_image) ) {

As result I have image uploaded, but it is not readable. Source file has 5 Kib, then resulting file has 5.8 Kib and in browser's console I see blobs path as avatar_blob: "blob:http://local-hostels2.com/91a18493-36a7-4023-8ced-f5ea4a3c58af"

Have I to convert my blob some how to save it correctly?

Thanks!

13 Aug
1 month ago

mstdmstd left a reply on How Set Height Of Ckeditor With Vuejs Component

Thank you! your css code was helpfull, if to remove scoped in style definition. Could you please explain why ? as this css was defined in 1 vue file. I expected that all styles inside of

<style scoped>

would be applied to this page fully?

12 Aug
1 month ago

mstdmstd started a new conversation How Set Height Of Ckeditor With Vuejs Component

Hello!

In my Laravel 5/vuejs 2.6 / app I want to use ckeditor and I installed https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs.html package and using it I can not change default height of the component, like :

<template>
   <div class="container">
        ...
         <div style="display:flex; flex:2" class="p-2">
            <ckeditor :editor="editor" v-model="editorData" :config="editorConfig" :height="120" :rows="6"></ckeditor>
         </div>

        ...
import CKEditor from '@ckeditor/ckeditor5-vue';  //https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs.html
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';

Vue.use(CKEditor);
export default {
    data: function () {

    return {
        ...
        editor: ClassicEditor,
        editorData: '<p>Content of the editor.</p>',
        editorConfig: {
            // The configuration of the editor.
            indent_style: 'tab',
            tab_width: 4,
            charset: 'utf-8',
            end_of_line: 'lf',
            trim_trailing_whitespace: true,
            insert_final_newline: true
        }
    }

and adding styles :

<style scoped>
 .ck .ck-reset .ck-editor .ck-rounded-corners {
    min-height: 500px !important;
    border: 2px dotted olive !important;
    background-color: yellow !important;
 }
 .ck-editor__editable {
    min-height: 500px !important;
    border: 2px dotted green !important;
    background-color: yellow !important;
 }

.ck-editor__editable_inline {
   min-height: 500px !important;
   border: 2px dotted blue;
   background-color: yellow !important;
}

:host ::ng-deep .ck-editor__editable_inline {
   min-height: 500px !important;
   border: 2px dotted red !important;
   background-color: yellow !important;
}

You can look at it live : http://hostels2.my-demo-apps.tk/test Which way is correct ?

Thanks!

09 Aug
1 month ago

mstdmstd started a new conversation In Ajax Post Request My App Blocked By CORS Policy Error

I encountered CORS policy error in my laravel 5.8 / jquery 3.4.1 app when I need send post request to create google calendar event with api like:

    public function calendar_add_event(Request $request)
    {
        session_start();
        $startDateTime = $request->start_date;
        $endDateTime = $request->end_date;

        if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
            $this->client->setAccessToken($_SESSION['access_token']);
            $service = new Google_Service_Calendar($this->client);

            $calendarId = 'primary';
            $event = new Google_Service_Calendar_Event([
                'summary' => $request->title,
                'description' => $request->description,
                'start' => ['dateTime' => $startDateTime],
                'end' => ['dateTime' => $endDateTime],
                'reminders' => ['useDefault' => true],
            ]);
            $results = $service->events->insert($calendarId, $event);
            if (!$results) {
                return response()->json(['status' => 'error', 'message' => 'Something went wrong']);
            }
            return response()->json(['status' => 'success', 'message' => 'Event Created']);
        } else {
            return redirect()->route('oauthCallback');
        }
    }

In js code I send post request :

backendCalendar.prototype.saveCalendarAddEvent = function (user_id) {
    var href = this_backend_home_url + "/admin/calendar_add_event";
    $.ajax( {
        type: "POST",
        dataType: "json",
        url: href,
        data: { "title": $('#new_event_title').val(),   "description": $('#new_event_description').val(),   "start_date": $('#new_event_start_date').val(),   "end_date": $('#new_event_end_date').val(),     "_token": this_csrf_token},
        success: function( response )
        {
            popupAlert("New event was added successfully !", 'success')
        },
        error: function( error )
        {
            popupErrorMessage(error.responseJSON.message)
        }
    });

} // backendCalendar.prototype.saveCalendarAddEvent

I installed https://github.com/barryvdh/laravel-cors package and left file config/cors.php without changes :

<?php

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

];

in routes/web.php I added HandleCors middleware :

Route::group(['middleware' => ['auth', 'isVerified', 'CheckUserStatus'], 'prefix' => 'admin', 'as' => 'admin.'], function () {
   ...
    Route::post('calendar_add_event', '[email protected]_add_event')->middleware(\Barryvdh\Cors\HandleCors::class);

and I hoped that would fix my problems, but I still have this error : https://imgur.com/a/uyTy30Y

How to fix it ?

mstdmstd left a reply on Organization Of Android And IOS App With Backend

No, Thanks! I do not search who can implement the task instead of me, but some tacknical hints for it,

mstdmstd started a new conversation Organization Of Android And IOS App With Backend

Hallo, I need to make app for Android and iOS with backend. Like admin/customers, services, events, coomon dictionaries etc... The demand is firstly to implement database structure 1) with dummy data(including images) and next api 2) which could be used both in frontend 3) and backend part 4). Supposed I would make 1), 2), 4) point 3) would be done by other developer.

Looks like backend part must be implemented at last turn. That is somewhat behind my expierence. Usually I make 1) and 4) at the same time. And checking how backend pages work I test 1) api for crud operations. And file routes/web.php contains declarations :

Route::group(['middleware' => ['auth', 'isVerified', 'CheckUserStatus'], 'prefix' => 'admin', 'as' => 'admin.'], function () {
    Route::post('/video/store', 'Admin\[email protected]');
    ...

How better to organize my app for coding/testing/keeping documentation as at first I work only with 1) and 2)? Are there some usefull tools for this? Maybe to write app tests for this?

Please, share your successfull expierence.

Thanks!

01 Aug
1 month ago

mstdmstd left a reply on How Make For Heavy Testing For Search System

As I wrote above we are different developers for one client, so I do not expect any violation the terms of use.

I have an idea to write a function for running curl-request for this remote server changing input parameters (this request has about 12 parameters).

In JS to set time interval running this request, say N-requests in a minute. N - starting from 10 and increasing for next tests and outputing results of the request on the screen (time of request, parameters of the request, number of rows returned from the server)...

I am inventing a wheel... I suppose that there are some benchmarks / plugings / test scripts for such goals ?

mstdmstd left a reply on How Make For Heavy Testing For Search System

Yes, we are different developers for one client. But if talk to this developer who works what about? Having contact with him which /tools/scripts can I use ?

30 Jul
1 month ago

mstdmstd left a reply on How To Run App With Puppeteer On Remote Server

You hit the point! As it is web server ubuntu it has never came to my head that I had to install Chrome as ordinary package? have I to run :

sudo apt-get install google-chrome-stable 

and it must fix my problems?

29 Jul
1 month ago

mstdmstd left a reply on How To Run App With Puppeteer On Remote Server

Searching for decision I found a way of installing puppeteer with command --save option :

npm i puppeteer --save

so I removed it at first :

npm remove puppeteer 

and

npm i puppeteer --save

after it. But It did not helped. Any idea how to fix it ?

27 Jul
1 month ago

mstdmstd started a new conversation How Make For Heavy Testing For Search System

Hello,

I have a search system (laravel5.8/mysql5 /vuejs 2.5 / bootstrap 4 ) where data are read from remote server using its ip and shown for registered and logged user. User can select some of found rows and save them in database. Quote simple. users table is ordinary.

When user saves found data 1 row is saved in table :

CREATE TABLE `user_lists` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `saved_count` int(10) UNSIGNED NOT NULL DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

when user can assign title and description.

found rows can have 40-50 fields which are saved in next table:

CREATE TABLE `search_results` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_list_id` int(10) UNSIGNED NOT NULL,
  `source_id` int(10) UNSIGNED NOT NULL,
  `field` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` json NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

My question is how my app can be tested for heavy testing and search for some narrow places? From the first look a possible narrow place seems remote server. The reason : not any request by logged user is saved in db. Are there some benchmarked tools to searct / test for possible narrow places?

Thanks!

12 Jul
2 months 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
2 months 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
2 months 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
2 months ago

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

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 months 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 months 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 months 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 months 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 months 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
2 months 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
2 months 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
2 months 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
2 months 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
3 months 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
3 months 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
3 months 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
3 months 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
3 months 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
3 months 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
3 months 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
3 months 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!