mstdmstd

Experience

6,290

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 1 Lesson Completed
  • 0 Favorites

25th September, 2018

mstdmstd left a reply on I Search Datepicker Compatible With Bootstrap 4.1/blade • 13 hours ago

Thank you, daterangepicker seems very interesting. But reading the doc I missed how to set format to it, as in my app I show date in format like:

24 September, 2018

And how set default values and read it ?

mstdmstd left a reply on Why UserNotVerifiedException Error Is Not Trigered? • 16 hours ago

I use 2 middleware :

Route::group(array('prefix' => 'profile', 'middleware' => ['auth', 'isVerified']), function(){
    Route::get('view', array(
        'as'      => 'profile-view',
        'uses'    => '[email protected]'
    ));

can it be the issue somehow?

24th September, 2018

mstdmstd started a new conversation I Search Datepicker Compatible With Bootstrap 4.1/blade • 1 day ago

Hello! There was good datepicker for boostrap 3.3 https://github.com/Eonasdan/bootstrap-datetimepicker In my laravel 5.7.3 application bootstrap 4.1 is used. Can you advice some plugin/script compatible with bootstrap 4.1/blade?

Thanks!

23rd September, 2018

mstdmstd left a reply on Chartjs Video Lessaons With Relative Docs • 2 days ago

Thank you for your responce! I found some examples and uploaded into my project Chart.bundle.js file:

 * Chart.js
 * http://chartjs.org/
 * Version: 2.6.0
 *
 * Copyright 2017 Nick Downie
 * Released under the MIT license
  1. But I am not sure is this version is corresponding https://laracasts.com/series/charting-and-you/episodes/1 lessons... In the begginning of this lessons I see 1.0.2 version link.

  2. If there is a way to get some old version of the doc like http://www.chartjs.org/docs/1/getting-started/ ?

mstdmstd started a new conversation Chartjs Video Lessaons With Relative Docs • 3 days ago

Hello, I opened "Charting and You: Line Graph in 5 Minutes" lessons( https://laracasts.com/series/charting-and-you/episodes/1 ) and I opened docs which is supposed is refernced in this video http://www.chartjs.org/docs/latest/charts/line.html

But looks like it is different! This video is 2.5 years old. Is it so absolute or I find wrong video?

Can you give a ref to lessons on current chartj version?

Thanks!

21st September, 2018

mstdmstd started a new conversation How Get Route Name Resource • 4 days ago

Hello, In my my laravel 5.7.3 application I want to get current route to show current menu item for listing and editor in my backend, as :

        $route_name = Route::currentRouteName();

and in my routes/web.php I wrote :

Route::get('votes/filter/{filter_type}/{filter_value}', 'Admin\[email protected]')->name('VotesFilter');
// that works ok - as I got $route_name == 'admin.VotesFilter'

But I falied to get route name of editor. As name( method had 2 parameters I tried:

    Route::resource('votes', 'Admin\VotesController', ['except' => ['create', 'edit']])->name('VoteEditor', ['id' => '{vote_id}']);
// But I got $route_name == 'admin.'

Which is valid way ?

Thanks!

mstdmstd left a reply on Why UserNotVerifiedException Error Is Not Trigered? • 4 days ago

No, I did not. Could it be the issue ?

I tried to change my model like :

<?php

namespace App;

use DB;
use Illuminate\Support\Facades\Storage;
use Illuminate\Notifications\Notifiable;

use Illuminate\Foundation\Auth\User as Authenticatable;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use App\Http\Traits\funcsTrait;

class User extends Authenticatable implements MustVerifyEmail
{
    use Notifiable;
    use funcsTrait;
    protected $table = 'users';
    protected $primaryKey = 'id';
    public $timestamps = false;

But it did not help and I still have the same error ?

mstdmstd started a new conversation Why UserNotVerifiedException Error Is Not Trigered? • 4 days ago

Hello, In my my laravel 5.7.3 application I use https://github.com/jrean/laravel-user-verification extention and with use of middleware I generate UserNotVerifiedException when logged is not verified But with excception I want to make logout and redirect to /login page and reading https://laravel.com/docs/master/errors#the-exception-handler doc in file app/Exceptions/Handler.php I do :

<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Auth;
use App\Exceptions\UserNotVerifiedException;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Foundation\Auth\RegistersUsers;

use Jrean\UserVerification\Traits\VerifiesUsers;  // Do I need to add these declarations here ?
use Jrean\UserVerification\Facades\UserVerification;

class Handler extends ExceptionHandler
{
    use RegistersUsers;
    use VerifiesUsers;
    protected $dontReport = [
        //
    ];

    protected $dontFlash = [
        'password',
        'password_confirmation',
    ];

    public function report(Exception $exception)
    {
        parent::report($exception);
    }

    public function render($request, Exception $exception)
    {
        dump($exception);
        if ($exception instanceof UserNotVerifiedException) {
            dump("Make Logout");
            Auth::logout();
            return redirect('/admin/dashboard/index');

        }
        return parent::render($request, $exception);
    }
}

In dump file I see first message, but not second(and why there is no redirection):

UserNotVerifiedException {#509 ▼
  #message: "This user is not verified."
  #code: 0
  #file: "/mnt/_work_sdb8/wwwroot/lar/Votes/vendor/jrean/laravel-user-verification/src/Middleware/IsVerified.php"
  #line: 26
  trace: {▶}
}

Which is valid way ?

Thanks!

20th September, 2018

mstdmstd started a new conversation How To Fix Error In User Verification Plugin On New User Creation? • 6 days ago

Hello, In my my laravel 5.7.3 application I have wizard for user's creation. It worked, but I got error when on user creation I attached plugin https://github.com/jrean/laravel-user-verification/

My model app/User.php:
<?php

namespace App;

use DB;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Http\Traits\funcsTrait;
use App\library\ImagePreviewSize;


class User extends Authenticatable
{
    use Notifiable;
    use funcsTrait;
    protected $table = 'users';
    protected $primaryKey = 'id';
    public $timestamps = false;
...

and in controls app/Http/Controllers/AccountController.php:

    public function postConfirm() // create new user with all related data
    {
        DB::beginTransaction();
        try {
            $newAccountData = Session::get($this->register_session_key);

            $avatar_filename = ! empty($newAccountData['avatar_filename']) ? $newAccountData['avatar_filename'] : '';
            $avatar_filename_path = ! empty($newAccountData['avatar_filename_path']) ? $newAccountData['avatar_filename_path'] : '';

            $newUser             = new User();
            $newUser->username   = $newAccountData['username'];
            $newUser->email      = $newAccountData['email'];
            $newUser->password   = $newAccountData['password'];
            $newUser->first_name = $newAccountData['first_name'];
            $newUser->last_name  = $newAccountData['last_name'];
            $newUser->phone      = $newAccountData['phone'];
            $newUser->website    = $newAccountData['website'];
            $newUser->status     = 'N';
            if ( ! empty($avatar_filename)) {
                $newUser->avatar = $newAccountData['avatar_filename'];
            }
            $newUser->save();


            $ret1= UserVerification::generate($newUser);

On the last Line I got error :

The model instance provided is not compliant with this package.   

In the docs linked above I read :

The model instance provided is not compliant with this package. It must implement the authenticatable interface Illuminate\Contracts\Auth\Authenticatable

I tried to modify my user modfel with lines:

<?php

namespace App;

use DB;
use Illuminate\Notifications\Notifiable;
//use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Contracts\Auth\Authenticatable;
use App\Http\Traits\funcsTrait;
use App\library\ImagePreviewSize;


class User extends Authenticatable
{
    ...

But I got error:

Class App\User cannot extend from interface Illuminate\Contracts\Auth\Authenticatable

Why error and how to fix it ?

Thanks!

17th September, 2018

mstdmstd started a new conversation A • 1 week ago

Hello! In my Laravel 5.6 application using vue.js 2.5.7 and "moment": "^2.22.2" I added new language/locale in my app and dates are not rendered [properly for my app, while prior 2 locales work ok, I suppose I need to add new lang label files to my project. Is it so? If yes where is source of these files and to where upload in my app?

Thanks!

10th September, 2018

mstdmstd started a new conversation Moving To Laravel 5.7 Has Npm Errors • 2 weeks ago

Hello, I updated my laravel 5.6 application to 5.7 with modification in my composer.json 1 line :

    ...
    "laravel/framework": "5.7.*",
    ...

and running

composer update

without errors in console.

But after I tried to update npm and got errors:

$ npm update
npm WARN [email protected] requires a peer of [email protected]^6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path /mnt/_work_sdb8/wwwroot/lar/Votes/node_modules/.node-sass.DELETE/vendor/linux-x64-64
npm ERR! code ENOTEMPTY
npm ERR! errno -39
npm ERR! syscall rmdir
npm ERR! ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/lar/Votes/node_modules/.node-sass.DELETE/vendor/linux-x64-64'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/serge/.npm/_logs/2018-09-09T11_36_03_794Z-debug.log


#:/mnt/_work_sdb8/wwwroot/lar/Votes$ npm install [email protected]^6.0.0
npm ERR! path /mnt/_work_sdb8/wwwroot/lar/Votes/node_modules/.node-sass.DELETE/vendor/linux-x64-64
npm ERR! code ENOTEMPTY
npm ERR! errno -39
npm ERR! syscall rmdir
npm ERR! ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/lar/Votes/node_modules/.node-sass.DELETE/vendor/linux-x64-64'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/serge/.npm/_logs/2018-09-09T11_36_52_038Z-debug.log

File 2018-09-09T11_36_52_038Z-debug.log has more 300 kb od data with lines at end:
1675 silly saveTree │ │   ├── [email protected]
1675 silly saveTree │ │   └── [email protected]
1675 silly saveTree │ └── [email protected]
1675 silly saveTree ├── [email protected]
1675 silly saveTree ├── [email protected]
1675 silly saveTree ├── [email protected]
1675 silly saveTree └── [email protected]
1676 verbose stack Error: ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/lar/Votes/node_modules/.node-sass.DELETE/vendor/linux-x64-64'
1677 verbose cwd /mnt/_work_sdb8/wwwroot/lar/Votes
1678 verbose Linux 4.15.0-33-generic
1679 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "[email protected]^6.0.0"
1680 verbose node v10.9.0
1681 verbose npm  v6.2.0
1682 error path /mnt/_work_sdb8/wwwroot/lar/Votes/node_modules/.node-sass.DELETE/vendor/linux-x64-64
1683 error code ENOTEMPTY
1684 error errno -39
1685 error syscall rmdir
1686 error ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/lar/Votes/node_modules/.node-sass.DELETE/vendor/linux-x64-64'
1687 verbose exit [ -39, true ]

My package.json has :

{
    "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.1.0",
        "popper.js": "^1.12",
        "cross-env": "^5.1",
        "laravel-mix": "^2.0",
        "lodash": "^4.17.4",
        "vue": "^2.5.7"
    },
    "dependencies": {
        "datatables.net-bs": "^1.10.19",
        "font-awesome": "^4.7.0",
        "jquery-confirm": "^3.3.2",
        "mustache": "^2.3.0"
    }
}
$ php artisan --version
Laravel Framework 5.7.2

How to fix this error?

Thanks!

7th September, 2018

mstdmstd left a reply on Common Methods, Data In Layout And Vue File Of Vue App? • 2 weeks ago

I do not use Vuex. What is myStore is this case? Just new var for app window? I use vue-localstorage in my app. Is it decision for vars? But as for common methods?

mstdmstd started a new conversation Common Methods, Data In Layout And Vue File Of Vue App? • 2 weeks ago

Hello! In my laravel 5.6/vue.js 2.5.7 / vuetify": "^1.0.8" application I have common layout file : resources/assets/js/components/layout/backendAppLayout.vue :

<template>
    <v-app light>
        <main>
            ...

                <v-content>

                    <v-container fluid fill-height wrap="true" >

                        <!-- CONTENT AREA START -->

                        <router-view ></router-view>

                        <!-- CONTENT AREA END -->

                    </v-container>

                </v-content>

                <app-footer></app-footer>

        </main>
    </v-app>
</template>

<script>
    import {bus} from '../../app';
       ...
    export default {
        mixins: [appMixin],
        props: {
            source: String
        },
        data() {
            return {
                logged_username: '', /* LOGGED USER INFO BLOCK */
                loggedUserProfile: {},
                logged_user_id: null,
                logged_user_name: null,
                ...
            }
        },

        created() {
        },

        methods: {

    }

</script>

and in my resources/assets/js/app.js I have rotes defined as :

...
import HomePage from './components/home/HomePage.vue';
...


const routes = [
    {
        path: '/',
        components: {
            homePage: HomePage,
            ...
        }
    },

    {path: '/home/:action?/:value?', component: HomePage, name: 'homePage'},

]

const router = new VueRouter( {
    mode: 'hash', // default
    routes
})


export const bus = new Vue();
let current_locale = 'en';
let current_locale_label = 'English';

Vue.localStorage.set('backend_locale', 'en')
Vue.localStorage.set('backend_locale_label', 'English')
...

new Vue({ router, i18n,

    data:{
        app_title: '',
        loggedUserProfile: {},   /* LOGGED USER INFO BLOCK */
    },

    mixins : [appMixin],

    created() {
    }, // created() {

    mounted() {
    ...

and in resources/views/layouts/app.blade.php :

<body>

<div id="app">

    <backend-app-layout></backend-app-layout>

</div>

    @include('layouts.footer')
    <script src="{{ asset('js/app.js'    ) }}{{  "?dt=".time()  }}"></script>

</body>

My question is if there is a way to define some methods, data variables, computed(like current locale, logged user info) in layout file resources/assets/js/components/layout/backendAppLayout.vue and use then in /components/home/HomePage.vue(and in other vue files) file with this. parent. key ? If yes, please explain how...

Thanks!

3rd September, 2018

mstdmstd started a new conversation Failed To Install Laravel-setup-wizard • 3 weeks ago

Hello, In my laravel 5.6 application I tried to install https://github.com/marvinlabs/laravel-setup-wizard plugin and got error :

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for marvinlabs/laravel-setup-wizard ^0.2.1 -> satisfiable by marvinlabs/laravel-setup-wizard[0.2.1].
    - Conclusion: remove laravel/framework v5.6.33
    - Conclusion: don't install laravel/framework v5.6.33
    - marvinlabs/laravel-setup-wizard 0.2.1 requires illuminate/support 5.4.* -> satisfiable by illuminate/support[5.4.x-dev, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9].
    - illuminate/support 5.4.x-dev conflicts with laravel/framework[v5.6.33].
    - illuminate/support v5.4.0 conflicts with laravel/framework[v5.6.33].
    - illuminate/support v5.4.13 conflicts with laravel/framework[v5.6.33].
    - illuminate/support v5.4.17 conflicts with laravel/framework[v5.6.33].
    - illuminate/support v5.4.19 conflicts with laravel/framework[v5.6.33].
    - illuminate/support v5.4.27 conflicts with laravel/framework[v5.6.33].
    - illuminate/support v5.4.36 conflicts with laravel/framework[v5.6.33].
    - illuminate/support v5.4.9 conflicts with laravel/framework[v5.6.33].
    - Installation request for laravel/framework (locked at v5.6.33, required as 5.6.*) -> satisfiable by laravel/framework[v5.6.33].

Installation failed, reverting ./composer.json to its original content.

I have :

$ php artisan --version 
Laravel Framework 5.6.33
  1. Does it mean that this plugin is not suitable for laravel 5.6 project? If there is a way to install it somehow?

  2. Can you advice some wizard plugin/script compatible with bootstrap 4.1 ?

Thanks!

1st September, 2018

mstdmstd left a reply on Validation Rule For 2 Fields Unique • 3 weeks ago

Yes, but if I open the editor in edit mode and change other fields (but leave the name field unchanged), then an error occurs when validating - the check finds itself. ignore - only helps if the uniqueness of the name field is unique. I do not know valid syntax if uniqueness is by 2 fields.

mstdmstd started a new conversation Validation Rule For 2 Fields Unique • 3 weeks ago

Hello, In my laravel 5.6 application I use next rule to check unique for name field

            'name' => [
                'required',
                'string',
                'max:255',
                Rule::unique('votes')->ignore($vote_id),
            ],

I use ignore condition to update this vote.

But I have a table where field “name” is unique inside of any "vote_id" :

CREATE TABLE "vote_items" 
  "id" integer not null primary key autoincrement, 
  "vote_id" integer null, 
  "name" varchar not null, 

Can I use unique checks condition in such cases and if yes which syntax is correct?

Thanks!

31st August, 2018

mstdmstd started a new conversation Vue-template-compile Errors In Console • 3 weeks ago

Hello!

Can somebody explain that in my Laravel/vue/vuetify application in console I got a lot of errors like:

ERROR in ./resources/assets/js/components/Backend/genres/genreEdit.vue
Module build failed: Error: 

Vue packages version mismatch:

- [email protected]
- [email protected]

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using [email protected]>=10.0, simply update vue-template-compiler.
If you are using [email protected]<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.
...

$ lsb_release -d; uname -r; uname -i
Description:    Ubuntu 18.04.1 LTS
4.15.0-33-generic
x86_64

$ php -v 
PHP 7.2.7-0ubuntu0.18.04.2 (cli) (built: Jul  4 2018 16:55:24) ( NTS )
 

$ nodejs --version 
v10.5.0

$ npm --version  
6.1.0

composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "cviebrock/eloquent-sluggable": "^4.5",
        "dompdf/dompdf": "^0.8.2",
        "fideloper/proxy": "^4.0",
        "gloudemans/shoppingcart": "^2.5",
        "graham-campbell/markdown": "^10.0",
        "intervention/image": "^2.4",
        "laracasts/utilities": "^3.0",
        "laravel/framework": "5.6.*",
        "laravel/socialite": "^3.0",
        "laravel/tinker": "^1.0",
        "league/html-to-markdown": "^4.6",
        "martinlindhe/laravel-vue-i18n-generator": "^0.1.28",
        "rap2hpoutre/laravel-log-viewer": "^0.21.0",
        "spatie/laravel-permission": "^2.16",
        "torann/geoip": "^1.0",
        "wboyz/laravel-enum": "^0.2.1"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.1",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "laravel/dusk": "^3.0",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.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"
        ]
    },
    "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": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "npm run watch -- --watch-poll",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "prod": "npm run production",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "axios": "^0.18",
    "bootstrap": "^4.0.0",
    "cross-env": "^5.1",
    "jquery": "^3.2",
    "laravel-mix": "^2.1.14",
    "lodash": "^4.17.10",
    "popper.js": "^1.12",
    "vue": "^2.5.7"
  },
  "dependencies": {
    "@servicestack/editor": "0.0.2",
    "chart.js": "^2.7.2",
    "font-awesome": "^4.7.0",
    "moment": "^2.22.2",
    "node-sass": "^4.9.2",
    "showdown": "^1.8.6",
    "vue-chartjs": "^3.3.2",
    "vue-i18n": "^8.0.0",
    "vue-img-preview": "^1.1.1",
    "vue-localstorage": "^0.6.2",
    "vue-picture-swipe": "^0.4.0",
    "vue-router": "^3.0.1",
    "vue2-google-maps": "^0.8.12",
    "vuelidate": "^0.6.2",
    "vuetify": "^1.0.8",
    "vuetify-google-autocomplete": "^2.0.0-Alpha.8"
  }
}

and how to fix it ?

Thank you!

25th August, 2018

mstdmstd started a new conversation Error Adding Row To Spatie/laravel-permission Plugin Table • 1 month ago

Hello!

In my Laravel 5.6/PostgreSQL 10.5 application with "spatie/laravel-permission": "^2.16" plugin I want to add 1 row as :

                $newModelHasPermission                = new ModelHasPermission();
                $newModelHasPermission->permission_id = 1;
                $newModelHasPermission->model_type    = (new MyAppModel)->pgEscape("App\User");
                $newModelHasPermission->model_id      = 12;
                $newModelHasPermission->save();

and I got error :

   "message": "SQLSTATE[42601]: Syntax error: 7 ERROR:  zero-length delimited identifier at or near \"\"\"\"\nLINE 1: ..., \"model_type\", \"model_id\") values (, , ) returning \"\"\n                                                                     ^ (SQL: insert into \"rt_model_has_permissions\" (\"permission_id\", \"model_type\", \"model_id\") values (1, App\User, 12) returning \"\")",
    "exception": "Illuminate\Database\QueryException",

Model declarations has :

 <?php
namespace App;

use DB;
use App\MyAppModel;
use App\User;
use App\library\ListingReturnData;
use App\Http\Traits\funcsTrait;

class ModelHasPermission extends MyAppModel
{

    protected $table = 'model_has_permissions';
    public $timestamps = false;

    use funcsTrait;

    protected static function boot() {
        parent::boot();
    }

    public function permission()
    {
        return $this->belongsTo('App\Permission');
    }

...

Why error and how to fix it?

Thanks!

mstdmstd left a reply on To Show Images To Given Size • 1 month ago

I found a way : on server retrieving data to get width/height of an image and recalculate it in control to given max width/height keeping the ratio. As example if I need to show image in (ex 320px*240px) then sizes of image for image with original size 600800px would be recalulating withing 320px240px keeping the ratio.

But if image is say 120px*120px, I leave the size as it it and send this calculated parameters to the client and set them in width/height the of the image. Modern browsers seems very good for image size changing on fly... Such reinventing the wheel seems for me better making checking on client or forcing the client to upload the images only of proper size...

Hope I put it clearly?

maybe there are some libs/plugings for this...

mstdmstd left a reply on To Show Images To Given Size • 1 month ago

That is good decision in many cases, but if uploaded image has, say height 60 and width 90px? How would image look like ? as broken, as the code above would show image twice as bigger of original size. I have to add some additive check if my template that I do not like... Any other ideas?

24th August, 2018

mstdmstd started a new conversation To Show Images To Given Size • 1 month ago

Hello!

In my Laravel 5.6/"vue": "^2.5.7/"vuetify": “^1.0.8” application I need some plugin/tool to show image sized winthin some height/width with keeping rati on of the shown image. I mean I need to show images say 600*800px and 400*300px in the box height/width no more 200px without image view breaking...

Is there is something like that?

Thanks!

23rd August, 2018

mstdmstd left a reply on How Move From Auth To Spatie/laravel-permission Plugin • 1 month ago

Thanks! Any aide for point 2) ?

mstdmstd started a new conversation How Move From Auth To Spatie/laravel-permission Plugin • 1 month ago

Hello!

In my Laravel 5.6 application I use auth and in my routes/web.php I wrote rules for my admin part as :

  Route::group(['middleware' => ['auth'], 'prefix' => 'api/admin', 'as' => 'admin.'], function () {

Now I want to use https://github.com/spatie/laravel-permission plugin and my question are

  1. have I to uninstall/disable auth in this way and what have I to pay attention at?

  2. instead on string constants like

'publish articles'

I would like to add in some place some defined constants and to use them in different parts of app and for this in my common trait app/Http/Traits/funcsTrait.php I added lines like :

define("IN_BACKEND_EDIT_SYSTEM_DICTIONARIES",   'In backend edit system dictionaries');
define("IN_BACKEND_EDIT_USERS_DATA",            'In backend edit users data');

But I am not sure is it the best place, as I need to use them in different parts of the app, including routes/web.php ?

Thanks!

7th August, 2018

mstdmstd left a reply on How To Make Authorization With Php Unit ? • 1 month ago

Thank you! Also I have 2 questions :

  1. If response object has assertTitle(I got error trying to call it) method or if there is some other way to check text in Tag?

  2. If I got error in line like

        $response->assertSee('Non existing text');

in console I see long text(html-output of my url) and message text at the end of the output:

</footer></html>\n
' contains "Non existing text".

This long text oupput seems very unconvinient. If there is a way to manipulate/cut it?

mstdmstd started a new conversation How To Make Authorization With Php Unit ? • 1 month ago

Hello, In my laravel 5.6 application I need to use php unit tests, like in file tests/Feature/VotesAdminCrudTest.php I do:

<?php

namespace Tests\Feature;

use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Settings;
use App\User;


class VotesAdminCrudTest extends TestCase
{
    public function testVotesListing()
    {
        $settingsArray              = Settings::getSettingsList( ['site_name', 'site_heading', 'site_subheading'], true);
        $site_name= $settingsArray['site_name' ] ? $settingsArray['site_name' ] : '';
        $logged_user_id = 5;
        $loggedUser= User::find($logged_user_id);

//        $this->actingAs($loggedUser);
        $response = $this->get('/admin/votes');
        $response->assertStatus(200);
//        $response->assertTitle($site_name);   
        
        $response->assertSee('Votes Listing');
        
    }
}

But running command :

$ vendor/bin/phpunit

I got error:

Expected status code 200 but received 302.
Failed asserting that false is true.

As my /admin/votes page needs authorization, looks like that is the reason, but I do not know how to make authorization in my case? Googling I found actingAs method, bit looks like response object has not it? Which is the right way?

  1. has $response object assertTitle method, I used with dusk, or subtitution of it ?

Thanks!

28th July, 2018

mstdmstd left a reply on Out Of Memory Error On Server • 1 month ago

That is Ubuntu hosting(I created it a pair of weeks ago) under Digital Ocean:

[email protected]:/var/www/html/box-booking# lsb_release -d; uname -r; uname -i
Description:    Ubuntu 16.04.4 LTS
4.4.0-130-generic
x86_64

[email protected]:/var/www/html/box-booking# free -m
              total        used        free      shared  buff/cache   available
Mem:            992         325         562          35         104         518
Swap:             0           0           0

I had laravel 5.5 app installed. I pulled changes from git and had to install intervention/image :

# composer require intervention/image 

Using version ^2.4 for intervention/image
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

mmap() failed: [12] Cannot allocate memory

mmap() failed: [12] Cannot allocate memory
PHP Fatal error:  Out of memory (allocated 586162176) (tried to allocate 20480 bytes) in /usr/share/php/Composer/DependencyResolver/Rule.php on line 66

Fatal error: Out of memory (allocated 586162176) (tried to allocate 20480 bytes) in /usr/share/php/Composer/DependencyResolver/Rule.php on line 66
[email protected]:/var/www/html/box-booking# 
[email protected]:/var/www/html/box-booking# lsb_release -d; uname -r; uname -i

Also I tried:

# composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing doctrine/dbal (v2.6.3)
The following exception is caused by a lack of memory and not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details

I see

not having swap configured

error description above and 0 value in free command above. Is it issue and how to fix it?

Also installing Ubuntu hosting under Digital Ocean I did not notice any swap options...

Aslo can be rebooting of the system salve the problem? Usually I reboot the ubuntu(I use kubuntu 18 on my laptop) running under root:

reboot

Is it what I have to run in my case or other command preferable?

27th July, 2018

mstdmstd started a new conversation Out Of Memory Error On Server • 1 month ago

Hello, On my remote server(ubuntu 16, PHP 7.2.7-1+ubuntu16.04.1+deb.sury.org+1 ) in laravel 5.5 project I got error:

# composer require doctrine/dbal
Using version ^2.8 for doctrine/dbal
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

mmap() failed: [12] Cannot allocate memory

mmap() failed: [12] Cannot allocate memory
PHP Fatal error:  Out of memory (allocated 596647936) (tried to allocate 20480 bytes) in /usr/share/php/Composer/DependencyResolver/Rule.php on line 66

Fatal error: Out of memory (allocated 596647936) (tried to allocate 20480 bytes) in /usr/share/php/Composer/DependencyResolver/Rule.php on line 66

# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            487M     0  487M   0% /dev
tmpfs           100M   11M   89M  11% /run
/dev/vda1        25G  2.3G   22G  10% /
tmpfs           497M     0  497M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           497M     0  497M   0% /sys/fs/cgroup
/dev/vda15      105M  3.4M  101M   4% /boot/efi
tmpfs           100M     0  100M   0% /run/user/0

In my /etc/php/7.2/cli/php.ini:

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 3300

; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 240

; Maximum input variable nesting level
; http://php.net/max-input-nesting-level
;max_input_nesting_level = 64

; How many GET/POST/COOKIE input variables may be accepted
; max_input_vars = 1000

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 1024M

upload_max_filesize = 400M
post_max_size = 400M

I restarted apache server times.

What is wrong and how to fix the error?

Thanks!

24th July, 2018

mstdmstd started a new conversation How To Send Post Request To Another Control/action • 2 months ago

Hello, If in laravel5.5 there is a way from control to send post request to another control/action with some parameters, like

return redirect()->route('space.index',['val':1, ‘foo’:'bar'])

? If yes, please ref to example...

Thanks!

22nd July, 2018

mstdmstd left a reply on Error Installing Laravel 5.6 App On Remote Hosting • 2 months ago

Also a question : have I to add /vendor/ dir into git or is it autogenerated?

mstdmstd left a reply on Error Installing Laravel 5.6 App On Remote Hosting • 2 months ago

Thank you for your hints! I opened /var/log/apache2/error.log file and found error that vendor directory was absent I pulled vendor directory and I got on screen error that some fields in tables were absent.

I created new database with fresh db dump and set name to this db in .env file.

But the browse opened only error:

This page isn’t working
139.59.34.234 is currently unable to handle this request.
HTTP ERROR 500

I opened /var/log/apache2/error.log and see errors like

[Sun Jul 22 11:33:56.898685 2018] [php7:error] [pid 26467] [client 213.109.234.130:34476] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/box-booking/vendor/doctrine/db$
[Sun Jul 22 11:33:56.898875 2018] [php7:error] [pid 26467] [client 213.109.234.130:34476] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/box-booking/vendor/laravel/fra$
[Sun Jul 22 11:33:58.387797 2018] [php7:error] [pid 26469] [client 213.109.234.130:34474] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/box-booking/vendor/doctrine/db$
[Sun Jul 22 11:33:58.388057 2018] [php7:error] [pid 26469] [client 213.109.234.130:34474] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/box-booking/vendor/laravel/fra$

Some my system parameters :

# df -HT 
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  1.1G     0  1.1G   0% /dev
tmpfs          tmpfs     210M   22M  189M  11% /run
/dev/vda1      ext4       52G  3.9G   48G   8% /
tmpfs          tmpfs     1.1G     0  1.1G   0% /dev/shm
tmpfs          tmpfs     5.3M     0  5.3M   0% /run/lock
tmpfs          tmpfs     1.1G     0  1.1G   0% /sys/fs/cgroup
/dev/vda15     vfat      110M  3.6M  106M   4% /boot/efi
tmpfs          tmpfs     210M     0  210M   0% /run/user/0
PHP Version 7.1.17-1+ubuntu16.04.1+deb.sury.org+1

from php info output:

memory_limit    128M    128M
Zend OPcache
Opcode Caching  Up and Running
Optimization    Enabled
SHM Cache   Enabled
File Cache  Disabled
Startup OK
Shared memory model mmap
Cache hits  13817PHP Version 7.1.17-1+ubuntu16.04.1+deb.sury.org+1

Cache misses    566
Used memory 26793008
Free memory 107388984
Wasted memory   35736
Interned Strings Used memory    1964456
Interned Strings Free memory    6424152



opcache.memory_consumption  128 128
opcache.opt_debug_level 0   0
opcache.optimization_level  0x7FFFBFFF  0x7FFFBFFF
opcache.preferred_memory_model  no value    no value
opcache.protect_memory  0

Why errors and how to fix it ?

mstdmstd started a new conversation Error Installing Laravel 5.6 App On Remote Hosting • 2 months ago

Hello, I am trying to install my laravel 5.6 app on remote hosting(digital ocean, Ubuntu 16.04.3)

I set DocumentRoot in /etc/apache2/sites-available to /public of my app

I added line in /etc/apache2/apache2.conf

ServerName localhost

and set all :

AllowOverride All

I made

a2enmod rewrite

and

sudo service apache2 restart

and

# sudo apache2ctl configtest
Syntax OK

Running in browser I got message

This page isn’t working
NNN.NN.NN.NNN is currently unable to handle this request.
HTTP ERROR 500

As I see error code my web hosting ok, that is some specific intermal error? But I want to see laravel error?

I run

sudo chmod -R 777 /var/www/html/box-booking/storage

log dir is empty:

and [email protected]:/var/www/html/box-booking/storage/logs# ls -la
total 12
drwxr-xr-x 2 root root 4096 Jul 22 06:13 .
drwxr-xr-x 6 root root 4096 Jul 22 06:13 ..
-rwxr-xr-x 1 root root   14 Jul 22 06:13 .gitignore

In my .env :

APP_NAME=Laravel
APP_ENV=local
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://NNN.NN.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306

In my /config/app.php I changed: 'env' => 'local', 'debug' => true,


But I stiil can not see any error...

Is it some cache of config? How to see the errors?

Thanks!

21st July, 2018

mstdmstd started a new conversation Error Attaching Datatables Library • 2 months ago

Hello, In my laravel 5.6 application I try to install datatables library as it is written here https://datatables.yajrabox.com/starter But I have problems with commom layout, as I have javascript error: $(...).DataTable is not a function

In my app layout resources/views/layouts/app.blade.php I wrote :

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{ config('app.name', 'Laravel') }}</title>

    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}{{  "?dt=".time()  }}" defer></script>

    <!-- Fonts -->
    <link rel="dns-prefetch" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600" rel="stylesheet" type="text/css">


    <!-- Styles -->
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
    <link rel="stylesheet" href="{{ asset('/css/jquery.dataTables.min.css') }}">

    <script src="{{ asset('js/jquery-1.10.2.min.js') }}"></script>

</head>
<body>
    <div id="app">


        <nav class="navbar navbar-expand-md navbar-light navbar-laravel">
            <div class="container">
            ...
            </div>
        </nav>

        <main class="py-4">
            @yield('content')
        </main>
    </div>

    @yield('scripts')


</body>
</html>

In the listing resources/views/admin/vote_category/index.blade.php:

@extends('layouts.app')

@section('content')

    <table class="table table-bordered" id="users-table">
        <thead>
        <tr>
            <th>Id</th>
            ...
            <th>Updated At</th>
        </tr>
        </thead>
    </table>

    @include('layouts.footer')

@endsection


@section('scripts')
    <script src="{{ asset('js/jquery.dataTables.min.js') }}"></script>
    <script src="{{ asset('js/vote_category.js') }}"></script>
@endsection

In the script above in scripts section i attach dataTables script and my vote_category.js where I keep all my js functionality

and in public/js/vote_category.js:

$(document).ready(function () {

    alert("users-table::" + (-123))
    $('#users-table').DataTable({
        processing: true,
        serverSide: true,
        ajax: {
            url: '/admin/get_vote_categories_dt_listing',
            data: function (d) {
                d.product_name = $("#filter_product_name_short").val();
            },
        }, // ajax: {

        columns: [
            {data: 'id', name: 'id'},
            {data: 'name', name: 'name'},
            ...
        ]
    });

});

I got console error :

vote_category.js:7 Uncaught TypeError: $(...).DataTable is not a function
    at HTMLDocument.<anonymous> (vote_category.js:7)
    at c (jquery-1.10.2.min.js:4)
    at Object.fireWith [as resolveWith] (jquery-1.10.2.min.js:4)
    at Function.ready (jquery-1.10.2.min.js:4)
    at HTMLDocument.q (jquery-1.10.2.min.js:4)

In in network template I see all ny files attached ok in order I suppose valid : https://imgur.com/a/5f7FPDz

Why error and how to fix it ?

Thanks!

17th July, 2018

mstdmstd left a reply on How To To Install Mustache.php Library • 2 months ago

like the docs show

could you please give a link ?

16th July, 2018

mstdmstd started a new conversation How To To Install Mustache.php Library • 2 months ago

Hello,

In my laravel 5.6 application I need to install mustache.php library I googled and find this link: https://github.com/bobthecow/mustache.php/wiki

I added a line inyo my composer.json :

  "mustache/mustache": "~2.5"

But have I to add this provider into config/app.php ? If yes, which syntax? How correctly to attach mustache.php to my app ?

Thanks!

10th July, 2018

mstdmstd started a new conversation How To Slug Table With I18n Support • 2 months ago

Hello!

In my Laravel Framework 5.6/Postgres10 application I want to add i18n support to rt_cms_items table adding new table rt_cms_item_translations

CREATE TABLE public.rt_cms_items (
    id serial NOT NULL,
    alias varchar(100) NOT NULL,
    image varchar(50) NULL,
    icon varchar(50) NULL,
    user_id int4 NOT NULL,
    published bool NULL DEFAULT false,
)

CREATE TABLE public.rt_cms_item_translations (
    id serial NOT NULL,
    cms_item_id int4 NOT NULL,
    title varchar(100) NOT NULL,
    short_descr varchar(255) NOT NULL,
    content text NOT NULL,
    locale varchar(255) NOT NULL,
)

But the thing is that CmsItem model has slugged field and I use spatie/laravel-sluggable for its support and now I have that title and alias fields are in different table, like in app/CmsItem.php:

<?php

namespace App;

use Spatie\Sluggable\HasSlug;
use Spatie\Sluggable\SlugOptions;
use Illuminate\Database\Eloquent\Model;
use App\CmsItemTranslation;
...

class CmsItem extends MyAppModel
{
    use HasSlug;

    public $translatedAttributes = ['title', 'short_descr', 'content'];

    protected $table = 'cms_items';
    protected $primaryKey = 'id';
    public $timestamps = false;


    public function getSlugOptions() : SlugOptions
    {
        return SlugOptions::create()
            ->generateSlugsFrom('title')  // THIS FIELD MOVED TO CmsItemTranslation table !!!
            ->saveSlugsTo('alias');
    }


    public function cmsItemTranslations()
    {
        return $this->hasMany('App\CmsItemTranslation');
    }

and in app/CmsItemTranslation.php:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use App\CmsItem;


class CmsItemTranslation extends MyAppModel
{
    use funcsTrait;
    protected $table = 'cms_item_translations';
    protected $primaryKey = 'id';
    public $timestamps = false;
    protected $fillable = ['cms_item_id', 'locale', 'title', 'short_descr', 'content'];


    public function cmsItem()
    {
        return $this->belongsTo('App\CmsItem');
    }
    ...


}

In descrtiption of spatie/laravel-sluggable I found:

You can also pass a callable to generateSlugsFrom.

So I tried :

    public function getSlugOptions() : SlugOptions
    {
        return SlugOptions::create()
            ->generateSlugsFrom( [$this,'getAliasSlugs'] )
            ->saveSlugsTo('alias');
    }

    public function getAliasSlugs()
    {
        $request= new request();
        $title = $request->get('title');

        
        return $title;
    }

But I have alias field with values “-1”, “-2”. Looks like a way to get title field is invalid.

Which is the right way ?

Thanks!

7th July, 2018

mstdmstd left a reply on How Update Name Field In Migrations • 2 months ago

Sorry, if I put my questions in poor way. I do not need to modify structure of the table, but some key value. I mean that I had a seeder, which set value of some field by seeder :

\App\Models\StorageSpaceStatus::insert(
            [
                ['id' => 2, 'name' => 'Booked',         'color' => '#008000'],
            ]
        );

Now I need to modify name field with other value and I did not find update method(similar insert above). I want to generate sql like:

UPDATE storage_space_statuses SET name='OTHER VALUE' where name = ‘Booked’

Thanks!

6th July, 2018

mstdmstd started a new conversation How Update Name Field In Migrations • 2 months ago

Hello, If there is a way in migrations to update name field of the table. I had a seeder like:

        \App\Models\StorageSpaceStatus::insert(
            [
                ['id' => 1, 'name' => 'Available',      'color' => '#FFA500'],
                ['id' => 2, 'name' => 'Booked',         'color' => '#008000'],
            ]
        );

Now I need to modify name of the

'name' = 'Booked'

Which is the valid way to do it?

laravel 5.5

Thanks!

27th June, 2018

mstdmstd started a new conversation ERROR : [email protected] Requires A Peer Of [email protected]^6.0.0 But None Is Installed • 2 months ago

Hello!

I tried to install by command :

npm install vue-localstorage --save

as it is written at https://github.com/pinguinjkeke/vue-local-storage

but I got a message in console :

npm WARN [email protected] requires a peer of [email protected]^6.0.0 but none is installed. You must install peer dependencies yourself.

and now even after I removed a package I got error :

$ npm install
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN [email protected] requires a peer of [email protected]^6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path /mnt/_work_sdb8/wwwroot/lar/ArtistsRating/node_modules/.node-sass.DELETE/vendor/linux-x64-64
npm ERR! code ENOTEMPTY
npm ERR! errno -39
npm ERR! syscall rmdir
npm ERR! ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/lar/ArtistsRating/node_modules/.node-sass.DELETE/vendor/linux-x64-64'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/serge/.npm/_logs/2018-06-27T04_48_31_252Z-debug.log

and in the file /home/serge/.npm/_logs/2018-06-27T04_48_31_252Z-debug.log above there is the same error :

24655 warn [email protected] requires a peer of [email protected]^6.0.0 but none is installed. You must ```
install peer dependencies yourself.

I am not sure if that was error related with vue-localstorage, but how to fix it ?

$ lsb_release -d; uname -r; uname -i Description: Ubuntu 18.04 LTS 4.15.0-23-generic x86_64

$ nodejs --version v10.5.0

$ npm --version 6.1.0

$ php artisan --version Laravel Framework 5.6.26


Thanks!

26th June, 2018

mstdmstd left a reply on How To Set Vue Component When Root Of Site Is Opened • 2 months ago

I tried to comment the firts root path, like :

const routes = [
    {
        // path: '/',
        components: {
            notFound: NotFound,
            appLogin: AppLogin,
            // appRoot: AppRoot,
            userRegister: UserRegister,
            userProfile: UserProfile,
            homePage: HomePage,
            testPage: TestPage,
            // stepperValidationPage: StepperValidationPage,
            datetimePickersValidationPage: DatetimePickersValidationPage,
            cmsItemPage: CmsItemPage,
            dashboardIndex: DashboardIndex,
            artistsIndex: ArtistsIndex,
            artistEditor: ArtistEdit,
            artistView:   ArtistView,

            genresIndex: GenresIndex,
            genreEditor: GenreEdit,

            cMSItemsIndex: CMSItemsIndex,
            cMSItemEditor: CMSItemEdit,
            backendMsgPage: BackendMsgPage,
            msgPage: MsgPage,

            contactPage: Contact,
            artistConcertPage: ArtistConcertPage,
            artistPage: ArtistPage,
            songPage: SongPage,
            songsWithSimilarTitlesPage: SongsWithSimilarTitles,
            settingsIndex: SettingsIndex,
            chartReportsPage: ChartReports,

        }
    },
    //             cmsItemPage: CmsItemPage,

    {path: '/not-found/:invalid_url?', component: NotFound, name: 'notFound'},
    {path: '/login', component: AppLogin, name: 'appLogin'},
    {
        path: '/',
       component: AppRoot, name: 'appRoot'
    },
    {path: '/register', component: UserRegister, name: 'userRegister'},
   ...

But in this case I got error in my console :

app.js?dt=1530007729:73635 Uncaught Error: [vue-router] "path" is required in a route configuration.
    at assert (app.js?dt=1530007729:73635)
    at addRouteRecord (app.js?dt=1530007729:74771)
    at app.js?dt=1530007729:74741
    at Array.forEach (<anonymous>)
    at createRouteMap (app.js?dt=1530007729:74740)
    at createMatcher (app.js?dt=1530007729:74961)
    at new VueRouter (app.js?dt=1530007729:76055)
    at Object._typeof (app.js?dt=1530007729:4945)
    at __webpack_require__ (app.js?dt=1530007729:20)
    at Object.<anonymous> (app.js?dt=1530007729:50854)

Could you give me example how route must be done here ?

25th June, 2018

mstdmstd started a new conversation Errors Running Npm Install • 3 months ago

Hello, I need to run laravel application on my local

$ lsb_release -d; uname -r; uname -i
Description:    Ubuntu 18.04 LTS
4.15.0-23-generic
x86_64


$ nodejs --version 
v10.5.0


$ npm --version  
6.1.0


$ php artisan --version
Laravel Framework 5.6.26


$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 70 installs, 0 updates, 0 removals
  - Installing vlucas/phpdotenv (v2.4.0): Loading from cache
  - Installing symfony/css-selector (v4.1.1): Loading from cache
  - Installing tijsverkoyen/css-to-inline-styles (2.2.1): Loading from cache
  - Installing symfony/polyfill-php72 (v1.8.0): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.8.0): Loading from cache
  - Installing symfony/var-dumper (v4.1.1): Loading from cache
  - Installing symfony/routing (v4.1.1): Loading from cache
  - Installing symfony/process (v4.1.1): Loading from cache
  - Installing symfony/polyfill-ctype (v1.8.0): Loading from cache
  - Installing symfony/http-foundation (v4.1.1): Loading from cache
  - Installing symfony/event-dispatcher (v4.1.1): Loading from cache
  - Installing psr/log (1.0.2): Loading from cache
  - Installing symfony/debug (v4.1.1): Loading from cache
  - Installing symfony/http-kernel (v4.1.1): Loading from cache
  - Installing paragonie/random_compat (v2.0.15): Loading from cache
  - Installing symfony/finder (v4.1.1): Loading from cache
  - Installing symfony/console (v4.1.1): Loading from cache
  - Installing doctrine/lexer (v1.0.1): Loading from cache
  - Installing egulias/email-validator (2.1.4): Loading from cache
  - Installing swiftmailer/swiftmailer (v6.0.2): Loading from cache
  - Installing ramsey/uuid (3.7.3): Loading from cache
  - Installing psr/simple-cache (1.0.1): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Installing symfony/translation (v4.1.1): Loading from cache
  - Installing nesbot/carbon (1.25.0): Loading from cache
  - Installing monolog/monolog (1.23.0): Loading from cache
  - Installing league/flysystem (1.0.45): Loading from cache
  - Installing erusev/parsedown (1.7.1): Loading from cache
  - Installing dragonmantank/cron-expression (v2.2.0): Loading from cache                                                                                                                                                                    
  - Installing doctrine/inflector (v1.3.0): Loading from cache                                                                                                                                                                               
  - Installing laravel/framework (v5.6.26): Loading from cache                                                                                                                                                                               
  - Installing fideloper/proxy (4.0.0): Loading from cache                                                                                                                                                                                   
  - Installing nikic/php-parser (v4.0.2): Loading from cache                                                                                                                                                                                 
  - Installing jakub-onderka/php-console-color (0.1): Loading from cache                                                                                                                                                                     
  - Installing jakub-onderka/php-console-highlighter (v0.3.2): Loading from cache                                                                                                                                                            
  - Installing dnoegel/php-xdg-base-dir (0.1): Loading from cache                                                                                                                                                                            
  - Installing psy/psysh (v0.9.6): Loading from cache                                                                                                                                                                                        
  - Installing laravel/tinker (v1.0.7): Loading from cache                                                                                                                                                                                   
  - Installing fzaninotto/faker (v1.7.1): Loading from cache                                                                                                                                                                                 
  - Installing hamcrest/hamcrest-php (v2.0.0): Loading from cache                                                                                                                                                                            
  - Installing mockery/mockery (1.1.0): Loading from cache                                                                                                                                                                                   
  - Installing filp/whoops (2.2.0): Loading from cache                                                                                                                                                                                       
  - Installing nunomaduro/collision (v2.0.3): Loading from cache                                                                                                                                                                             
  - Installing sebastian/version (2.0.1): Loading from cache                                                                                                                                                                                 
  - Installing sebastian/resource-operations (1.0.0): Loading from cache
  - Installing sebastian/object-reflector (1.1.1): Loading from cache
  - Installing sebastian/recursion-context (3.0.0): Loading from cache
  - Installing sebastian/object-enumerator (3.0.3): Loading from cache
  - Installing sebastian/global-state (2.0.0): Loading from cache
  - Installing sebastian/exporter (3.1.0): Loading from cache
  - Installing sebastian/environment (3.1.0): Loading from cache
  - Installing sebastian/diff (3.0.1): Loading from cache
  - Installing sebastian/comparator (3.0.1): Loading from cache
  - Installing phpunit/php-timer (2.0.0): Loading from cache
  - Installing phpunit/php-text-template (1.2.1): Loading from cache
  - Installing phpunit/php-file-iterator (2.0.1): Loading from cache
  - Installing theseer/tokenizer (1.1.0): Loading from cache
  - Installing sebastian/code-unit-reverse-lookup (1.0.1): Loading from cache
  - Installing phpunit/php-token-stream (3.0.0): Loading from cache
  - Installing phpunit/php-code-coverage (6.0.7): Loading from cache
  - Installing doctrine/instantiator (1.1.0): Loading from cache
  - Installing webmozart/assert (1.3.0): Loading from cache
  - Installing phpdocumentor/reflection-common (1.0.1): Loading from cache
  - Installing phpdocumentor/type-resolver (0.4.0): Loading from cache
  - Installing phpdocumentor/reflection-docblock (4.3.0): Loading from cache
  - Installing phpspec/prophecy (1.7.6): Loading from cache
  - Installing phar-io/version (1.0.1): Loading from cache
  - Installing phar-io/manifest (1.0.1): Loading from cache
  - Installing myclabs/deep-copy (1.8.1): Loading from cache
  - Installing phpunit/phpunit (7.2.6): Loading from cache
symfony/var-dumper suggests installing ext-intl (To show region name in time zone dump)
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/dependency-injection (For loading routes from a service)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/routing suggests installing symfony/yaml (For using the YAML loader)
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/http-kernel suggests installing symfony/browser-kit ()
symfony/http-kernel suggests installing symfony/config ()
symfony/http-kernel suggests installing symfony/dependency-injection ()
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/console suggests installing symfony/lock ()
egulias/email-validator suggests installing ext-intl (PHP Internationalization Libraries are required to use the SpoofChecking validation)
ramsey/uuid suggests installing ircmaxell/random-lib (Provides RandomLib for use with the RandomLibAdapter)
ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)
ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)
ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).)
ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.)
ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid)
symfony/translation suggests installing symfony/config ()
symfony/translation suggests installing symfony/yaml ()
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications)
laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (~3.0).)
laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (~2.6).)
laravel/framework suggests installing guzzlehttp/guzzle (Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).)
laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (~1.0).)
laravel/framework suggests installing league/flysystem-cached-adapter (Required to use the Flysystem cache (~1.0).)
laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)
laravel/framework suggests installing league/flysystem-sftp (Required to use the Flysystem SFTP driver (~1.0).)
laravel/framework suggests installing nexmo/client (Required to use the Nexmo transport (~1.0).)
laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (~3.0).)
laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (~1.0).)
laravel/framework suggests installing pusher/pusher-php-server (Required to use the Pusher broadcast driver (~3.0).)
laravel/framework suggests installing symfony/dom-crawler (Required to use most of the crawler integration testing tools (~4.0).)
laravel/framework suggests installing symfony/psr-http-message-bridge (Required to psr7 bridging features (~1.0).)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
filp/whoops suggests installing whoops/soap (Formats errors as SOAP responses)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.6.0)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0)
phpunit/phpunit suggests installing ext-soap (*)
phpunit/phpunit suggests installing ext-xdebug (*)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nunomaduro/collision
Package manifest generated successfully.

But I have errors running npm install :

$ npm install

> [email protected] install /mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/serge/.npm/node-sass/4.9.0/linux-x64-64_binding.node

> [email protected] postinstall /mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> [email protected] postinstall /mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/node-sass
> node scripts/build.js

Binary found at /mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/node-sass/vendor/linux-x64-64/binding.node
Testing binary
Binary is fine

> [email protected] postinstall /mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/gifsicle
> node lib/install.js

  ✔ gifsicle pre-build test passed successfully

> [email protected] postinstall /mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/mozjpeg
> node lib/install.js

  ✔ mozjpeg pre-build test passed successfully

> [email protected] postinstall /mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/optipng-bin
> node lib/install.js

  ✔ optipng pre-build test passed successfully

> [email protected] postinstall /mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin
> node lib/install.js

  ⚠ The `/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✔ pngquant pre-build test passed successfully
  ✖ Error: pngquant failed to build, make sure that libpng-dev is installed
    at Promise.all.then.arr (/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/decompress-response'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/p-cancelable'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/p-reduce'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/isurl'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/decompress-tarbz2/node_modules/file-type'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/ext-list'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/download/node_modules/get-stream'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/got/node_modules/get-stream'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/file-type'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/p-map-series'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/download/node_modules/pify'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/mimic-response'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/is-natural-number'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/p-event'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/pify'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/decompress-unzip/node_modules/file-type'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/strip-dirs'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/get-proxy'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/sort-keys-length'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/get-stream'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/url-to-options'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/tunnel-agent'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/ext-name'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/decompress-targz'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/p-timeout'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/caw'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/bin-build/node_modules/get-stream'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/duplexer3'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/decompress-tar'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/base64-js'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/decompress'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/execa/node_modules/get-stream'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/filenamify'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/filename-reserved-regex'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/timed-out'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/img-loader'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/has-to-string-tag-x'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/config-chain'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/npm-conf'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/proto-list'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/is-object'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/unbzip2-stream'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/has-symbol-support-x'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/execa/node_modules/cross-spawn'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/buffer'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/laravel-mix'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/execa/node_modules/cross-spawn'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/bin-build/node_modules/get-stream'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/decompress-targz'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/download/node_modules/get-stream'
npm WARN rollback Rolling back decompress-ta[email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/decompress-tarbz2/node_modules/file-type'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/got/node_modules/get-stream'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/pngquant-bin/node_modules/decompress-unzip/node_modules/file-type'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk/node_modules/imagemin-pngquant/node_modules/cross-spawn'
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"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall 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/2018-06-26T03_35_30_550Z-debug.log

and I have file /home/serge/.npm/_logs/2018-06-26T03_35_30_550Z-debug.log(more 800 kb), so last lines with errors :

34849 silly saveTree │ └── [email protected]
34849 silly saveTree ├── [email protected]
34849 silly saveTree ├── [email protected]
34849 silly saveTree └── [email protected]
34850 warn optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
34851 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
34852 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
34852 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
34852 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
34852 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
34853 verbose stack Error: [email protected] postinstall: `node lib/install.js`
34853 verbose stack Exit status 1
34853 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16)
34853 verbose stack     at EventEmitter.emit (events.js:182:13)
34853 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
34853 verbose stack     at ChildProcess.emit (events.js:182:13)
34853 verbose stack     at maybeClose (internal/child_process.js:961:16)
34853 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
34854 verbose pkgid [email protected]
34855 verbose cwd /mnt/_work_sdb8/wwwroot/ukfxdev/new.exchangerates.org.uk
34856 verbose Linux 4.15.0-23-generic
34857 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
34858 verbose node v10.5.0
34859 verbose npm  v6.1.0
34860 error code ELIFECYCLE
34861 error errno 1
34862 error [email protected] postinstall: `node lib/install.js`
34862 error Exit status 1
34863 error Failed at the [email protected] postinstall script.
34863 error This is probably not a problem with npm. There is likely additional logging output above.
34864 verbose exit [ 1, true ]

Why I have errors and how to fix them ?

Thanks!

mstdmstd started a new conversation How To Set Vue Component When Root Of Site Is Opened • 3 months ago

Hello! In my laravel 5.6/vue.js 2.5.7 / vuetify": "^1.0.8" I need to set vue component when root of site is opened I mean when I run url

http://local-artists-rating.com

see url reopened:

http://local-artists-rating.com/#/

It has navbar, footer defined in my pages, but not any content I defined in resources/assets/js/components/appRoot.vue.

In my resources/assets/js/app.js:

require('./bootstrap');

window.Vue = require('vue');

import Vue from 'vue'

import VueRouter from 'vue-router';
window.Vue.use(VueRouter);

...
import AppRoot from './components/appRoot.vue';
...

const routes = [
{
    path: '/',
    components: {
        ...
        appRoot: AppRoot,
        ...

    }
    ...

    {path: '/not-found/:invalid_url?', component: NotFound, name: 'notFound'},
    {path: '/login', component: AppLogin, name: 'appLogin'},
    {path: '/', component: AppRoot, name: 'appRoot'},
}
    ...

const router = new VueRouter( {
    mode: 'hash', // default
    routes
})


router.beforeEach((to, from, next) => {
    if (!to.matched.length) {
        next(  '/not-found/'+encodeURIComponent(to.path)  );
    } else {
        next();
    }
})



...

new Vue({ router, i18n,

    data:{
        app_title: '',
    },

    mixins : [appMixin],

    created() {
    }, // created() {

    mounted() {

    }, // mounted(){


} ).$mount('#app')  // new Vue({ router,

If I commented line :

path: '/',
at top of routes definitions, I got error in console:
app.js?dt=1529909735:73635 Uncaught Error: [vue-router] "path" is required in a route configuration.
    at assert (app.js?dt=1529909735:73635)
    at addRouteRecord (app.js?dt=1529909735:74771)
    at app.js?dt=1529909735:74741
    at Array.forEach (<anonymous>)
    at createRouteMap (app.js?dt=1529909735:74740)
    at createMatcher (app.js?dt=1529909735:74961)
    at new VueRouter (app.js?dt=1529909735:76055)
    at Object._typeof (app.js?dt=1529909735:4945)
    at __webpack_require__ (app.js?dt=1529909735:20)
    at Object.<anonymous> (app.js?dt=1529909735:50854)

In my resources/views/layouts/app.blade.php:

<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
    <?php $current_template= 'artists_rating_light' ?>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Cache-Control" content="no-cache">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title id="app_title">{{ config('app.name', 'Laravel') }}</title>


    <link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css">
    <link href="https://use.fontawesome.com/releases/v5.0.8/css/all.css" rel="stylesheet">

</head>

<body>

<div id="app">

    <backend-app-layout></backend-app-layout>

</div>

    @include('layouts.footer')
    <script src="{{ asset('js/app.js'    ) }}{{  "?dt=".time()  }}"></script>

</body>

</html>

Which is the right way ?

Thanks!

19th June, 2018

mstdmstd left a reply on How From Login Controller Run VueRouter Path • 3 months ago

Sorry, I still search for a decision! I found a way :

            $url= "/home#/admin/dashboard/google_new_user/" . urlencode($loggedUser->username);
            return redirect($url);

Sometimes it works, but not always and I do not is there is a valid way of this?

15th June, 2018

mstdmstd started a new conversation How In Vue.js / Vue-router / Vue-i18n To Switch Between Languages? • 3 months ago

Hello, In my laravel 5.6 / vue.js 2.5.7/ vue-router": "^3.0.1" / Bootstrap4.1.0 application I added i18n support using https://github.com/kazupon/vue-i18n (^7.8.0") plugin

Can you please advice/give reference to a suitable plugin/script to switch between languages?

Thanks!

13th June, 2018

mstdmstd started a new conversation How To Import Data From Magento 1.9 Into Laravel 5.5 • 3 months ago

Hello,

Having Laravel Framework 5.5.40 I need to import data from Magento 1.9 I found this https://github.com/michaelkmartin/laravel-magento-integration plugin

Bit it is Compatible with Laravel 4 only.

I tried to install it and got errors:

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package tinyrocket/magento 1.0.* is satisfiable by tinyrocket/magento[1.0.x-dev] but these conflict with your requirements or minimum-stability.

Can you advice some Compatible with Laravel 5.5 tool ?

Thanks!

7th June, 2018

mstdmstd started a new conversation With Eloquent To Make Search By 2 Fields • 3 months ago

Hello, If there si a way in laravel 5.6 with eloquent to make search with condition:

- need to check if sale_price is set then search in sale_price else in retail_price

?

Have I use condition like :

  \DB::raw( ‘ isNull( sale_price, retail_price ) > 10’ )

? and how to make in search above if both sale_price and retail_price are null?

Or there is better decision ?

Thanks!

5th June, 2018

mstdmstd left a reply on I Have Require Is Not Defined Error • 3 months ago

In the comments of the example there was fixing issue using Mustache.js: https://github.com/yajra/laravel-datatables/issues/1511 I follow it, as :

@extends('layouts.master')

@section('content')


    <table class="table table-bordered" id="users-table">
        <thead>
        <tr>
            <th>Id</th>
            <th>Name</th>
            <th>Email</th>
            <th>Created At</th>
            <th>Updated At</th>
        </tr>
        </thead>
    </table>

@stop

@push('scripts')

    <script src="//cdnjs.cloudflare.com/ajax/libs/mustache.js/2.3.0/mustache.min.js"></script>

    <script id="details-template" type="mustache/x-tmpl">
    <table class="table">
        <tr>
            <td>Full name:</td>
            <td><%name%></td>
        </tr>
        <tr>
            <td>Email:</td>
            <td><%email%></td>
        </tr>
        <tr>
            <td>Extra info:</td>
            <td>And any further details here (images etc)...</td>
        </tr>
    </table>
    </script>

    <script  >

        $(function() {

            Mustache.tags = ["<%", "%>"];
            var template = $('#details-template').html();

            console.log("template::")
            console.log( template )

            var table= $('#users-table').DataTable({
                processing: true,
                serverSide: true,
                ajax: '{!! route('get_users') !!}',
                columns: [
                    {
                        "className":      'details-control',
                        "orderable":      false,
                        "searchable":     false,
                        "data":           null,
                        "defaultContent": ''
                    },
                    
                    { data: 'id', name: 'id' },
                    { data: 'name', name: 'name' },
                    { data: 'email', name: 'email' },
                    { data: 'created_at', name: 'created_at' },
                    { data: 'updated_at', name: 'updated_at' }
                ]
            });


            // Add event listener for opening and closing details
            $('#users-table tbody').on('click', 'td.details-control', function () {
                console.log( '-1' )
                var tr = $(this).closest('tr');
                console.log("-2 tr::")
                console.log( tr )

                var row = table.row( tr );
                console.log("-3 row::")
                console.log( row )


                if ( row.child.isShown() ) {
                    // This row is already open - close it
                    row.child.hide();
                    tr.removeClass('shown');
                }
                else {
                    // Open this row
//                    row.child( template(row.data()) ).show();
                    row.child( Mustache.render(template, row.data()) ).show();
                    console.log("row::")
                    console.log( row )


                    tr.addClass('shown');
                }
            });
        });
    </script>

@endpush

And I got error :

jquery.dataTables.min.js:59 Uncaught TypeError: Cannot read property 'style' of undefined
    at Ga (jquery.dataTables.min.js:59)
    at ga (jquery.dataTables.min.js:45)
    at HTMLTableElement.<anonymous> (jquery.dataTables.min.js:93)
    at Function.each (jquery.js:383)
    at jQuery.fn.init.each (jquery.js:136)
    at jQuery.fn.init.m [as dataTable] (jquery.dataTables.min.js:83)
    at jQuery.fn.init.P.h.fn.DataTable (jquery.dataTables.min.js:159)
    at HTMLDocument.<anonymous> (index:89)
    at fire (jquery.js:3119)
    at Object.fireWith [as resolveWith] (jquery.js:323```
1)

Looking at the console the template code was found: https://imgur.com/a/WOJPsUw as there were misunderstanding of where to put the template

I have no error if to remove the definition of the first column:
                    {
                        "className":      'details-control',
                    ...

Is there a way to fix it ?

mstdmstd left a reply on I Have Require Is Not Defined Error • 3 months ago

With resource https://stackoverflow.com/questions/950087/how-do-i-include-a-javascript-file-in-another-javascript-file I try to fix the error by example :

I just wrote this JavaScript code (using Prototype for DOM manipulation):

For tis I copied file /public/js/require.js ( Prototype JavaScript framework, version 1.7.2 ) and file public/js/require.js by url https://gist.github.com/nornagon/284442

and in my blade template :

<script src="/js/prototype.js"></script>
<script src="/js/require.js"></script>
@section('javascript')

and got error :

Uncaught TypeError: element.attachEvent is not a function
    at observeStandardEvent (prototype.js:6950)
    at observe (prototype.js:6940)
    at HTMLScriptElement._methodized [as observe] (prototype.js:456)
    at require.js:21
    at showArticleListing (articles:1021)
    at HTMLDocument.<anonymous> (articles:896)
    at c (app.js:24)
    at u (app.js:24)

on a line :

            var Handlebars = require('handlebars');

On the link above there were several example of attaching js files. But my case is different , as having error :

Uncaught ReferenceError: Handlebars is not defined

I tried to include Handlebars, but in my project there is no any file like Handlebars.js...

?

3rd June, 2018

mstdmstd left a reply on I Have Require Is Not Defined Error • 3 months ago

after googlingI I installed

npm install requirejs 

with output

+ [email protected]
added 1 package from 1 contributor in 26.245s

But it did not help, I still get error :

ReferenceError: require is not

Have to include requirejs in some config files or in my script and how if yes?

2nd June, 2018

mstdmstd started a new conversation I Have Require Is Not Defined Error • 3 months ago

Hello,

Trying to implement datatables row-details functionality(https://datatables.yajrabox.com/eloquent/row-details) in my laravel 5.5.40/ Voyager template( "tcg/voyager": "^1.0" )/ Bootstrap 3.3.7 application I encountered an error:

app.js:24 Uncaught ReferenceError: Handlebars is not defined

Googling, I found a decision :

var Handlebars = require('handlebars');

But I got an error:

articles:915 Uncaught ReferenceError: require is not defined

I found which files are attached in the file config/voyager.php:

   ...
    // Here you can specify additional assets you would like to be included in the master.blade
    'additional_css' => [
        'css/bootstrap-tagsinput-typeahead.css',
        'css/bootstrap-tagsinput.css',
        'css/bootstrap-treeview.css',
        'css/customisation.css',
        'css/spectrum.css',
    ],

    'additional_js' => [
        'js/bootstrap-tagsinput.js',
        'js/spectrum.js',
    ],

... Can you give a hint, which file/plugin have I to attach to the list above? In the project I found a file /node_modules/webpack/lib/RequireJsStuffPlugin.js Is it what I need and how to attach it ?

Thanks!

24th May, 2018

mstdmstd started a new conversation How From Login Controller Run VueRouter Path • 4 months ago

Hello! In my laravel 5.6/vue.js / 2.5 / VueRouter 3.0.1 application I make login using twitter and in app/Http/Controllers/Auth/LoginController.php I have methods to auth twitter user. After that I need to show some common message , pointing to component, which I usually call as:

        <router-link :to="{name: 'msgPage', params: {msg: 'sometext', type:'warning', redirect: 'redirect_url'} }">
                Smg Test
        </router-link>

which is rendered into url like:

http://local-artists-rating.com/home#/admin/msg/sometext111%20222%20333/error/login

But I wander how correctly run from php control VueRouter component ?

Thanks!

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.