PetroGromovo

PetroGromovo

Member Since 1 Year Ago

Experience Points
5,900
Total
Experience

4,100 experience to go until the next level!

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

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

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

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

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 2
5,900 XP
Oct
14
6 days ago
Activity icon

Started a new Conversation How With Nwidart/laravel-modules Run 1 Seeder File Inside Of Module?

Hello, In Laravel 6 in application using "nwidart/laravel-modules": "^5.0" I create seed file with command for module

php artisan module:make-seed seed_duration_options Blog

But I can not run this 1 module :

app_root# php artisan module:seed seed_blog_options Blog                                                             
  Too many arguments, expected arguments "command" "module".  

By link: https://nwidart.com/laravel-modules/v6/advanced-tools/artisan-commands

I read

module:seed
Seed the given module, or without an argument, seed all modules
php artisan module:seed Blog

But can I seed only 1 seed file?

Thanks!

Oct
09
1 week ago
Activity icon

Replied to Why CORS Error With Axios Request To Youtube/v3/video

What I see by "View page source" menu. Is it ?


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="/images/favicon.ico">
    <title id="app_title"></title>
  <link href="/js/0.js" rel="prefetch"><link href="/js/1.js" rel="prefetch"><link href="/js/10.js" rel="prefetch"><link href="/js/11.js" rel="prefetch"><link href="/js/12.js" rel="prefetch"><link href="/js/13.js" rel="prefetch"><link href="/js/14.js" rel="prefetch"><link href="/js/15.js" rel="prefetch"><link href="/js/16.js" rel="prefetch"><link href="/js/17.js" rel="prefetch"><link href="/js/18.js" rel="prefetch"><link href="/js/19.js" rel="prefetch"><link href="/js/2.js" rel="prefetch"><link href="/js/20.js" rel="prefetch"><link href="/js/21.js" rel="prefetch"><link href="/js/22.js" rel="prefetch"><link href="/js/23.js" rel="prefetch"><link href="/js/24.js" rel="prefetch"><link href="/js/25.js" rel="prefetch"><link href="/js/26.js" rel="prefetch"><link href="/js/27.js" rel="prefetch"><link href="/js/28.js" rel="prefetch"><link href="/js/29.js" rel="prefetch"><link href="/js/3.js" rel="prefetch"><link href="/js/30.js" rel="prefetch"><link href="/js/31.js" rel="prefetch"><link href="/js/32.js" rel="prefetch"><link href="/js/33.js" rel="prefetch"><link href="/js/34.js" rel="prefetch"><link href="/js/35.js" rel="prefetch"><link href="/js/36.js" rel="prefetch"><link href="/js/37.js" rel="prefetch"><link href="/js/38.js" rel="prefetch"><link href="/js/39.js" rel="prefetch"><link href="/js/4.js" rel="prefetch"><link href="/js/40.js" rel="prefetch"><link href="/js/41.js" rel="prefetch"><link href="/js/42.js" rel="prefetch"><link href="/js/43.js" rel="prefetch"><link href="/js/44.js" rel="prefetch"><link href="/js/45.js" rel="prefetch"><link href="/js/46.js" rel="prefetch"><link href="/js/5.js" rel="prefetch"><link href="/js/6.js" rel="prefetch"><link href="/js/7.js" rel="prefetch"><link href="/js/8.js" rel="prefetch"><link href="/js/9.js" rel="prefetch"><link href="/js/app.js" rel="preload" as="script"><link href="/js/chunk-vendors.js" rel="preload" as="script"></head>
  <body>
    <noscript>
      <strong>We're sorry but vtasks doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app" ></div>
    <!-- built files will be auto injected -->
  <script type="text/javascript" src="/js/chunk-vendors.js"></script><script type="text/javascript" src="/js/app.js"></script></body>
</html>


Activity icon

Replied to Why CORS Error With Axios Request To Youtube/v3/video

What I see in the console of my app : https://prnt.sc/uvwkr3

Url of the vuejs page where I try to youtube resource

http://localhost:8080/video-details/cl0MoTVyyPQ/%5Bobject%20Object%5D

Can you propose some other decisions forvuejs app? Not Axios ?

Oct
08
1 week ago
Activity icon

Replied to Why CORS Error With Axios Request To Youtube/v3/video

and which decision can be here? I run the app in dev mode with command

yarn run serve

If there is a way with this command work on other host, not

http://localhost:8080 ?

When I upload my app on live apache/ubuntu/Digital Ocean server I run live version with command

yarn run build

Must my application work correctly without CORS errors on server? How how to make development/debugging in this case?

Also in options of my app on youtube there is an option “Domain verification” : https://prnt.sc/uvvbee Have I to fill it for my app?

Activity icon

Started a new Conversation Why CORS Error With Axios Request To Youtube/v3/video

Hello, In my @vue/cli 4.0.5 / axios": "^0.19 I got “No 'Access-Control-Allow-Origin' header is present on the requested resource.” when I run get request to youtube/v3/video API. I read this https://developers.google.com/youtube/v3/docs/videos docs and do :

                let params = {  // https://developers.google.com/youtube/v3/docs/search/list
                    'Access-Control-Allow-Origin': '*',
                    'Access-Control-Allow-Credentials': true,
                    'Access-Control-Allow-Headers': 'Content-Type',
                    'Access-Control-Allow-Methods' : 'GET, POST, PUT, DELETE, OPTIONS',
                    part: 'snippet',
                    key: this.youtubeApiKey,
                    id : this.videoId,
                    type: 'video'
                }

                axios.get('https://www.googleapis.com/youtube/v3/video', params)
                    .then(response => {
                        console.log(response)
                    })
                    .catch(error => {
                        console.error(error)
                    })

and got error in console:

%5Bobject%20Object%5D:1 Access to XMLHttpRequest at 'https://www.googleapis.com/youtube/v3/video' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource

where localhost:8080 is my localhost which I got with command :

yarn run serve

