mstdmstd

mstdmstd

Member Since 1 Year Ago

Experience Points 7,330
Experience
Level
Lessons Completed 1
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

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

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

15 Nov
1 day ago

mstdmstd started a new conversation How To Make Search Laravel / Elasticsearch With Joined Tables?

Hello!

In my laravel 5.7/mysql app I use elasticsearch based on https://michaelstivala.com/learning-elasticsearch-with-laravel/ article. That is clear for me how to save/delete/search data which are besd one one table. But I have tables :

CREATE TABLE `votes` (
    `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(255) NOT NULL COLLATE 'utf8mb4_unicode_ci',
    `description` MEDIUMTEXT NOT NULL COLLATE 'utf8mb4_unicode_ci',

with searching on name and description fields

but I also have a table

CREATE TABLE `vote_items` (
    `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    `vote_id` INT(10) UNSIGNED NULL DEFAULT NULL,
    `name` VARCHAR(255) NOT NULL COLLATE 'utf8mb4_unicode_ci',

and I want to make search also on name field.

That seems somewhat tricky. In my vote model I defined methods to sync data with elasticsearch:

<?php

namespace App;

use DB;

class Vote extends Model
{
    protected $table = 'votes';
    protected $elasticsearch_type  = 'vote';
    protected $primaryKey = 'id';
    ...
    public function getElasticsearchType(): string
    {
        return $this->elasticsearch_type;
    }

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

        static::saved(function ($vote) {
            $elastic = app(\App\Elastic\Elastic::class);
            $elasticsearch_root_index  = config('app.elasticsearch_root_index');
            $elasticsearch_type        = with(new Vote)->getElasticsearchType();

            $elastic->delete([
                'index' => $elasticsearch_root_index,
                'type'  => $elasticsearch_type,
                'id'    => $vote->id,
            ]);

            if ($vote->status == 'A') { // only active votes must be saved in elasticsearch
                $elastic->index([
                    'index' => $elasticsearch_root_index,
                    'type'  => $elasticsearch_type,
                    'id'    => $vote->id,
                    'body'  => [
                        'id'          => $vote->id,
                        'slug'        => $vote->slug,
                        'name'        => $vote->name,
                        'description' => $vote->description,
                    ]
                ]);
            } // if ($vote->status == 'A') { // only active votes must be saved in elasticsearch

        });
        static::deleted(function ($vote ) {
            $elastic = app(\App\Elastic\Elastic::class);
            $elasticsearch_root_index  = config('app.elasticsearch_root_index');
            $elasticsearch_type        = with(new Vote)->getElasticsearchType();
            $elastic->delete([
                'index' => $elasticsearch_root_index,
                'type' => $elasticsearch_type,
                'id' => $vote->id,
            ]);
        });
    }


    public static function bulkVotesToElastic()
    {
        $elastic = app(\App\Elastic\Elastic::class);

        $elasticsearch_root_index  = config('app.elasticsearch_root_index');
        $elasticsearch_type        = with(new Vote)->getElasticsearchType();

        Vote::chunk(100, function ($Votes) use ($elastic, $elasticsearch_root_index, $elasticsearch_type) {
            foreach ($Votes as $nextVote) {
                if ($nextVote->status!= 'A') continue; // only active votes must be saved in elasticsearch
                $elastic->index([
                    'index' => $elasticsearch_root_index,
                    'type'  => $elasticsearch_type,
                    'id'    => $nextVote->id,
                    'body'  => [
                        'id'          => $nextVote->id,
                        'slug'        => $nextVote->slug,
                        'name'        => $nextVote->name,
                        'description' => $nextVote->description,
                    ]
                ]);
            }
        });
    }


}

I suppose that I could make similar methods for vote_items model and saved all data with different type, but I think that is not valid way... Have I to make vote_item element as child node of vote with elasticsearch syntax? Which way is valid? Are there some examples how this could be implemented ?

Thanks!

14 Nov
2 days ago

mstdmstd started a new conversation How To Make Redirection To Some Vue Form From Laravel's Control?

Hello! In my Laravel 5.6 application with vue.js 2.5.7 I and vue-router 3 I use Socialite for login into the system and in case of success I need to make redirection to some vue form with success message and next options available.

For this I make redirection like:

            $url= $site_hosting . "/home";
            return redirect()->route($url, [])->with([
                'text'   => 'google_new_user',
                'type'   => 'success',
                'action' => 'successful_login'
            ]);

where url has value like

http://mysite.com/home

the question is that I do not know how redirecting from Laravel control to point to Vue component, defined in resources/assets/js/app.js file as

const routes = [
    {
        components: {
            notFound: NotFound,
        ...

How can it be done ?

Thanks!

05 Nov
1 week ago

mstdmstd left a reply on Error Wrapping Elasticsearch Class

Sorry, I still search for decision... If somebody use this script?

mstdmstd left a reply on Error Wrapping Elasticsearch Class

On this

$elastic = \App\Elastic::class;

I got string value, so I got error next, as there must be object later

On this

        $elastic =app(App\Elastic::class);

line I got error

Class App\Elastic does not exist

Have I to make declaration in use block and which?

mstdmstd started a new conversation Error Wrapping Elasticsearch Class

Hello, In my Laravel 5.7 application I want to use elasticsearch and I found this https://michaelstivala.com/learning-elasticsearch-with-laravel/ article. Firstly I wanted to import all data from a table I want to use with elasticsearch

  1. I created a wrapper file app/Elastic.php, with content from githubusercontent. Is this proper dir for this file?

  2. In my model app/Vote.php I added function

    public static function bulkVotesToElastic()
    {

        $elastic = app(App\Elastic\Elastic::class);
        Vote::chunk(100, function ($Votes) use ($elastic) {
            foreach ($Votes as $Vote) {
                $elastic->index([
                    'index' => 'select_vote',
                    'type' => 'vote',
                    'id' => $Vote->id,
                    'body' => $Vote->toArray()
                ]);
            }
        });
    }

As I have seeder for filling of init data. But calling this method I got error:

Class App\App\Elastic\Elastic does not exist

Why error and how to fix it?

actually this line

$elastic = app(App\Elastic\Elastic::class);

is behind my laravel expierense...

Thanks!

04 Nov
1 week ago

mstdmstd started a new conversation How To Stop Only Frontend Of App?

Hello, In 5 laravel with

php artisan down

command that is easily to stop working of all application with message, but if there is a way to stop in similar way only frontend, while admins have access to backend?

when all backend routes are defined in routes/web.php as :

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

Thanks!

02 Nov
2 weeks ago

mstdmstd left a reply on How To Fix Doctrine\\DBAL\\Driver\\PDOException Error In Docker With Laravel 5 App

Sorry, I still search for decision... No ideas?

01 Nov
2 weeks ago

mstdmstd left a reply on How To Fix Doctrine\\DBAL\\Driver\\PDOException Error In Docker With Laravel 5 App

In composer.json of the project I added "doctrine/dbal": "~2.5" declaration under "require" and now this file is :

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "barryvdh/laravel-debugbar": "^2.3",
        "graham-campbell/markdown": "^8.0",
        "intervention/image": "^2.3",
        "khill/lavacharts": "3.0.*",
        "laravel/framework": "5.5.*",
        "laravel/socialite": "^3.0",
        "laravel/tinker": "~1.0",
        "laravelcollective/html": "^5.4.0",
        "nwidart/laravel-modules": "^2.2",
        "doctrine/dbal": "~2.5",
        "wboyz/laravel-enum": "^0.2.1"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~6.0",
        "stolz/laravel-html-tidy": "^0.1.1",
        "xethron```
/migrations-generator": "^2.0",
        "filp/whoops" : "~2.0" 
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\": "app/",
            "Modules\": "Modules/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\Foundation\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\Foundation\ComposerScripts::postUpdate",
            "php artisan optimize"
        ],

        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]

    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    }
}