In this vuejs project I use axios for reading data from external API with code like :

            let apiUrl = process.env.VUE_APP_API_URL
            settingCredentialsConfig.headers.Authorization = 'Bearer ' + this.getters.token
            axios.get(apiUrl + '/personal/task_assigned_to_users', settingCredentialsConfig)
                .then((response) => {

and settingCredentialsConfig is in config file:

export const settingCredentialsConfig = {
    withCredentials:true,
    headers: {
        'Content-Type': 'application/json',
        'Access-Control-Allow-Origin': '*',
        'Access-Control-Allow-Credentials':true
    }
}

Seems, I set the same parameters when I make request to youtube, but why error and how to fix it?

Thanks!

Sep
22
4 weeks ago
Activity icon

Started a new Conversation How In Laravel-livewire Set Flash Message With Validation Erros

Hello, With laravel 7 /livewire 1.3 app in login form I got errors on invalid form with code:

    public function submit()
    {
        $loginRules= User::getUserValidationRulesArray();
        $this->validate($loginRules);

and shows error message near any field

I want on login fail to add flash message and reading at https://laravel.com/docs/7.x/validation

But The problem is that if I show flas message I do not see errors for any fields. I try to make in component app/Http/Livewire/Login.php ::

<?php

namespace App\Http\Livewire;

use App\User;
use Illuminate\Support\Facades\Validator;
use Livewire\Component;
use Auth;
use DB;
use App\Config;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;


class Login extends Component
{
    public $form= [
        'email'=>'[email protected]',
        'password'=> '111111',
    ];

    private $view_name= 'livewire.auth.login';


    public function submit()
    {

        $request = request();
        $loginRules= User::getUserValidationRulesArray('login');
        $validator = Validator::make($request->all(), $loginRules);

        if ($validator->fails()) {
            session()->flash('danger_message', 'Check your credentials !');
            return;
//            return redirect()->to('/login');
        }



        $user = Sentinel::findByCredentials(['email'    => $this->form['email']]);
        if (empty($user)) {
            session()->flash('danger_message', 'User "' . $this->form['email'] . '" not found !');
            ...

and template resources/views/livewire/auth/login.blade.php :

<article >

    @include('livewire.common.alert_messages')

       <form class="form-login" wire:submit.prevent="submit">

        <div class="card">

            <ul> // IT SHOWS NOTHIN               
                @foreach ($errors->all() as $error)
                    <li class="validation_error">{{ $error }}</li>
                @endforeach
            </ul>

            <div class="card-body card-block">

                <h3 class="card-header">
                    <span class="spinner-border" role="status" wire:loading>
                        <span class="sr-only">Loading...</span>
                    </span>
                    Login
                    </h3>
                <h4 class="card-subtitle">Use your credentials</h4>

                <dl> <!-- email FIELD DEFINITION -->

                    <dt>
                        <label class="col-form-label" for="email">Email:<span class="required"> * </span></label>
                    </dt>
                    <dd>
                            <input
                                wire:model.lazy="form.email"
                                name="email"
                                id="email"
                                class="form-control"
                                placeholder="Your email address"
                                autocomplete=off
                                             >
                          @error('form.email')
                          // I DO NOT SEE THIS ERROR MESSAGE
                        <div class="validation_error">{{ clearValidationError($message,['form.'=>'']) }}</div> @enderror
                    </dd>
                </dl> <!-- <dt> email FIELD DEFINITION -->


                <dl> <!-- password FIELD DEFINITION -->
                    <dt>
                        <label class="col-form-label" for="password">Password:<span class="required"> * </span></label>
                    </dt>
                    <dd>
                         <input type="password"
                               wire:model.lazy="form.password"
                                   id="password"
                                   name="password"
                                   class="form-control"
                                   placeholder="Your password"
                                   autocomplete=off
                                                >
                          @error('form.password')
                        <div class="validation_error">{{ clearValidationError($message,['form.'=>'']) }}</div> @enderror
                    </dd>
                </dl> <!-- <dl> password FIELD DEFINITION -->

            </div> <!-- <div class="card-body card-block"> -->

            <section class="card-footer row_content_right_aligned">
                <button type="reset" class="btn btn-secondary btn-sm m-2">
                    Reset
                </button>
                <button type="submit" class="btn btn-primary btn-sm m-2 ml-4 mr-4 action_link">
                    Submit
                </button>
            </section>


        </div> <!-- <div class="card"> -->

    </form>
</article>

and in template livewire.common.alert_messages I show flash message ... Which way is valid ?

Thanks in advance!

Sep
07
1 month ago
Activity icon

Started a new Conversation How In Envoy With Link Command Reverting App To One Of Prior Version To Rollback Migrations?

Hello, With envoy deployment for Laravel apps most usefull feature seems possibility with link command revert app to one of prior versions. But What if with any new version upload migrations were applied? Is it possible with with link command to rollback migrations by given steps back? Are there some scripts/pluging for it ?

Thanks!

Sep
05
1 month ago
Activity icon

Replied to How In Docker Run Command Php Artisan Key:generate After Composer Install?

I have Dockerfile file where I install composer, npm, yarn, php extentions and different packages I need for my docker box(ex : nano, mc, curl , git)

Also I have docker-compose.yml with several containers defined(web, db, adminer and composer) and in the last container

    composer:
        container_name: hostels3_composer
        image: composer:1.8
        volumes:
            - ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
        working_dir: ${APP_PTH_CONTAINER}
        command: composer install --ignore-platform-reqs

command - that is what run when all steps in Dockerfile are completed.

I wonder if there is a way to run other command(in my case php artisan key:generate) after

composer install

was cussesfully run and file /vendor/autoload.php was generated?

Sep
04
1 month ago
Activity icon

Started a new Conversation How In Docker Run Command Php Artisan Key:generate After Composer Install?

Hi all, having docker for laravel 6 app I run command

composer install

which is written in docker-compose.yml (version: '3') as:

  composer:
    container_name: project-composer
    image: composer:1.8
    volumes:
      - ".:/app"
    working_dir: "/app"
    command: composer install --ignore-platform-reqs

If there is a way after

composer install 

was succesfully run to run also command

php artisan key:generate

?

Thanks!

Activity icon

Replied to How Debug Laravel App With PhpStorm / Xdebug?

What is "10.0.2.2" in you code? If that is local server have it be "local-hostels3.com" from /etc/apache2/sites-available/local-hostels3.com.conf (I wrote above) ?

Activity icon

Replied to How Debug Laravel App With PhpStorm / Xdebug?

Please, explain where do you set

 ?XDEBUG_SESSION_START=PHPSTORM

? in url of laravel app?

Activity icon

Replied to How Debug Laravel App With PhpStorm / Xdebug?

Thanks!

  1. Could you please to modify xdebug.remote_port, as I read :
xdebug.remote_port = <port_number>
By default, Xdebug listens on port 9000.

I work with lamp on ubuntu 18 locally on my laptop and on Digital Ocean server.

  1. I read next :

Debug port field, select the Can accept external connections checkbox. Select the Force break at the first line when no path mapping is specified checkbox to

I do not see these options. On which config page have I to search them ?

Activity icon

Replied to How Debug Laravel App With PhpStorm / Xdebug?

Yes, and I asked about config page https://prnt.sc/ubbje8 . In my phpstoem it is different of article printscreen? I think different versions...

Activity icon

Replied to How Debug Laravel App With PhpStorm / Xdebug?

PC, kubuntu 18. xdebug installed and phpstorm found it : https://prnt.sc/ubcc0v

Activity icon

Replied to How Debug Laravel App With PhpStorm / Xdebug?

Thanks, This article has a bit different dialog of printscreens in comparison with my PhpStorm 2019.2.3. Alsdo for my app I use appache hosting defined in /etc/apache2/sites-available/local-hostels3.com.conf as :


<VirtualHost *:80>
   ServerAdmin [email protected]
   DocumentRoot /_wwwroot/lar/hostels3/public    
   ServerName local-hostels3.com          
   ServerAlias local-hostels3.com
       
   <Directory /_wwwroot/lar/hostels3/public>
     AllowOverride All
     Order Deny,Allow
     Allow from all
     Require all granted
   </Directory>
   
   Options FollowSymLinks
   DirectoryIndex index.php
   
   ErrorLog /_wwwroot/lar/hostels3/storage/logs/error.log
   CustomLog /_wwwroot/lar/hostels3/storage/logs/access.log combined
</VirtualHost>

Could you please take a look : https://prnt.sc/ubbje8 ?

Sep
03
1 month ago
Activity icon

Started a new Conversation How Debug Laravel App With PhpStorm / Xdebug?

Hello, If there is a way to debug laravel application with PhpStorm 2019 and xdebug? If yes, how?

Thanks!

Aug
28
1 month ago
Activity icon

Replied to I Got Require Is Not Defined Under Nwidart/laravel-modules

I opened file Project/public/js/app.js(2.9 MiB) and with search did not find any line like :

require('./bootstrap')

I tried to search and find something like that :

...
__webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js");


...



/***/ "./resources/js/bootstrap.js":
/*!***********************************!*\
  !*** ./resources/js/bootstrap.js ***!
  \***********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

Not sure what have I do search and what to do with it ?

Aug
27
1 month ago
Activity icon

Replied to I Got Require Is Not Defined Under Nwidart/laravel-modules

I opened file resources/js/app.js and it has lines :

require('./bootstrap');

require('jquery');

window.Vue = require('vue');
export const bus = new Vue()

import * as L from 'leaflet';
import 'leaflet-polylinedecorator';

Could you please explain why require works in this file? From my prior Laravel expierence require is always available in this file without any additive work...

And lacks in Modules/Pages/Resources/assets/js/app.js to make it working ?

Activity icon

Replied to I Got Require Is Not Defined Under Nwidart/laravel-modules

Yes I modified Modules/Pages/Resources/assets/js/app.js:

alert( 'Modules/Pages/Resources/assets/js/app.js::' )


console.log('INSIDE -1 Modules/Pages/Resources/assets/js/app.js')
window.flatpickr = require("flatpickr");
console.log('INSIDE -2 Modules/Pages/Resources/assets/js/app.js')

after that I run :

npm run watch-poll
php artisan module:publish Pages

both under root of the app. And I have require is not defined error

if to comment

window.flatpickr = require("flatpickr");

and next :

php artisan module:publish Pages

I have no this error I see line :

INSIDE -2 Modules/Pages/Resources/assets/js/app.js

in the console...

Activity icon

Replied to I Got Require Is Not Defined Under Nwidart/laravel-modules

root webpack.mix.js default:


const mix = require('laravel-mix');
mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css');

Must it be different in case of Modules ?

Activity icon

Replied to I Got Require Is Not Defined Under Nwidart/laravel-modules

And why do you have a seperate mix file for that directory? Modules/Pages/

Is it incorrect? Which way is valid ?

Activity icon

Replied to I Got Require Is Not Defined Under Nwidart/laravel-modules

Error in the console of the browser.

Activity icon

Replied to I Got Require Is Not Defined Under Nwidart/laravel-modules

Yes, I run

npm run dev

and next

php artisan module:publish Pages

Also I tried

npm run watch-poll

and next

php artisan module:publish Pages

in other tab

All the commands I run in the root of the app.

Activity icon

Replied to I Got Require Is Not Defined Under Nwidart/laravel-modules

Sorry, it has :

alert( 'Modules/Pages/Resources/assets/js/app.js::' )
window.flatpickr = require("flatpickr");

I have alert and error on next line

Activity icon

Started a new Conversation I Got Require Is Not Defined Under Nwidart/laravel-modules

Hello, In Laravel 6/nwidart/laravel-modules 7 app I added flatpickr under my module Project/Modules/Pages$ npm i flatpickr --save ... but I tried to require it in Modules/Pages/Resources/assets/js/app.js and got error :

Uncaught ReferenceError: require is not defined

In my Modules/Pages/webpack.mix.js I have :

const dotenvExpand = require('dotenv-expand');
dotenvExpand(require('dotenv').config({ path: '../../.env'/*, debug: true*/}));

const mix = require('laravel-mix');
require('laravel-mix-merge-manifest');

mix.setPublicPath('../../public').mergeManifest();

mix.js(__dirname + '/Resources/assets/js/app.js', 'js/pages.js')
    .sass( __dirname + '/Resources/assets/sass/app.scss', 'css/pages.css');

if (mix.inProduction()) {
    mix.version();
}

and in Modules/Pages/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": {
        "cross-env": "^7.0",
        "laravel-mix": "^5.0.1",
        "laravel-mix-merge-manifest": "^0.1.2"
    },
    "dependencies": {
        "flatpickr": "^4.6.6"
    }
}

How to fix this error ?

Aug
26
1 month ago
Activity icon

Started a new Conversation How To Add Some External Package With Nwidart/laravel-modules ?

Hello, In Laravel 6/nwidart/laravel-modules 7 app I see file composer.json in root of my module with lines :

{
    "name": "nwidart/pages",
    "description": "",
    "authors": [
        {
            "name": "Nicolas Widart",
            "email": "[email protected]"
        }
    ],
    "extra": {
        "laravel": {
            "providers": [],
            "aliases": {

            }
        }
    },
    "autoload": {
        "psr-4": {
            "Modules\Pages\": ""
        }
    }
}

I suppose that if I want to add some external package into my module(not the whole app) I need to edit this file and run module commands? How have I to edit it and which commands to use ?

Thanks!

Aug
17
2 months ago
Activity icon

Replied to How Can I Get Name Of Livewire Component In Js Code?

Yes, looking at the source of my page I see several(as in my layaout there are several components) pieces like:

     <div class="fill-area-content flexbox-item-grow">
                <article wire:initial-data="{&quot;id&quot;:&quot;vFdyHN5aR1pKrJX3kowg&quot;,&quot;name&quot;:&quot;admin.facilities&quot;,&quot;redirectTo&quot;:false,&quot;locale&quot;:&quot;en&quot;,&quot;events&quot;:[],&quot;eventQueue&quot;:[{&quot;event&quot;:&quot;facility_opened&quot;,&quot;params&quot;:[{&quot;mode&quot;:&quot;browse&quot;,&quot;id&quot;:null}]}],&quot;dispatchQueue&quot;:[],&quot;data&quot;:{&quot;form&quot;:{&quot;name&quot;:&quot;&quot;,&quot;descr&quot;:&quot;&quot;,&quot;created_at&quot;:&quot;&quot;,&quot;is_reopen&quot;:false},&quot;current_facility_id&quot;:null,&quot;filter_name&quot;:null,&quot;temp_filter_name&quot;:null,&quot;updateMode&quot;:&quot;browse&quot;,&quot;page&quot;:1},&quot;children&quot;:[],&quot;checksum&quot;:&quot;d31f86da5c90c7d6270c4c2af38415466bd43e45d418a328e4da839164603531&quot;}" wire:id="vFdyHN5aR1pKrJX3kowg" class="admin_page_container">

But wire:id is some code and looks like it is different any time i upload my page. Is there is a way to set some unuqie ID for any my component would would be used in wire:id ?

Activity icon

Started a new Conversation How Can I Get Name Of Livewire Component In Js Code?

Hello, In laravel 7 /livewire 1.3 / alpine 2 app reading https://laravel-livewire.com/docs/alpine-js#communicating-with-js

I try to use alpine method with reading data from component, which I created with command

php artisan make:livewire admin/facilities 

and in the component app/Http/Livewire/Admin/Facilities.php I have:

class Facilities extends Component
{
    ...
    public $updateMode = 'browse';

    public function render()
    {
        
        return view('livewire.admin.facilities.container', [
           ...
        ]);
    }

and in resources/views/livewire/admin/facilities/container.blade.php :

   ...
            hello::<div x-text="hello()"></div>
            editorTitle::<div x-text="editorTitle()"></div>
   ...

<script>

    function facilityEditorComponent() {
        return {
            hello: function () {
                return "Hello!123567"
            },
            editorTitle: function () {
                let component = window.livewire.find('admin.facilities')
                console.log(component)
                
                var updateMode = component.get('updateMode')
                console.log('$updateMode::')
                console.log($updateMode)
                
                return "editorTitle"
            },
        }
    }

</script>

But in the method above var component is undefined, sdo I get error refering it... Which is name of my component? Can I find it in source of my page ?

Thanks!

Aug
16
2 months ago
Activity icon

Replied to Laravel Migration Raise Could Not Find Driver Under Docker

config/database.php of the project :

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | PDO Fetch Style
    |--------------------------------------------------------------------------
    |
    | By default, database results will be returned as instances of the PHP
    | stdClass object; however, you may desire to retrieve records in an
    | array format for simplicity. Here you can tweak the fetch style.
    |
    */

    'fetch' => PDO::FETCH_CLASS,

    /*
    |--------------------------------------------------------------------------
    | Default Database Connection Name
    |--------------------------------------------------------------------------
    |
    | Here you may specify which of the database connections below you wish
    | to use as your default connection for all database work. Of course
    | you may use many connections at once using the Database library.
    |
    */

    'default' => env('DB_TYPE', 'pgsql'),

    /*
    |--------------------------------------------------------------------------
    | Database Connections
    |--------------------------------------------------------------------------
    |
    | Here are each of the database connections setup for your application.
    | Of course, examples of configuring each database platform that is
    | supported by Laravel is shown below to make development simple.
    |
    |
    | All database work in Laravel is done through the PHP PDO facilities
    | so make sure you have the driver for your particular database of
    | choice installed on your machine before you begin development.
    |
    */

    'connections' => [

        'sqlite' => [
            'driver'   => 'sqlite',
            'database' => storage_path().'/database.sqlite',
            'prefix'   => '',
        ],

        'sqlite.testing' => [
            'driver'   => 'sqlite',
            'database' => ':memory:',
            'prefix'   => '',
        ],

        'mysql' => [
            'driver'    => 'mysql',
            'host'      => env('DB_HOST'),
            'port'	=> env('DB_PORT'),
            'database'  => env('DB_DATABASE'),
            'username'  => env('DB_USERNAME'),
            'password'  => env('DB_PASSWORD'),
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => env('DB_PREFIX'),
            'strict'    => false,
        ],

        'pgsql' => [
            'driver'   => 'pgsql',
            'host'     => env('DB_HOST', 'localhost'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset'  => 'utf8',
            'prefix'   => '',
            'schema'   => 'public',
        ],

        'sqlsrv' => [
            'driver'   => 'sqlsrv',
            'host'     => env('DB_HOST', 'localhost'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'prefix'   => '',
        ],

    ],

    /*
    |--------------------------------------------------------------------------
    | Migration Repository Table
    |--------------------------------------------------------------------------
    |
    | This table keeps track of all the migrations that have already run for
    | your application. Using this information, we can determine which of
    | the migrations on disk haven't actually been run in the database.
    |
    */

    'migrations' => 'migrations',

    /*
    |--------------------------------------------------------------------------
    | Redis Databases
    |--------------------------------------------------------------------------
    |
    | Redis is an open source, fast, and advanced key-value store that also
    | provides a richer set of commands than a typical key-value systems
    | such as APC or Memcached. Laravel makes it easy to dig right in.
    |
    */

    'redis' => [

        'cluster' => false,

        'default' => [
            'host'     => 'redis',
            'port'     => 6379,
            'database' => 0,
        ],

    ],

];

?

Activity icon

Replied to Laravel Migration Raise Could Not Find Driver Under Docker

Yes, pdo_mysql is in /Dockerfile.yml and command

 php -m

shows it Also in output of phpinfo I see : https://prnt.sc/u0fjy2

Activity icon

Started a new Conversation Laravel Migration Raise Could Not Find Driver Under Docker

Hello, I installed laravel 5.8(with mysql) app under docker with php:7.1-apache and running the migration I got error that could not find driver :

[email protected]:/var/www/ticketly_docker_root# php artisan migrate

In Connection.php line 664:

  could not find driver (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations and table_type = 'BASE TABLE')


In PDOConnection.php line 31:

  could not find driver


In PDOConnection.php line 27:

  could not find driver

In my _Docker/web/Dockerfile.yml file I have mysqli, pdo and pdo_mysql installed :

FROM php:7.1-apache

RUN apt-get update && \
    apt-get install -y \
    python \
    libfreetype6-dev \
    libwebp-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    libzip-dev \
    nano \
    mc \
    git-core \
    curl \
    build-essential \
    openssl \
    libssl-dev \
    libgmp-dev \
    libldap2-dev \
    netcat \
    locate \
    && git clone https://github.com/nodejs/node.git \
    && cd node \
    && git checkout v12.0.0 \
    && ./configure \
     && make \
     && make install

  RUN  docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/


  # Install Composer
    RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer


    RUN  docker-php-ext-install gd pdo pdo_mysql  zip gmp bcmath pcntl ldap sysvmsg exif \
&& a2enmod rewrite

    RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli

COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf

Are commands above correct? I complied the project ok.

In .env:

# I tried both variants below after cache clearing. Which of them have I to use ?
DB_CONNECTION=mysqli
# DB_CONNECTION=mysql
DB_HOST=db

DB_PORT=3306
DB_DATABASE=DockerTicketly
DB_USERNAME=docker_user
DB_PASSWORD=4321

Entering the bash I check my current configuration:

# php -v
\PHP 7.1.33 (cli) (built: Oct 25 2019 06:33:10) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
[email protected]:/var/www/ticketly_docker_root# php -m
[PHP Modules]
bcmath
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gmp
hash
iconv
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
SPL
sqlite3
standard
sysvmsg
tokenizer
xml
xmlreader
xmlwriter
zip
zlib

Thanks!

Aug
13
2 months ago
Activity icon

Replied to How Can I Generate Access Error And Error Message, Leaving User On The Page?

Let me explain it with detailed example :

In laravel / jquery apps I have in JS code :

    var quiz_quality_radio= $('input[name=quiz_quality_radio]:checked').val()
    var href = this_frontend_home_url + "/make-quiz-quality";
    $.ajax( {
        type: "POST",
        dataType: "json",
        url: href,
        data: {"quiz_quality_id": quiz_quality_radio, "vote_id": this_vote_id, "_token": this_csrf_token},
        success: function( response )
        {
            $('input[name=quiz_quality_radio]:checked').prop('checked', false);
            frontendVote.showQuizQualityResults()
            popupAlert("Thank you for rating ! Your rate was added!", 'success')
        },
        error: function( error )
        {
            $('input[name=quiz_quality_radio]:checked').prop('checked', false);
            popupAlert(error.responseJSON.message, 'danger') // 'info', 'success'
        }
    });

and relative action in control :

public function make_quiz_quality(Request $request)
{
    $requestData     = $request->all();
    $quiz_quality_id = ! empty($requestData['quiz_quality_id']) ? $requestData['quiz_quality_id'] : '';
    $vote_id         = ! empty($requestData['vote_id']) ? $requestData['vote_id'] : '';

    if ( ! Auth::check()) {
        return response()->json(['message' => "To rate you must login to the system !"], HTTP_RESPONSE_BAD_REQUEST);
    }
    if (empty($quiz_quality_id)) {
        return response()->json([
            'message'         => "To rate you must select quiz quality !",
            'quiz_quality_id' => $quiz_quality_id
        ], HTTP_RESPONSE_OK);
    }

    $vote = Vote::find($vote_id);
    if ($vote === null) {
        return response()->json([ 'message' => "Vote Item # " . $vote_id . " not found !"],HTTP_RESPONSE_NOT_FOUND);
    }
    $loggedUser = Auth::user();

    $found_count = QuizQualityResult
        ::getByVoteIdAndUserId($vote_id, $loggedUser->id)
        ->count();
    if ($found_count > 0) {
        return response()->json(['message' => "You have already rated '" . $vote->name . "' # vote !", 'vote_id' => $vote_id],
            HTTP_RESPONSE_BAD_REQUEST);
    }

    $newVoteItemUsersResult = new QuizQualityResult();
    try {
        $newVoteItemUsersResult->quiz_quality_id = $quiz_quality_id;
        $newVoteItemUsersResult->vote_id         = $vote_id;
        $newVoteItemUsersResult->user_id         = $loggedUser->id;
        DB::beginTransaction();
        $newVoteItemUsersResult->save();

        $newActivityLog              = new ActivityLog();
        $newActivityLog->description = $loggedUser->username . ' set quiz quality ' . ($quiz_quality_id) . " on '" . $vote->name . "' vote ";
        $newActivityLog->subject_id  = $requestData['vote_id'];
        $newActivityLog->causer_id   = $loggedUser->id;
        $newActivityLog->log_name    = $loggedUser->username;
        $newActivityLog->causer_type = ActivityLog::CAUSER_TYPE_SET_QUIZ_QUALITY;
        $newActivityLog->properties  = $quiz_quality_id;
        $newActivityLog->save();

        DB::commit();
    } catch (Exception $e) {
        DB::rollBack();

        return response()->json(['message' => $e->getMessage(), 'voteCategory' => null], HTTP_RESPONSE_INTERNAL_SERVER_ERROR);
    }

    return response()->json(['message' => '', 'id' => $newVoteItemUsersResult->id], HTTP_RESPONSE_OK_RESOURCE_CREATED);
} //     public function make_quiz_quality(Request $request)

and in case of error generated in error block I show message with function popupAlert (implemented with bootstrapGrowl), without leaving the page. That is what I want to make in livewire / turbolinks / alpine app. How can I do it?

Aug
11
2 months ago
Activity icon

Replied to How Can I Use Variables In Blade File From _variables.scss?

Thanks, it looks like what I need , but has several possible decisions. Firstly I tried this https://www.npmjs.com/package/sass-to-js but trying to use it I got error :

Call to undefined function sassToJs

I installed package with command :

 yarn add  sass-to-js

Next in the file resources/views/layouts/app.blade.php I added line :

    <link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet" type="text/css">
    <link rel="icon" type="image/png" href="/favicon.ico"/>
    
    <link href="/css/app.css" rel="stylesheet">
    
    
    @livewireStyles
    
    <script src="sass-to-js/js/dist/sass-to-js.min.js"></script>
    
    <script src="{{ asset('/js/app.js') }}"></script>
    <script src="{{ asset('js/lazyload.js') }}"></script>
    
    <script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/pikaday/pikaday.js"></script>
    
    @livewireScripts
    @stack('styles')

I hope that is valid place for sass-to-js.min.js

and in resources/views/livewire/auth/profile.blade.php I added :

</article> <!-- page_content_container -->

<style>
    @import "sass-to-js/sass/sass-to-js";

    @import '/resources/sass/_variables.scss';
    
    
    .input_group_label {
        @if (sassToJs($debug_mode))
            border: 2px dotted green;
        @endif
        width: 25%;
    }
    

</style>

What is wrong ? Which decision is valid ?

Activity icon

Started a new Conversation How Can I Use Variables In Blade File From _variables.scss?

Hello, In resources/sass/app.scss file of laravel 7 app I try to reference variables defined in resources/sass/_variables.scss as :

@import 'variables';
...
.input_group_label {
    @if ($debug_mode) {
        border: 2px dotted green ;
    }
    @endif
    width: 25%;
}

But I got error :

Undefined variable: debug_mode 

debug_mode var is defined in resources/sass/_variables.scss :

...
$debug_mode: false;

What is wrong ?

Thanks!

Aug
09
2 months ago
Activity icon

Replied to How Can I Generate Access Error And Error Message, Leaving User On The Page?

Thanks, I will try this way, how to show error message on client, without other page redirecting?

Activity icon

Started a new Conversation How Can I Generate Access Error And Error Message, Leaving User On The Page?

Hello, In laravel / jquery apps if I need to make checks if user is logged I make in controller:

  $loggedUser = Auth::user();
     if ( empty($loggedUser->id) ) {
         return response()->json(['error_code'=> 1, 'message'=> "You must be logged!"],HTTP_RESPONSE_INTERNAL_SERVER_ERROR);
     }

as I do not need to leave the user from the page, but only restrict some functionality I show error message above using bootstrapGrowl library. Now with laravel 7 /livewire 1.3 / turbolinks:5 / [email protected] I search how can I generate error and show similar error message, leaving user on the page ?

Thanks!

Aug
01
2 months ago
Activity icon

Started a new Conversation In Livewire App To Show Sweet-alert Message When Other Page With Turrbolinks

Hello, In laravel 7 with livewire 1.3 / turbolinks:5.2 / [email protected] aoo I added realrashid/sweet-alert 3.1 and testing it in component render, like

public function render()
{
    Alert::alert('Title', 'Message222', 'Type');
    ...
    

I found that message alert is shown if I reload page with F5. If I open other page with turrbolinks the alert is not shown. If there is a way to show this alert other page with turrbolinks ? maybe with some other library ?

Thanks!

Jul
08
3 months ago
Activity icon

Replied to With Html2pdf In Generated Pdf As All Css Styles Are Lost

Looking at hint [email protected] in my blade form I changed refering to my css :

    <link rel="stylesheet" href="{{ public_path('/css/flb_layout.css') }}">

As result my css classes are not rendered in the page of the browser. In generated pdf file my css classes are not rendered too.

In my project I use webpack.mix.js with definitions:

const mix = require('laravel-mix');


let current_admin_template= 'Backend';
mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/' + current_admin_template + '/backend.scss', 'public/css/' + current_admin_template)
    .sass('resources/sass/' + current_admin_template + '/style_lg.scss', 'public/css/' + current_admin_template)
    .sass('resources/sass/' + current_admin_template + '/style_md.scss', 'public/css/' + current_admin_template)
    .sass('resources/sass/' + current_admin_template + '/style_sm.scss', 'public/css/' + current_admin_template)
    .sass('resources/sass/' + current_admin_template + '/style_xs_320.scss', 'public/css/' + current_admin_template)
    .sass('resources/sass/' + current_admin_template + '/style_xs_480.scss', 'public/css/' + current_admin_template)
    .sass('resources/sass/' + current_admin_template + '/style_xs_600.scss', 'public/css/' + current_admin_template)
    .sass('resources/sass/debug.scss',  'public/css' )
;

Can it be used anyway?

Jul
07
3 months ago
Activity icon

Replied to With Html2pdf In Generated Pdf As All Css Styles Are Lost

I created file public/css/flb_layout.css with all flexbox classes definitions and in my blade file I added asset to this css file:

@section('scripts')


    <link rel="stylesheet" href="{{ asset('/css/gijgo.min.css') }}" type="text/css">
    <link rel="stylesheet" href="{{ asset('/css/flb_layout.css') }}" type="text/css">
    ...

and checking source of generated html file I see link to flb_layout.css file:

    </footer>
    <link rel="stylesheet" href="http://local-boxbooking2.com/css/gijgo.min.css" type="text/css">
    <link rel="stylesheet" href="http://local-boxbooking2.com/css/flb_layout.css" type="text/css">

where http://local-boxbooking2.com - is hosting of my local app.

and as result in my browser I see that flexbox layout is rendered ok, but generating pdf file I see plain html without flexbox classes definitions applied. Which way is valid ?

Jul
06
3 months ago
Activity icon

Replied to With Html2pdf In Generated Pdf As All Css Styles Are Lost

I think yes, as when I use in html code in style definition flexbox elements - it works ok. But problem if I try to define css classes with flexbox elements. Or better to say css classes are not accessible in generated pdf

Activity icon

Replied to With Html2pdf In Generated Pdf As All Css Styles Are Lost

Do you mean that I have to cut styles definitions from blade file :

   <style  lang="css">
        .flexbox-parent
        {
           ...
        }

        .flexbox-item
        {
           ...
        }
        ...

    </style>

and 1) to put them in new css file? 2) In my blade file make absolute path to this css file ?

Jul
05
3 months ago
Activity icon

Started a new Conversation With Html2pdf In Generated Pdf As All Css Styles Are Lost

Hello, In my laravel 5.7 / bootstrap 4.4 app I use spatie/browsershot 3.37 and spipu/html2pdf 5.2 to generate pdf file and for my generated pdf file want I set layout with 100% height and footer and header like here: https://jsfiddle.net/MadLittleMods/LmYay/

But imported block of code which looks ok on my blade page in browser is invalid in generated pdf : as all css styles are lost.

by clicking on “To pdf file” content of the page is rendered into pdf file:

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

        if($hidden_action== 'upload') {
            \Response::download($save_to_file, $filename_to_save, array('Content-Type: application/octet-stream', 'Content-Length: pdf'));
            return response()->download($save_to_file, $filename_to_save)->deleteFileAfterSend(true);
        }

in my blade file:

@extends($current_admin_template.'.layouts.backend')


@section('content')

    @inject('viewFuncs', 'App\library\viewFuncs')

    <div id="page-wrapper" class="card">


  // THIS PART LOOKS OK IN BROWSER BUT IN GENERATED PDF INVALID AS ALL CSS CLASSES ARE LOST
        <div class="flexbox-parent" id="div_invoice_content" style="display: flex;">
            <input type="hidden" id="hidden_invoice_no" name="hidden_invoice_no" value="{{$invoice_no}}">
            <input type="hidden" id="hidden_invoice_id" name="hidden_invoice_id" value="{{$invoice_id}}">

            <div class="flexbox-item header">
                Header $invoice_no::{{$invoice_no}}<br>
                $invoice_id::{{$invoice_id}}
            </div>

            <div class="flexbox-item fill-area content flexbox-item-grow">
                <div class="fill-area-content flexbox-item-grow">
                    Content
                    <br /><br />
                    Emulates height 100% with a horizontal flexbox with stretch
                    <br /><br />
                    This box with a border should fill the blue area except for the padding (just to show the middle flexbox item).
                </div>
            </div>

            <div class="flexbox-item footer">
                Footer
            </div>
        </div>


        <form method="POST" action="{{ url('/admin/generate-pdf-by-content') }}" accept-charset="UTF-8" id="form_print_to_pdf_content"
              name="form_print_to_pdf_content"
              enctype="multipart/form-data">
            {!! csrf_field() !!}

            <div class="form-row m-3">
            ...
            FORM CONTENT
            ...
            

            </div>
        </section> <!-- class="card-body" -->

    </div>
    <!-- /.page-wrapper page Content : invoice edit -->


@endsection



{{[email protected]('head')--}}
{{[email protected]('scripts')--}}
    <style  lang="css">
        .flexbox-parent
        {
            height: 842pt !important;
            width: 595pt !important;

            display: flex;
            flex-direction: column;

            justify-content: flex-start; /* align items in Main Axis */
            align-items: stretch; /* align items in Cross Axis */
            align-content: stretch; /* Extra space in Cross Axis */

            background: rgba(255, 255, 255, .1);
        }

        .flexbox-item
        {
            padding: 8px;
        }
        .flexbox-item-grow
        {
            flex: 1; /* same as flex: 1 1 auto; */
        }

        .flexbox-item.header
        {
            background: rgba(255, 0, 0, .1);
        }
        .flexbox-item.footer
        {
            background: rgba(0, 255, 0, .1);
        }
        .flexbox-item.content
        {
            background: rgba(0, 0, 255, .1);
        }

        .fill-area
        {
            display: flex;
            flex-direction: row;

            justify-content: flex-start; /* align items in Main Axis */
            align-items: stretch; /* align items in Cross Axis */
            align-content: stretch; /* Extra space in Cross Axis */

        }
        .fill-area-content
        {
            background: rgba(0, 0, 0, .3);
            border: 1px solid #000000;

            /* Needed for when the area gets squished too far and there is content that can't be displayed */
            overflow: auto;
        }
    </style>
{{[email protected]}}

{{[email protected]}}




@section('scripts')


    <link rel="stylesheet" href="{{ asset('/css/gijgo.min.css') }}" type="text/css">

    <script src="{{ asset('js/AutoNumeric/[email protected]') }}"></script>
    ...

@endsection

I tried to put <style block in several places of the page, but in all cases in generated pdf as all css styles are lost

Which is valid way to use css classes in the generated file?

Thanks!

Jul
02
3 months ago
Activity icon

Started a new Conversation Uploading My Vuejs 2 Project Can I Automatically Create .htaccess?

Hello, Uploading my vuejs 2 project on my ubuntu server after I run app building command

yarn run build

I need anytime manually to run command :

sudo nano  /var/www/html/ads/dist/.htaccess

and fill the file with content :

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>

as I need to open my server pages from any url, like

my-hosting/site/page-of-site

If there is a way to automize this ?

Thanks!

Jun
13
4 months ago
Activity icon

Started a new Conversation Rules For Imask-input To Fill Latitude Value

Hello, In bootstrap-vue app I need to make editor for Latitude / longitude and I added https://github.com/uNmAnNeR/imaskjs for my projectm but it does not work as I expect with mask :

                <imask-input
                        v-model="number_lat"
                        :mask="Number"
                        radix="."
                        :unmask="false"
                        :scale="7"
                        :signed="false"
                        @accept="onAccept"
                        placeholder='Enter latitude here'
                        :from="-90"
                        :to="90"
                />

and data definition :

        data() {
            return {
                number_lat: 51.503,

I got error on page opened :

vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in mounted hook: "Error: value should be string"

and the rules do not permit to enter negative value and rage from to do not work.

Which is the valid way ?

    "bootstrap-vue": "^2.3.0",
    "store": "^2.0.12",
    "v-money": "^0.8.1",
    "vee-validate": "^3.2.1",
    "verte": "0.0.12",
    "vue": "^2.6.11",
    "vue-imask": "^6.0.5",

Thanks!

Jun
12
4 months ago
Activity icon

Started a new Conversation Rules To Fill Latitude Value With Imaskjs

Hello, In bootstrap-vue app I need to make editor for Latitude / longitude and I added https://github.com/uNmAnNeR/imaskjs for my projectm but it does not work as I expect with mask :

                number_lat::{{ number_lat}}<br>
                <imask-input
                        v-model="number_lat"
                        :mask="Number"
                        radix="."
                        :unmask="false"
                        :scale="7"
                        :signed="false"
                        @accept="onAccept"
                        placeholder='Enter latitude here'
                        :from="-90"
                        :to="90"
                />

and data definition :

        data() {
            return {
                number_lat: 51.503,

I got error on page opened :

vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in mounted hook: "Error: value should be string"

and the rules do not permit to enter negative value and rage from to do not work.

Which is the valid way ?

    "bootstrap-vue": "^2.3.0",
    "store": "^2.0.12",
    "v-money": "^0.8.1",
    "vee-validate": "^3.2.1",
    "verte": "0.0.12",
    "vue": "^2.6.11",
    "vue-imask": "^6.0.5",

Thanks!

Jun
04
4 months ago
Activity icon

Started a new Conversation With Leaflet In Bootstrap-vue Remove Default Dialog Popup On Marker's Click

Hello, In vue/ bootstrap-vue app with leaflet 1.6.0 I make custom modal dialog on marker clicking and I can not remove default dialog popup. I do

                let nextMarker = this.leaflet.marker(
                    [nextLocationPoint.lat, nextLocationPoint.lng], {icon: markerIcon})
                    .addTo(locationsMap)
                    .bindPopup(nextLocationPoint.title)
                    .on('mouseover', this.locationMarkerOnMouseOver)
                    .on('click', this.locationMarkerOnClick)  

        methods: {

            locationMarkerOnClick(e) {
                console.log('locationMarkerOnClick e::')
                console.log(e)

                // e.stopPropagation()  // THIS RAISE ERROR
                // e.preventDefault()  // THIS RAISE ERROR
                
                e.cancelBubble = true
                window.event.cancelBubble = true  // NOTHING OF THESE METHODS
                window.event.preventDefault(e)
                window.event.stopPropagation()

                this.$bvModal.show('viewAdLocationModal')

                return false
            }, // locationMarkerOnClick(e) {

I know that in vuejs syntax like :

<div @click.stop.prevent.self="">

OR

@click.prevent="handleClick"

But if it can be used for my case with leaflet?

How to fix this issue?

    "bootstrap-vue": "^2.3.0",
    "vue": "^2.6.11",

Thanks!

May
25
4 months ago
Activity icon

Started a new Conversation Mapping With Elasticquent Got Root Mapping Definition Has Unsupported Parameters Error

Hello, In Laravel 7.12.0 app I added "elasticquent/elasticquent": "dev-master" plugin and I try to implement sample data example from https://www.elastic.co/blog/a-practical-introduction-to-elasticsearch

with shakespeare.json file

But making mapping I got error :

Elasticsearch\Common\Exceptions\BadRequest400Exception
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [shakespeares : {_source={enabled=true}, properties={play_name={analyzer=standard, type=string}, speech_number={analyzer=standard, type=number}, line_number={analyzer=standard, type=string}, text_entry={analyzer=standard, type=text}, speaker={analyzer=standard, type=string}, line_id={analyzer=standard, type=integer}}}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [shakespeares : {_source={enabled=true}, properties={play_name={analyzer=standard, type=string}, speech_number={analyzer=standard, type=number}, line_number={analyzer=standard, type=string}, text_entry={analyzer=standard, type=text}, speaker={analyzer=standard, type=string}, line_id={analyzer=standard, type=integer}}}]","caused_by":{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [shakespeares : {_source={enabled=true}, properties={play_name={analyzer=standard, type=string}, speech_number={analyzer=standard, type=number}, line_number={analyzer=standard, type=string}, text_entry={analyzer=standard, type=text}, speaker={analyzer=standard, type=string}, line_id={analyzer=standard, type=integer}}}]"}},"status":400}

I created model /app/Shakespeare.php :

<?php

namespace App;

use DB;
use Illuminate\Database\Eloquent\Model;
use App\library\MyFuncsClass;

use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use Illuminate\Validation\Rule;
use Elasticquent\ElasticquentTrait;

class Shakespeare extends Model
{
    use ElasticquentTrait;
    protected $table = 'shakespeares';
    protected $primaryKey = 'id';
    public $timestamps = false;

    protected $mappingProperties = array(
/*        'title' => array(
            'type' => 'string',
            'analyzer' => 'standard'
        )*/
        'line_id' => [
            'type' => 'integer',
            'analyzer' => 'standard'
        ],

        'play_name' => [
            'type' => 'string',
            'analyzer' => 'standard' // not_analyzed
        ],

        'speech_number' => [
            'type' => 'number',
            'analyzer' => 'standard'
        ],


        'line_number' => [
            'type' => 'string', // line_number??
            'analyzer' => 'standard'
        ],

        'speaker' => [
            'type' => 'string',
            'analyzer' => 'standard' // not_analyzed
        ],


        'text_entry' => [
            'type' => 'text',
            'analyzer' => 'standard'
        ],

    );



    protected $fillable = [
        'id', 'line_id', 'play_name', 'speech_number', 'line_number', 'speaker', 'text_entry', 'created_at', 'updated_at'
    ];

    function getIndexName()
    {
        return 'shakespeares_root';
    }

    public static function setESMapping()
    {
//        if (   Shakespeare::mappingExists() ) {
//        Shakespeare::deleteMapping();
//        }


        // Error pointing to line below !
        $ret= Shakespeare::createIndex(/*$shards = null, $replicas = null*/);
        \Log::info( '-1 setESMapping $ret ::' . print_r(  $ret, true  ) );

        $ret= Shakespeare::putMapping( true/*$ignoreConflicts = true*/);
        \Log::info( '-2 setESMapping $ret ::' . print_r(  $ret, true  ) );

        $ret= Shakespeare::addAllToIndex();
        \Log::info( '-3 setESMapping $ret ::' . print_r(  $ret, true  ) );

my config/elasticquent.php :

<?php

return array(
    'config' => [
        'hosts'     => ['localhost:9200'],
        'retries'   => 1,
    ],

    'default_index' => 'my_custom_index_name',

);

elasticsearch is running at the moment and I have in console :

 curl localhost:9200
{
  "name" : "athoe",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "e53SDZ6PTMyXhbeJ0Zx7TQ",
  "version" : {
    "number" : "7.7.0",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "81a1e9eda8e6183f5237786246f6dced26a10eaf",
    "build_date" : "2020-05-12T02:01:37.602180Z",
    "build_snapshot" : false,
    "lucene_version" : "8.5.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

I tried to hide columns in $mappingProperties , leaving only sample

'title' => array(
            'type' => 'string',
            'analyzer' => 'standard'
        )

But I have the same error. How to fix it ?

elasticsearch : Version: 7.7.0

Thanks!

May
22
4 months ago
Activity icon

Started a new Conversation How To Use Mixing In Cypress Of Vue/cli 4 App?

Hello, In vue/cli 4 app using cypress for testing I want to use my mixing and for this in my tests/e2e/specs/fileupload_tests.js I added declaration:

import faker from 'faker'
import 'cypress-file-upload'
import appMixin from '../../../src/appMixin'        // Full path is src/appMixin.js

describe('Admin category fileupload functionality', () => {
    it('category fileupload', () => {
        ...

But I see error in my browser :

/mnt/_work_sdb8/wwwroot/lar/VApps/vtasks/node_modules/@babel/runtime/helpers/esm/typeof.js:1
export default function _typeof(obj) {
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

That is not error of invalid mixing path - in this case I got different error.

Which way is valid ?

    "axios": "^0.19.0",
    "core-js": "^3.3.2",
    "cypress-file-upload": "^3.5.3",
    "vue": "^2.6.10",

Thanks!

May
11
5 months ago
Activity icon

Replied to Installed Mewebstudio/captcha Always Returned Invalid Capture

Thanks! It asks for INVISIBLE_RECAPTCHA_SECRETKEY. I have to get it on some external resource ?