I rebuilded the app, cleared the cache, but running the app I got errors in log file :

[2018-11-01 12:40:09] local.ERROR: could not find driver {"exception":"[object] (Doctrine\DBAL\Driver\PDOException(code: 0): could not find driver at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:47, PDOException(code: 0): could not find driver at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43)
[stacktrace]
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(64): Doctrine\DBAL\Driver\PDOConnection->__construct('pgsql:host=127....', 'postgres', '1', Array)
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(43): Illuminate\Database\Connectors\Connector->createPdoConnection('pgsql:host=127....', 'postgres', '1', Array)
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php(33): Illuminate\Database\Connectors\Connector->createConnection('pgsql:host=127....', Array, Array)
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(183): Illuminate\Database\Connectors\PostgresConnector->connect(Array)
#4 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
...
  1. Was my declaration invalid ?
  1. I tried to run in my container box but got :
# composer require doctrine/dbal
bash: composer: command not found

I suppose that in my container box I can try to install composer , but is it proper way ?

What would you advice ?

mstdmstd left a reply on How To Fix Doctrine\\DBAL\\Driver\\PDOException Error In Docker With Laravel 5 App

Do you mean that before setting docker container the composer.json ALREADY MUST HAVE referance to doctrine/dbal ?

It does not any "doctrine/dbal" or "doctrine" line.

But looking at my composer.lock I see lines :

...
            "require-dev": {
                "aws/aws-sdk-php": "~3.0",
                "doctrine/dbal": "~2.5",
                ...
            },
...
        {
            "name": "doctrine/dbal",
            "version": "v2.5.13",
            "source": {
                "type": "git",
                "url": "https://github.com/doctrine/dbal.git",
                "reference": "729340d8d1eec8f01bff708e12e449a3415af873"
            },
...
            "require": {
                "doctrine/dbal": "~2.4",
...

Have I to add to

    "require": {

block of my composer.json

line :
         "doctrine/dbal": "~2.5",

and rebuild the docker ?

I wonder why the definition of doctrine/dbal is not in my composer.json, as far as I remember I installed it in command line :

composer require doctrine/dbal

How correctly to salve it?

mstdmstd started a new conversation How To Fix Doctrine\\DBAL\\Driver\\PDOException Error In Docker With Laravel 5 App

Hello! I have problem with running my laravel 5.5/postgres app in docker asp I see error in my logs

could not find driver {"exception":"[object] (Doctrine\DBAL\Driver\PDOException

usually to fix this error I have to run in console of my ubuntu :

composer require doctrine/dbal

I have in file docker-compose.yml :

...
    lprods_composer:
        image: composer:1.6
        container_name: lprods_composer_container
        volumes:
            - ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
        working_dir: ${APP_PTH_CONTAINER}
        command: composer install  --ignore-platform-reqs

Which way is to salve it? I suppose I have to set this option in my docker-compose.yml file ?

Thanks!

31 Oct
2 weeks ago

mstdmstd started a new conversation Names Of Containers In Docker-compose ?

Hello ! I have several laravel/mysql/postgres appplication under docker and writing docker-compose.yml I prefer to give unique and sensible

version: '3'

services:

    votes_app:
        build:
            context: ./web
            dockerfile: Dockerfile.yml
        
        container_name: votes_app_container
        environment:
            - APACHE_RUN_USER=#1000
        volumes:
            - ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
        ports:
            - 8081:80
        working_dir: ${APP_PTH_CONTAINER}


    votes_db:
        image: mysql:5.6.41
        container_name: votes_db_container

        restart: always
        environment: 
            MYSQL_ROOT_PASSWORD: 1
        volumes:
            - ${DB_PATH_HOST}:/var/lib/mysql

My question is if "votes_db" is the same as "votes_db_container" in mysql scheme above I found that is I want to look at logs on installing I need to write :

docker logs --tail=20 votes_db_container   

but when connecting to adminer I set “votes_db” in connection parameters, looks “votes_db_container” does not work here ...

Can you advice which name rules better to follow ?

Thanks!

28 Oct
2 weeks ago

mstdmstd left a reply on How To Run Set Of Tests In Cron ?

I do not see onNotSuccessfulTest mentioned here https://laravel.com/docs/5.7/http-tests ?

Googling I found onNotSuccessfulTest mentioned in phpunit, but I hardly remember it, I worked with it many years ago.

I made some tests and looks like if I define method

    protected function onNotSuccessfulTest(\Throwable $e)
    {
        \Log::info( ' HomepageTest Error::'. $e->getMessage() ); // does not work
        ...

Then in case of error in my tests erros are not shown in console and in console I see that all tests are ok? That is something not good for me?

While debugging I on my local laptop I pefer something simpler in debuggin not email

But calling method \Log::info( I got error

Error: Call to undefined method Illuminate\Support\Facades\Log::info()

that was strange, as far as I remember that method is common. not in tests? can you advice some simple debugging way?


Thanks!
27 Oct
2 weeks ago

mstdmstd started a new conversation How To Run Set Of Tests In Cron ?

Hello.

In my Laravel 5.7 app I make several http tests and they work as I excepect when I run them manualy. If there is a way/tool/plugin to run set of tests (say in cron) and got results of them(or better results having errors) and notify admin of the site by email ?

Thanks!

24 Oct
3 weeks ago

mstdmstd started a new conversation Error In Custom Validation

Hello.

Using spatie/laravel-tags plugin in my Laravel 5.7 app.

I make editor of tags, so that admin would be able to add tags . However, I need to make validation on tags uniqueness. So I did in app/Http/Requests/TagRequest.php :

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;
use App\Rules\TagUniqueness;


class TagRequest extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        // $request= Request();

        return [
            'name' => [
                'required',
                'string',
                'max:255',
                new TagUniqueness,
            ],
            'order_column'         => 'nullable|integer',
        ];

    }
}

I need custom validation as for this plugin field name is json and is in format

{"en": "Drama"}

and I created rule app/Rules/TagUniqueness.php has:

<?php

namespace App\Rules;

use Illuminate\Contracts\Validation\Rule;

class TagUniqueness implements Rule
{
    public function __construct()
    {
        $this->d( '<pre>TagUniqueness $_REQUEST::' . print_r( $_REQUEST, true ) );
    }

    public function passes($attribute, $value)
    {

        $this->d( '<pre>passes  $attribute::' . print_r( $attribute, true ) );
        $this->d( '<pre>passes  $value::' . print_r( $value, true ) );
        return false;

    }
    ...

and I recieved this error:

 "message": "trim() expects parameter 1 to be string, object given",
    "exception": "ErrorException",
    "file": "/mnt/_work_sdb8/wwwroot/lar/Votes/vendor/laravel/framework/src/Illuminate/Validation/ValidationRuleParser.php",
    "line": 217,
    "trace": [
        {
            "function": "handleError",
            "class": "Illuminate\Foundation\Bootstrap\HandleExceptions",
            "type": "->"
        },
        {
            "file": "/mnt/_work_sdb8/wwwroot/lar/Votes/vendor/laravel/framework/src/Illuminate/Validation/ValidationRuleParser.php",
            "line": 217,
            "function": "trim"
        },
        {
            "file": "/mnt/_work_sdb8/wwwroot/lar/Votes/vendor/laravel/framework/src/Illuminate/Validation/ValidationRuleParser.php",
            "line": 199,
            "function": "parseArrayRule",
            "class": "Illuminate\Validation\ValidationRuleParser",
            "type": "::"
        },
        {
            "file": "/mnt/_work_sdb8/wwwroot/lar/Votes/vendor/proengsoft/laravel-jsvalidation/src/Remote/Validator.php",
            "line": 161,
            "function": "parse",
            "class": "Illuminate\Validation\ValidationRuleParser",
            "type": "::"
        },
        {
            "file": "/mnt/_work_sdb8/wwwroot/lar/Votes/vendor/proengsoft/laravel-jsvalidation/src/Remote/Validator.php",
            "line": 144,
            "function": "purgeNonRemoteRules",
            "class": "Proengsoft\JsValidation\Remote\Validator",
            "type": "->"
        },
        {
            "file": "/mnt/_work_sdb8/wwwroot/lar/Votes/vendor/proengsoft/laravel-jsvalidation/src/Remote/Validator.php",
            "line": 116,
            "function": "setRemoteValidation",
            "class": "Proengsoft\JsValidation\Remote\Validator",
            "type": "->"
        },
        {

as $this->d( my debugging method, I see output of TagUniqueness' s constructer, but passes method IS NOT CALLED and I can not define the reason of this error.

What is wrong?

Thanks!

22 Oct
3 weeks ago

mstdmstd left a reply on Unsupported Platform For Fsevents Error On Old Project

looks like command

npm cache --force clean && npm install --force node-sass 

helped

mstdmstd left a reply on Unsupported Platform For Fsevents Error On Old Project

Sorry, I still suffer this problem... If there is a way to recollect project from the start?

20 Oct
3 weeks ago

mstdmstd started a new conversation How To Fix Null Given Error In Laravel-dump-server?

Hello, I added "beyondcode/laravel-dump-server": "^1.2" to my Laravel 5.7 application and sometimes I got error

[2018-10-18 03:44:02] local.ERROR: Argument 1 passed to Symfony\Component\VarDumper\Dumper\HtmlDumper::dump() must be an instance of Symfony\Component\VarDumper\Cloner\Data, null given, called in /mnt/_work_sdb8/wwwroot/lar/Votes/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php on line 47 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Argument 1 passed to Symfony\Component\VarDumper\Dumper\HtmlDumper::dump() must be an instance of Symfony\Component\VarDumper\Cloner\Data, null given, called in /mnt/_work_sdb8/wwwroot/lar/Votes/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php on line 47 at /mnt/_work_sdb8/wwwroot/lar/Votes/vendor/symfony/var-dumper/Dumper/HtmlDumper.php:111)
[stacktrace]

I run server in my console as :

php artisan dump-server --format=html > public/dump.html

I added wrapper method to common trait of my app:

<?php

namespace App\Http\Traits;

use File;
use Barryvdh\Debugbar\Facade as Debugbar;
use Carbon\Carbon;
use Config;
use Intervention\Image\Facades\Image as Image;
trait funcsTrait
{
    public function d($data)
    {

        if (empty($data)) {
            return;
        }

        dump($data);
    }

and calling this method in  my control :
     $this->d('ProfilePageTest Test51:: $newUserSessionData::' . print_r($newUserSessionData, true));

And sometimes I got error described above. In my wrapper I tried to exclude calling of dump with empty value, supposing that empty value could be reason of this error ? But looks like the reason was different. If there is a way make work it properly?

Thanks!

19 Oct
4 weeks ago

mstdmstd left a reply on Unsupported Platform For Fsevents Error On Old Project

I have no permissions / ownership errors. I mean I deleted node_modules and /tmp/empty-cache directories manually but anyway I have error with Unsupported platform for fsevents. I tried to clear some old cache...

Can you say me what use fsevents ? Is is dependency ?

mstdmstd left a reply on Unsupported Platform For Fsevents Error On Old Project

Thank you for your feedback! I tried by :

$ npm cache clean && npm install node-sass
npm ERR! As of [email protected], the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.                                       
npm ERR!                                                                                                                                                                                                               
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.                                                                                                                          
                                                                                                                                                                                                                       
npm ERR! A complete log of this run can be found in:                                                                                                                                                                   
npm ERR!     /home/serge/.npm/_logs/2018-10-19T03_40_05_165Z-debug.log    

and file /home/serge/.npm/_logs/2018-10-19T03_40_05_165Z-debug.log has:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'cache', 'clean' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 16ca2027052c8acd
5 verbose stack Error: As of [email protected], the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
5 verbose stack
5 verbose stack If you're sure you want to delete the entire cache, rerun this command with --force.
5 verbose stack     at clean (/usr/lib/node_modules/npm/lib/cache.js:72:22)
5 verbose stack     at EventEmitter.cache (/usr/lib/node_modules/npm/lib/cache.js:47:16)
5 verbose stack     at Object.commandCache.(anonymous function) (/usr/lib/node_modules/npm/lib/npm.js:159:13)
5 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/bin/npm-cli.js:131:30)
5 verbose stack     at process._tickCallback (internal/process/next_tick.js:61:11)
6 verbose cwd /mnt/_work_sdb8/wwwroot/lar/csvp
7 verbose Linux 4.15.0-36-generic
8 verbose argv "/usr/bin/node" "/usr/bin/npm" "cache" "clean"
9 verbose node v10.11.0
10 verbose npm  v6.4.1
11 error As of [email protected], the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
11 error
11 error If you're sure you want to delete the entire cache, rerun this command with --force.
12 verbose exit [ 1, true ]

I try as it was advised in output :

$ npm cache verify                                                                                                                                                         
Cache verified and compressed (~/.npm/_cacache):                                                                                                                                                                       
Content verified: 2945 (143792716 bytes)                                                                                                                                                                               
Content garbage-collected: 462 (20154568 bytes)                                                                                                                                                                        
Index entries: 4512                                                                                                                                                                                                    
Finished in 4.802s                                                                                                                                                                                                     
[email protected]:/mnt/_work_sdb8/wwwroot/lar/csvp$ npm install --cache /tmp/empty-cache 

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 scripts/build.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!     /tmp/empty-cache/_logs/2018-10-19T03_45_30_728Z-debug.log

and the same error. I wonder how it worked more 1 year ago and can it be that I have to exclude some packages from my composer.json and package.json?

I tried to delete node_modules and /tmp/empty-cache directories manually but I got errors anyway... Is it old cache issue? Can it help deleting of some directories manually?

18 Oct
4 weeks ago

mstdmstd started a new conversation Unsupported Platform For Fsevents Error On Old Project

Hello, I try to run my old laravel 5.5 and got a lot of errors on npm install like:

...
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/lar/csvp/node_modules/cryptiles/node_modules/boom'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/lar/csvp/node_modules/fsevents/node_modules/rc/node_modules/minimist'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/lar/csvp/node_modules/fsevents/node_modules/aproba'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/lar/csvp/node_modules/request/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/lar/csvp/node_modules/sass-graph/node_modules/yargs'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): ENOTEMPTY: directory not empty, rmdir '/mnt/_work_sdb8/wwwroot/lar/csvp/node_modules/node-gyp/node_modules/semver'
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 scripts/build.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-10-18T11_45_59_931Z-debug.log

And very big 2018-10-18T11_45_59_931Z-debug.log file at https://pastebin.com/UA3Zb4bH:


I tried to google but failed...

composer.json :

{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "php": ">=7.0.0", "doctrine/dbal": "^2.5", "fideloper/proxy": "~3.3", "intervention/image": "^2.4", "laravel/framework": "5.5.*", "laravel/tinker": "~1.0", "maatwebsite/excel": "~2.1.0", "mcamara/laravel-localization": "^1.3", "rcrowe/twigbridge": "^0.9.5", "sebastiansulinski/dotenv": "^2.0", "sebastiansulinski/php-backup": "^2.0", "spatie/dropbox-api": "^1.6", "spatie/flysystem-dropbox": "^1.0", "spatie/laravel-backup": "^3.0.0" }, "require-dev": { "filp/whoops": "~2.0", "fzaninotto/faker": "~1.4", "mockery/mockery": "~1.0", "phpunit/phpunit": "~6.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 } }


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.17", "bootstrap-sass": "^3.3.7", "cross-env": "^5.0.1", "jquery": "^3.2", "laravel-mix": "^1.0", "lodash": "^4.17.4", "vue": "^2.1.10" } }



$ npm -v 6.4.1 [email protected]:/mnt/_work_sdb8/wwwroot/lar/csvp$ node -v v10.11.0 [email protected]:/mnt/_work_sdb8/wwwroot/lar/csvp$ lsb_release -d; uname -r; uname -i Description: Ubuntu 18.04.1 LTS 4.15.0-36-generic x86_64


Why error and how to fix it ?

Thank you!
16 Oct
1 month ago

mstdmstd left a reply on Setting Docker For Laravel App I Got Errors In "compose/cli/main.py"

Thank you for your feedback! I wrote mysql version in my config file and added command option:

        image: mysql:5.7.23
        command: --default-authentication-plugin=mysql_native_password  --disable-partition-engine-check

and this error was fixed. So :

  1. In other console under root I run commands(But I still not sure if I need it?)
sudo service apache2 stop
sudo service  mysql stop
  1. Under nonroot console I run with key to run in background:
docker-compose up -d 
[email protected]:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker-compose down 
Stopping votes_docker_db_1      ... done
Stopping votes_docker_webapp_1  ... done
Stopping votes_docker_adminer_1 ... done
Removing votes_docker_db_1       ... done
Removing votes_docker_webapp_1   ... done
Removing votes_docker_composer_1 ... done
Removing votes_docker_adminer_1  ... done
Removing network votes_docker_default

docker-compose up -d 
Creating network "votes_docker_default" with the default driver
Creating votes_docker_webapp_1   ... done
Creating votes_docker_adminer_1  ... done
Creating votes_docker_db_1       ... done
Creating votes_docker_composer_1 ... done

I have no errors in output, but I expected as result to have vendor directory in my project, as I have in web/Dockerfile.yml :

FROM php:7.2-apache

RUN docker-php-ext-install \
    pdo_mysql \
    && a2enmod \
    rewrite

But I do not see this directory... The installation was not successful ?

I am not sure where to move next?

[email protected]:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker info
Containers: 33
 Running: 2
 Paused: 0
 Stopped: 31
Images: 19
Server Version: 17.12.1-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9b55aab90508bd389d7654c4baf173a981477d55
runc version: 9f9c96235cc97674e935002fc3d78361b696a69e
init version: v0.13.0 (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.15.0-36-generic
Operating System: Ubuntu 18.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.711GiB
Name: serge
ID: BDNU:HFWX:N6YV:IWYW:HJSU:SZ23:URPB:3FR2:7I3E:IFGK:AOLH:YRE5
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:                                                                                                                                                                                            
Experimental: false                                                                                                                                                                                
Insecure Registries:                                                                                                                                                                               
 127.0.0.0/8                                                                                                                                                                                       
Live Restore Enabled: false                                                                                                                                                                        

WARNING: No swap limit support
[email protected]:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker images
REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
votes_docker_webapp   latest              519d1b33af81        27 hours ago        378MB
adminer               latest              0038b45402de        4 weeks ago         81.7MB
composer              1.6                 e28b5b53ab28        4 weeks ago         154MB
php                   7.2-apache          a7d68dad7584        4 weeks ago         378MB
mysql                 5.7.23              563a026a1511        5 weeks ago         372MB
mysql                 5.7.22              6bb891430fb6        2 months ago        372MB
test2_php             latest              05534d47f926        3 months ago        84.7MB
test1_php             latest              05534d47f926        3 months ago        84.7MB
<none>                <none>              6060fcf4d103        3 months ago        81MB
php                   fpm-alpine          601d5b3a95d4        3 months ago        80.6MB
php                   apache              d9faf33e6e40        3 months ago        377MB
mysql                 latest              8d99edb9fd40        3 months ago        445MB
php                   7-fpm               854ffd8dc9d8        3 months ago        367MB
php                   7.2                 e86d9bb526ef        3 months ago        367MB
ukfx/php              apache-stretch      5958cb7c2316        4 months ago        648MB
nginx                 alpine              bc7fdec94612        4 months ago        18MB
hello-world           latest              e38bc07ac18e        6 months ago        1.85kB
composer/composer     latest              5afb0951f2a4        2 years ago         636MB
[email protected]:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker ps
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                         PORTS                    NAMES
f8beea5dceca        mysql:5.7.23          "docker-entrypoint.s…"   6 minutes ago       Restarting (2) 6 seconds ago                            votes_docker_db_1
8309b5456dcf        adminer               "entrypoint.sh docke…"   6 minutes ago       Up 6 minutes                   0.0.0.0:8081->8080/tcp   votes_docker_adminer_1
cc644206931b        votes_docker_webapp   "docker-php-entrypoi…"   6 minutes ago       Up 6 minutes                   0.0.0.0:8080->80/tcp     votes_docker_webapp_1
  1. If I fail with docker, I will try homestead or valet or laradock.

Do you think they are more simple in use ?

15 Oct
1 month ago

mstdmstd left a reply on Setting Docker For Laravel App I Got Errors In "compose/cli/main.py"

Looks like that was error that I had to specify other ports for adminer.

I fixed it and got next:

[email protected]:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker-compose up --build
Creating network "votes_docker_default" with the default driver
Building webapp
Step 1/2 : FROM php:7.2-apache
 ---> a7d68dad7584
Step 2/2 : RUN docker-php-ext-install     pdo_mysql     && a2enmod     rewrite
 ---> Using cache
 ---> 519d1b33af81
Successfully built 519d1b33af81
Successfully tagged votes_docker_webapp:latest
Creating votes_docker_adminer_1  ... done
Creating votes_docker_composer_1 ... done
Creating votes_docker_webapp_1   ... done
Creating votes_docker_db_1       ... done
Attaching to votes_docker_adminer_1, votes_docker_composer_1, votes_docker_webapp_1, votes_docker_db_1
adminer_1   | PHP 7.2.10 Development Server started at Mon Oct 15 10:14:02 2018
composer_1  | Composer could not find a composer.json file in /var/www/html
composer_1  | To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
votes_docker_composer_1 exited with code 1
webapp_1    | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.4. Set the 'ServerName' directive globally to suppress this message
webapp_1    | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.4. Set the 'ServerName' directive globally to suppress this message
webapp_1    | [Mon Oct 15 10:14:05.281793 2018] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.10 configured -- resuming normal operations
webapp_1    | [Mon Oct 15 10:14:05.281843 2018] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
db_1        | 2018-10-15T10:14:06.541323Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
db_1        | 2018-10-15T10:14:06.541484Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.11) starting as process 1
db_1        | mbind: Operation not permitted
db_1        | mbind: Operation not permitted
db_1        | mbind: Operation not permitted
db_1        | mbind: Operation not permitted
db_1        | 2018-10-15T10:14:07.062202Z 0 [Warning] [MY-011071] [Server] World-writable config file './auto.cnf' is ignored.
db_1        | 2018-10-15T10:14:07.062581Z 0 [Warning] [MY-010107] [Server] World-writable config file './auto.cnf' has been removed.
db_1        | 2018-10-15T10:14:07.063146Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 0cd8212e-d063-11e8-8e69-0242ac140005.
db_1        | 2018-10-15T10:14:07.079020Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
db_1        | 2018-10-15T10:14:07.091951Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
db_1        | 2018-10-15T10:14:07.103829Z 0 [Warning] [MY-010315] [Server] 'user' entry '[email protected]' ignored in --skip-name-resolve mode.
db_1        | 2018-10-15T10:14:07.103896Z 0 [Warning] [MY-010315] [Server] 'user' entry '[email protected]' ignored in --skip-name-resolve mode.
db_1        | 2018-10-15T10:14:07.103925Z 0 [Warning] [MY-010315] [Server] 'user' entry '[email protected]' ignored in --skip-name-resolve mode.
db_1        | 2018-10-15T10:14:07.103947Z 0 [Warning] [MY-010315] [Server] 'user' entry '[email protected]' ignored in --skip-name-resolve mode.
db_1        | 2018-10-15T10:14:07.104006Z 0 [Warning] [MY-010323] [Server] 'db' entry 'performance_schema [email protected]' ignored in --skip-name-resolve mode.
db_1        | 2018-10-15T10:14:07.104034Z 0 [Warning] [MY-010323] [Server] 'db' entry 'sys [email protected]' ignored in --skip-name-resolve mode.
db_1        | 2018-10-15T10:14:07.104070Z 0 [Warning] [MY-010311] [Server] 'proxies_priv' entry '@ [email protected]' ignored in --skip-name-resolve mode.
db_1        | 2018-10-15T10:14:07.112700Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'user [email protected]' ignored in --skip-name-resolve mode.
db_1        | 2018-10-15T10:14:07.112738Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'sys_config [email protected]' ignored in --skip-name-resolve mode.
db_1        | 2018-10-15T10:14:07.117764Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.11'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
  1. is it mysql misconfigure ?
  2. I run it not as root.
  3. Also as I use lamp have I to stop apache and mysql before running docker-compose command ?

mstdmstd left a reply on Setting Docker For Laravel App I Got Errors In "compose/cli/main.py"

Thank you! I fixed error syntax, but I tried again and got error :

$ docker-compose up --build
Building webapp
Step 1/2 : FROM php:7.2-apache
 ---> a7d68dad7584
Step 2/2 : RUN docker-php-ext-install     pdo_mysql     && a2enmod     rewrite
 ---> Using cache
 ---> 519d1b33af81
Successfully built 519d1b33af81
Successfully tagged votes_docker_webapp:latest
Starting votes_docker_adminer_1 ... 
Starting votes_docker_composer_1 ... 
Starting votes_docker_adminer_1  ... error
votes_docker_db_1 is up-to-date

ERROR: for votes_docker_adminer_1  Cannot start service adminer: driver failed programming external connectivity on endpoint votes_docker_adminer_1 (6e94693ab8b1a990aaa83164df0952e8665f351618a72aStarting votes_docker_composer_1 ... done

ERROR: for adminer  Cannot start service adminer: driver failed programming external connectivity on endpoint votes_docker_adminer_1 (6e94693ab8b1a990aaa83164df0952e8665f351618a72a5531f9c3ccc18a2e3d): Bind for 0.0.0.0:8080 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

I tried to check related ports and got:

# sudo netstat -ntpl | grep 8080:8080
# sudo netstat -ntpl | grep 0.0.0.0:8080
# sudo netstat -ntpl | grep 8080
tcp6       0      0 :::8080                 :::*                    LISTEN      7361/docker-proxy   

How to fix it ?

14 Oct
1 month ago

mstdmstd started a new conversation Setting Docker For Laravel App I Got Errors In "compose/cli/main.py"

Hello! In my kubunru 18.04 I try to run docker for my laravel application

$ docker --version 
Docker version 17.12.1-ce, build 7390fc6

I have 3 files: .env :

# PATHS

DB_PATH_HOST=./databases

APP_PATH_HOST=./votes

APP_PTH_CONTAINER=/var/www/html/

docker-compose.yml :

version: '3'

services:

    web:
        build: ./web/Dockerfile.yml
        environment:
            - APACHE_RUN_USER=www-data
        volumes:
            - ${DB_PATH_HOST}:${APP_PTH_CONTAINER}
        ports:
            - 8080:80
        working_dir: ${APP_PTH_CONTAINER}
        
        

    db:
        image: mysql
        command: --default-authentication-plugin=mysql_native_password
        restart: always
        environment: 
            MYSQL_ROOT_PASSWORD: 1
        volumes:
            - ${DB_PATH_HOST}:/var/lib/mysql

    adminer:
        image: adminer
        restart: always
        ports:
            - 8080:8080
            
            
    composer:
        image: composer:1.6
        volumes:
            - ${DB_PATH_HOST}:${APP_PTH_CONTAINER}
        working_dir: ${APP_PTH_CONTAINER}
        command: composer install        

/web/Dockerfile.yml :

FROM php:7.2-apache

RUN docker-php-ext-install \
    pdo_mysql \
    && a2emod \
    rewrite

Compiling, I have error:

[email protected]:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker-compose up --build
Building web
Traceback (most recent call last):
  File "bin/docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 71, in main
  File "compose/cli/main.py", line 127, in perform_command
  File "compose/cli/main.py", line 1052, in up
  File "compose/cli/main.py", line 1048, in up
  File "compose/project.py", line 466, in up
  File "compose/service.py", line 329, in ensure_image_exists
  File "compose/service.py", line 1047, in build
  File "site-packages/docker/api/build.py", line 142, in build
TypeError: You must specify a directory to build in path
[6769] Failed to execute script docker-compose

I know that *.py that is python language files, but I do not use python language or work with it.

How to fix it ?

Thanks!

13 Oct
1 month ago

mstdmstd left a reply on I Got Csrf Error With Http-tests

Thank you for your feedbacks, it was usefull! I made creating of new user and opening profile page I try to modify several fields with PUT request :

       $response                     = $this->actingAs($newUser)->get('profile/edit-details');
        $response->assertStatus(200);
        $response->assertSee(htmlspecialchars("Profile : Details"));

        $response                     = $this->actingAs($newUser)->put( 'profile/profile-edit-details-put', [ 'first_name' => 'Modified : '.$newUser->first_name, 'last_name' => 'Modified : '.$newUser->last_name, 'phone'=>'Modified : '.$newUser->phone, 'website'=>'Modified : '.$newUser->website, '_token'=> $csrf_token  ]);
        $response->assertStatus(200);

But I got error here :

[2018-10-13 05:11:23] local.ERROR: Session store not set on request. (View: /mnt/_work_sdb8/wwwroot/lar/Votes/resources/views/cardsBS41Frontend/layouts/footer.blade.php) (View: /mnt/_work_sdb8/wwwroot/lar/Votes/resources/views/cardsBS41Frontend/layouts/footer.blade.php) (View: /mnt/_work_sdb8/wwwroot/lar/Votes/resources/views/cardsBS41Frontend/layouts/footer.blade.php) {"userId":45,"email":"Testing_user_on_2018-10-13 05:11:[email protected]","exception":"[object] (ErrorException(code: 0): Session store not set on request. (View: /mnt/_work_sdb8/wwwroot/lar/Votes/resources/views/cardsBS41Frontend/layouts/footer.blade.php) (View: /mnt/_work_sdb8/wwwroot/lar/Votes/resources/views/cardsBS41Frontend/layouts/footer.blade.php) (View: /mnt/_work_sdb8/wwwroot/lar/Votes/resources/views/cardsBS41Frontend/layouts/footer.blade.php) at /mnt/_work_sdb8/wwwroot/lar/Votes/vendor/laravel/framework/src/Illuminate/Http/Request.php:467, ErrorException(code: 0): Session store not set on request. (View: /mnt/_work_sdb8/wwwroot/lar/Votes/resources/views/cardsBS41Frontend/layouts/footer.blade.php) (View: /mnt/_work_sdb8/wwwroot/lar/Votes/resources/views/cardsBS41Frontend/layouts/footer.blade.php) at /mnt/_work_sdb8/wwwroot/lar/Votes/vendor/laravel/framework/src/Illuminate/Http/Request.php:467, ErrorException(code: 0): Session store not set on request. (View: /mnt/_work_sdb8/wwwroot/lar/Votes/resources/views/cardsBS41Frontend/layouts/footer.blade.php) at /mnt/_work_sdb8/wwwroot/lar/Votes/vendor/laravel/framework/src/Illuminate/Http/Request.php:467, RuntimeException(code: 0): Session store not set on request. at /mnt/_work_sdb8/wwwroot/lar/Votes/vendor/laravel/framework/src/Illuminate/Http/Request.php:467)
[stacktrace]
#0 /mnt/_work_sdb8/wwwroot/lar/Votes/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(45): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(ErrorException), 1)

It refs to my resources/views/cardsBS41Frontend/layouts/footer.blade.php file, which is :

@inject('viewFuncs', 'App\library\viewFuncs')
<footer style="background: #2d3246; color: white;">
    <div class="row ml-3 mr-3">
        <div class="col">
            <a class="social-inner" href="{{ route('home') }}"><span class="icon"></span>
                <span>Home</span>
            </a>
        </div>

        <div class="col">
            <a class="social-inner" href="{{ url('/dump.html') }}" target="_blank">
                <span class="icon"></span><span>/dump.html</span>
            </a>
        </div>

        <div class="col">
            <a class="social-inner" href="/about">
                <span class="icon"></span><span>About FRONTEND</span>
            </a>
        </div>



        @if( $viewFuncs->loggedUserHasAdminAccess() )
            <div class="col">
                <a class="social-inner" href="{{ route('admin.dashboard') }}" >
                    <span class="icon"></span><span>Backend</span>
                </a>
        </div>
        @endif


        <div class="col"><a class="social-inner" href="/blog"><span class="icon"></span><span>Blog</span></a></div>

        <div class="col"><a class="social-inner" href="{{ route('contact-us') }}" ><span class="icon"></span><span>Contacts us</span></a></div>

    </div>
</footer>

I suppose that checks of current user admin access raise error, as it is defined in app/library/viewFuncs.php:

<?php namespace App\library {

    use Auth;
    use DB;
    use Carbon\Carbon;
    use App\User;

    class viewFuncs // https://laravel.com/docs/5.4/blade
    {
        ...
        public function loggedUserHasAdminAccess(): bool
        {
            $has_access = false;
            if (Auth::check()) {
                $loggedUser             = Auth::user();
                $request                = request();
                $loggedUserAccessGroups = $request->session()->get('loggedUserAccessGroups');
                $logged_user_ip         = $request->session()->get('logged_user_ip');

Looks like last 2 rows raise error... I am not sure, if the best way is to make checks in method loggedUserHasAdminAccess and if session is not defined to return false or there is a way to create session in my test file?

09 Oct
1 month ago

mstdmstd started a new conversation I Got Csrf Error With Http-tests

Hello, In my laravel 5.7.3 application I do automatic tests as written here https://laravel.com/docs/5.7/http-tests

I create new user and open profile under this new user and try to modify some fields which are editable on this page. I got error putting changes :

"
Illuminate\Session\TokenMismatchException {#621
  #message: ""
  #code: 0
  #file: "./vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php"
  #line: 82
  trace: {
    ./vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:82 { …}
    ./vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:223 { …}
    ...
    ./tests/Feature/ProfilepageTest.php:87 {
      › $response                     = $this->actingAs($newUser)->get('/profile/edit-details');
      › $response = $this->put( 'profile/edit-details-put', [ 'first_name' => 'Modified : '.$newUser->first_name, 'last_name' => 'Modified : '.$newUser->last_name, 'phone'=>'Modified : '.$newUser->phone, 'website'=>'Modified : '.$newUser->website, 'csrf_token'=> $csrf_token  ]);
      › 
      arguments: {
        $uri: "profile/edit-details-put"
        $data: array:5 [ …5]
      }
    }
    ./vendor/phpunit/phpunit/src/Framework/TestCase.php:1150 { …}

This error is triggered by my code :

<?php

namespace Tests\Feature;

use Tests\TestCase;
use DB;
use Illuminate\Foundation\Testing\WithFaker;

class ProfilePageTest extends TestCase  // vendor/bin/phpunit   tests/Feature/ProfilepageTest.php
{
    public function testProfilePage()
    {


        $csrf_token = csrf_token();
        ...```

        $newUser                    = new User();
        $newUser->username          = 'Testing user on '.now();
        $newUser->email             = 'Testing_user_on_'.now().'@site.com';
        ...
        $newUser->save();
        $testing_user_id            = $newUser->id;
        ...

        
        $response                     = $this->actingAs($newUser)->get('/profile/edit-details');
        $response = $this->put( 'profile/edit-details-put', [ 'first_name' => 'Modified : '.$newUser->first_name, 'last_name' => 'Modified : '.$newUser->last_name, 'phone'=>'Modified : '.$newUser->phone, 'website'=>'Modified : '.$newUser->website, 'csrf_token'=> $csrf_token  ]);
        ...


    }
}

In my routes/web.php :

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

I use Auth and jrean/laravel-user-verification plugins for checking of this url and in the http-tests docs I found next :

The CSRF middleware is automatically disabled when running tests.

But anyway I got csrf error.

Why and how to fix it ?

Thanks!

08 Oct
1 month ago

mstdmstd left a reply on How To Use Custom Blade Directives With Db Refering

I read this doc https://scotch.io/tutorials/sharing-data-between-views-using-laravel-view-composers and I am stack at line:

Next, we will create our MovieComposer class

I missed which must be name of this file and path?

mstdmstd left a reply on How To Use Custom Blade Directives With Db Refering

Yes, please give some examples !

mstdmstd started a new conversation How To Use Custom Blade Directives With Db Refering

Hello, In my Laravel 5.7 app I want to use Custom Blade Directives to implement with it results of voting for any vote, as I want to show similar block of resulting html code in several parts my app. I searched in internet and found some examples, but they all work only with blade code, but I need to read data from db using my models and I wand to use blade template file with it. Could you, please, give a link to good sample of such task?

Thanks!

05 Oct
1 month ago

mstdmstd left a reply on Flash For Bootstrap 4.1 App

I have returned to this question. Several years ago I used https://github.com/stanlemon/jGrowl library with popup messages. I see last upfdate was more 2 years ago. If there is something like it compatible with laravel 5.7/blade/bootstrap 4.1 app ?

04 Oct
1 month ago

mstdmstd left a reply on How To Call Laravel Route From Js Script File?

Thank you! Also a question if in 2 routes definitions below

// Route::get('contacts-us', '[email protected]')->name('contacts-us');   

Route::get('contacts-us', array(
    'as'      => 'contacts-us',
    'uses'    => '[email protected]'
));

contacts-us - is the same name of the route in diferent syntax?

03 Oct
1 month ago

mstdmstd started a new conversation How To Call Laravel Route From Js Script File?

Hi all. In my larabel 5.7 I have in routes/web.php :

Route::group(['middleware' => ['auth', 'isVerified'], 'prefix' => 'admin', 'as' => 'admin.'], function () {
    ...
    Route::get('get_system_info', [
        'as'   => 'get-system-info',
        'uses' => 'Admin\[email protected]_system_info']
    );

From my php code I can open this using "as" url from above as :

            return redirect()->route('admin.get-system-info');

But when I need to run this code in ajax from my .js file I make :

     var href= '/admin/get_system_info';
     $.ajax(
         {
             type: "GET",

My question is if there is a way to avoid using url "get_system_info" from my js file but to use "as" from my routes/web.php, like :

     var href= 'admin.get_system_info';
     $.ajax(
         {
             type: "GET",

?

If yes how ?

Thank you!

mstdmstd started a new conversation Flash For Bootstrap 4.1 App

Hi all. I search for some flash tool for my laravel 5.7/blade/bootstrap 4.1 app and found this plugin waite https://github.com/laracasts/flash

but as I see in description bootstrap 3.3 is mentioned there...

Can somebody say is it compatible with bootstrap 4.1?

Maybe there is some similar plugin?

Thank you!

29 Sep
1 month ago

mstdmstd started a new conversation Is Bootstrap-multiselect Plugin Is Compatible With Bootstrap 4.1 ?

Hello, Can somebody say if this https://github.com/davidstutz/bootstrap-multiselect plugin is compatible with bootstrap 4.1 ? Or some other similar plugin ?

Thanks!

mstdmstd started a new conversation Options Of Daterangepicker

Hello, I added daterangepicker ( http://www.daterangepicker.com/ ) in my application but after some working I found some problems:

  1. looks like only range in 2 monthes can be shown, as changing month in 1 picker I see that the other picker's month is also changed and that is not what I need.

  2. I set format ion locale as:

    $('input[name="filter_voted_at_from_till"]').daterangepicker({
        startDate: this_filter_start_date,
        endDate: this_filter_end_date, 
        locale: {
            format: 'DD MMMM, YYYY'            
        }
    });

as I want to show date in format like:

    20 January, 2018

But I would like to set/get value of in format of database, like

    2018-08-28

Has this plugin such options? Reading the docs I tried to find it and and did not.

Thanks!

26 Sep
1 month ago

mstdmstd left a reply on Why UserNotVerifiedException Error Is Not Trigered?

I have 1 more similar error as I tried to show specific view in case of 404 error and I found, that the way to make is in app/Exceptions/Handler.php:

    public function render($request, Exception $exception)
    {
        // if($exception instanceof \App\Exceptions\NotFoundHttpException)
        if($exception instanceof NotFoundHttpException) // when wrong url this condition is not true and my view is not open
        {
            return response()->view('page_not_found', [], 404); 
        }

I suppose that there are some common problem with my errors. It seems to me that I did not make any specific with app/exceptions options.

My 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",
        "davejamesmiller/laravel-breadcrumbs": "5.x",
        "doctrine/dbal": "^2.8",
        "fideloper/proxy": "^4.0",
        "intervention/image": "^2.4",
        "itsgoingd/clockwork": "^3.0",
        "jrean/laravel-user-verification": "^7.0",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0",
        "laravelcollective/html": "^5.4.0",
        "mews/captcha": "^2.2",
        "proengsoft/laravel-jsvalidation": ">2.2.0",
        "rap2hpoutre/laravel-log-viewer": "^0.19.1",
        "snowfire/beautymail": "dev-master",
        "themsaid/laravel-mail-preview": "^2.0",
        "wboyz/laravel-enum": "^0.2.1",
        "yajra/laravel-datatables-oracle": "^8.7"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.1",
        "beyondcode/laravel-dump-server": "^1.2",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "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"
        ],


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

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

Can it be that some my installed package could overwrite errors behaivor?

Any ideas why error and howe to fix it?

25 Sep
1 month ago

mstdmstd left a reply on I Search Datepicker Compatible With Bootstrap 4.1/blade

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?

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?

24 Sep
1 month ago

mstdmstd started a new conversation I Search Datepicker Compatible With Bootstrap 4.1/blade

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!

23 Sep
1 month ago

mstdmstd left a reply on Chartjs Video Lessaons With Relative Docs

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

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!

21 Sep
1 month ago

mstdmstd started a new conversation How Get Route Name Resource

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?

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?

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!

20 Sep
1 month ago

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

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!

17 Sep
1 month ago

mstdmstd started a new conversation A

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!

10 Sep
2 months ago

mstdmstd started a new conversation Moving To Laravel 5.7 Has Npm Errors

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!

07 Sep
2 months ago

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

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?

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!

03 Sep
2 months ago

mstdmstd started a new conversation Failed To Install Laravel-setup-wizard

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!