PetroGromovo

PetroGromovo

Member Since 7 Months Ago

Experience Points
2,700
Total
Experience

2,300 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

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

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 1
2,700 XP
18 Sep
4 days ago

PetroGromovo left a reply on How In Testing Switch DatabaseTransactions Off/on On Condition?

Sorry, but could you remind how to copy vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php file in my /app/ subdirectory, but I am not sure how correctly to make it ? I do not know how this feature is entitles and failed to find the decision in the net...

16 Sep
6 days ago

PetroGromovo left a reply on How In Testing Switch DatabaseTransactions Off/on On Condition?

I know about RefreshDatabase - that is not my case and I have some demo initial data and make make my test with these data. Resfreshing them all takes some time. I think to use and modify vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php file in my /app/, but I am not sure how correctly to make it.

15 Sep
1 week ago

PetroGromovo left a reply on How In Testing Switch DatabaseTransactions Off/on On Condition?

I found that DatabaseTransactions.php functionality is implemented in vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php file. Seems there is a way of coping this file into my project under /app/ and modifing it with comdition code, but I am not sure in which subdirecory that file must be copied?

PetroGromovo started a new conversation How In Testing Switch DatabaseTransactions Off/on On Condition?

Hello, In laravel 5.8 application I use test with DatabaseTransactions option, so inserted data in testing db are cleared after testing, like:

<?php

namespace Tests\Feature;

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

use Illuminate\Foundation\Testing\DatabaseTransactions;

use App\User;
use App\UserGroup;
use App\Http\Traits\funcsTrait;

class ProfilePageTest extends TestCase  // vendor/bin/phpunit   tests/Feature/ProfilepageTest.php
{
    use funcsTrait;

    use DatabaseTransactions; // TO COMMENT THESE LINE IF WE NEED TO CHECK CREATED DATA IN BD

    public function testProfilePage()
    {
...

and that works ok, but I need in some case to switch off DatabaseTransactions option without modifing php testing files. But to change some option when relative key test_without_database_transactions in db.setting_table is set to true. If there is a way to make it, like condition :

if ( check value in in db.setting_table.test_without_database_transactions ) {
use Illuminate\Foundation\Testing\DatabaseTransactions;
} 

use App\User;
use App\UserGroup;
use App\Http\Traits\funcsTrait;

class ProfilePageTest extends TestCase  // vendor/bin/phpunit   tests/Feature/ProfilepageTest.php
{
    use funcsTrait;

if ( check value in in db.setting_table.test_without_database_transactions ) {
    use DatabaseTransactions; // TO COMMENT THESE LINE IF WE NEED TO CHECK CREATED DATA IN BD
}

Can it be done in someway?

Thanks!

12 Sep
1 week ago

PetroGromovo started a new conversation After Installing Of Docker I Lack Free Space

Hello, I installed Kubuntu 18 about 3 weeks ago on partition in 28G, but after installing of docker seems this space is not enough for my root partition I found that /var/lib/docker/ takes 11.1 GiB.


Code:$ df -HT   
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  4,2G     0  4,2G   0% /dev
tmpfs          tmpfs     828M  1,7M  827M   1% /run
/dev/sdb5      ext4       28G   27G     0 100% /
tmpfs          tmpfs     4,2G  186M  4,0G   5% /dev/shm
tmpfs          tmpfs     5,3M  4,1k  5,3M   1% /run/lock
tmpfs          tmpfs     4,2G     0  4,2G   0% /sys/fs/cgroup
/dev/sdb7      ext4       30G   15G   13G  54% /mnt/_Prior_Kubuntu_18
/dev/sdb8      fuseblk   399G   88G  311G  23% /mnt/_work_sdb8
/dev/sdb1      ext4      347M   91M  235M  28% /boot
/dev/sda6      fuseblk   237G  136G  101G  58% /mnt/Work_sda6
/dev/sda8      fuseblk   628G  606G   22G  97% /mnt/Media_sda8
tmpfs          tmpfs     828M   21k  828M   1% /run/user/1000My working partition is /dev/sdb5. Also I use /dev/sdb7 for ubuntu installation.

In gparted I see : https://imgur.com/a/sCNFsAt

As that is rather risky to resize partitions with live data and I have 2 partitions 28 and 25 GiB Biggest for / and in 25 GiB partition I want to install /var Both are on the same ssd disk.

In Kubuntu installation wizard, when select point for additive partinion I see next options : /, /boot, /home, /tmp, /usr, /var, /srv, /opt, /usr/local?

I selected /var as I tried to install docker and I found that /var/lib/docker/ takes 11.1 GiB. I think that installing /var into 25 GiB partition I will not have problems with lack of space. Installig linux I have never installed some one of options : /home, /usr, /var into separate partion. Just want to confirm, no any risk ? If there is what I have to pay attention at installing/working in OS?

Thanks!

PetroGromovo started a new conversation In Envoy Script Console Command Raise Error

Hello, With laravel 5.8 envoy command I deploy my changes on server and need to run some console command and I my script I got error

Could not open input file: artisan

on the second console command

In my script :

@task( 'update_symlinks' )
ln -nfs {{ $release_number_dir }} {{ $current_dir }};

@foreach($writableDirs as $file)
    chmod -R 777 {{ $release_number_dir }}/{{ $file }}

    chown -R {{ $server_login_user }}:www-data {{ $release_number_dir }}/{{ $file }}

@endforeach

cd {{ $release_number_dir }}

php artisan envoy:write-app-version app_version  // THAT WORKS OK

@endtask



@task('clean_old_releases')

php artisan envoy:delete-old-versions  Hostels2Deployed  // BUT THAT raise error

@endtask

@macro('Hostels2Deploy',['on'=>'dev'])
    ...
    update_symlinks
    clean_old_releases
@endmacro

envoy:delete-old-versions defined in app/Console/Commands/envoyDeleteoldVersions.php :


<?php

namespace App\Console\Commands;

use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use Illuminate\Console\Command;

class envoyDeleteoldVersions extends Command
{
    protected $signature = 'envoy:delete-old-versions {directory_to_clear}';

    protected $description = 'Command description';

    public function __construct()
    {
        parent::__construct();
    }

    public function handle()     
    {       // php artisan envoy:delete-old-versions  "/_wwwroot/lar/Hostels2/storage/app/public/hostels"

        $arguments = $this->arguments();
        if ( !empty($arguments['directory_to_clear']) ) {
            $directory_name = $arguments['directory_to_clear'];
        }
        $directoriesList = File::directories($directory_name);

        $sortedDirectories = collect($directoriesList)
            ->sortBy(function ($dir) {
                return filemtime( $dir );
            })
        echo '<pre>+++ 222 $sortedDirectories::'.print_r($sortedDirectories,true).'</pre>';
        die("-1 XXZ");
    }
}

Why error and how to fix it ?

10 Sep
1 week ago

PetroGromovo started a new conversation How To Add Custom Fields To Logged User To Vue Side?

Hello,

In my Laravel 5.8 / vuejs 2.6 / vuex 3.1 I want to add custom fields to logged user based on personal data and methods defined in user Model I use next method which is called from login.vue page:

  export function login(credentials) {
       return new Promise((res, rej) => {
           axios.post('/api/auth/login', credentials)
               .then((response) => {
                   console.log("+++ credentials::")
                   console.log( credentials )
   
                   console.log("+++ response::")
                   console.log( response )
                   setAuthorizationToken(response.data.access_token);
                   res(response.data);
               })
               .catch((err) =>{
                   rej("Wrong email or password");
               })
       })
   }

and standart app/Http/Controllers/Auth/LoginController.php file, where login method ios not defined. How can I on laravel side catch after login event, assign custom fields and return them to Promise method above ?

Thanks!

07 Sep
2 weeks ago

PetroGromovo started a new conversation Running Docker Instance With LAMP Got Python Not Found Error

Hello, in my Kubuntu 18.04 I installed docker-ce and running LAMP instance suffer error that python not found:

$ docker-compose up -d --build 
Building web
Step 1/3 : FROM php:7.2-apache
 ---> 35e5c60e1f7d
Step 2/3 : RUN apt-get update &&     apt-get install -y     libfreetype6-dev     libwebp-dev     libjpeg62-turbo-dev     libpng-dev     nano     git-core     curl     build-essential     openssl     libssl-dev     libgmp-dev     libldap2-dev     netcat     sqlite3     libsqlite3-dev      && git clone https://github.com/nodejs/node.git      && cd node      && ./configure      && make      && sudo make install     docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/ &&     docker-php-ext-install gd pdo pdo_mysql pdo_sqlite zip gmp bcmath pcntl ldap sysvmsg exif && a2enmod rewrite
 ---> Running in 65d838fde10d
Get:1 http://security-cdn.debian.org/debian-security buster/updates InRelease [39.1 kB]
Get:2 http://cdn-fastly.deb.debian.org/debian buster InRelease [118 kB]
Get:3 http://cdn-fastly.deb.debian.org/debian buster-updates InRelease [49.3 kB]
Get:4 http://security-cdn.debian.org/debian-security buster/updates/main amd64 Packages [82.1 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian buster/main amd64 Packages [7897 kB]
Get:6 http://cdn-fastly.deb.debian.org/debian buster-updates/main amd64 Packages [884 B]
Fetched 8187 kB in 2s (3674 kB/s)
Reading package lists...
...
Reading package lists...
Get:42 http://cdn-fastly.deb.debian.org/debian buster/main amd64 xauth amd64 1:1.0.10-1 [40.3 kB]

debconf: delaying package configuration, since apt-utils is not installed
Fetched 21.1 MB in 3s (6954 kB/s)
Selecting previously unselected package less.
...
Setting up libfreetype6-dev:amd64 (2.9.1-3) ...
Processing triggers for libc-bin (2.28-10) ...
Processing triggers for mime-support (3.62) ...
Cloning into 'node'...
Checking out files: 100% (32035/32035), done.
./configure: 4: exec: python: not found
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update &&     apt-get install -y     libfreetype6-dev     libwebp-dev     libjpeg62-turbo-dev     libpng-dev     nano     git-core     curl     build-essential     openssl     libssl-dev     libgmp-dev     libldap2-dev     netcat     sqlite3     libsqlite3-dev      && git clone https://github.com/nodejs/node.git      && cd node      && ./configure      && make      && sudo make install     docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/ &&     docker-php-ext-install gd pdo pdo_mysql pdo_sqlite zip gmp bcmath pcntl ldap sysvmsg exif && a2enmod rewrite' returned a non-zero code: 127

I payed attention at message :

since apt-utils is not installed

But I have installed this package :

$ dpkg --get-selections | grep apt-utils
apt-utils                                       install

and rebooted my OS after installation

# docker info                                           
Client:
 Debug Mode: false

Server:
 Containers: 3
  Running: 0
  Paused: 0
  Stopped: 3
 Images: 1
 Server Version: 19.03.2
 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 ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.15.0-20-generic
 Operating System: Ubuntu 18.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.711GiB
 Name: serge-at-hoe
 ID: 4IWA:LRTR:4UJS:FEDE:PCOJ:ZFFB:RLXR:LRPT:7QBI:XGLY:VVIV:TNJQ
 Docker Root Dir: /var/lib/docker
 Debug Mode: 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

My web/Dockerfile.yml :

FROM php:7.2-apache

RUN apt-get update && \
    apt-get install -y \
    libfreetype6-dev \
    libwebp-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    nano \
    git-core \
    curl \
    build-essential \
    openssl \
    libssl-dev \
    libgmp-dev \
    libldap2-dev \
    netcat \
    sqlite3 \
    libsqlite3-dev \
     && git clone https://github.com/nodejs/node.git \
     && cd node \
     && ./configure \
     && make \
     && sudo make install \
    docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/ && \
    docker-php-ext-install gd pdo pdo_mysql pdo_sqlite zip gmp bcmath pcntl ldap sysvmsg exif \
&& a2enmod rewrite

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

I found in my OS :

$ python3 --version
Python 3.6.8
$ python --version
Python 2.7.15+
$ python2 --version
Python 2.7.15+


$ dpkg --get-selections | grep python
libpython-stdlib:amd64                          install
libpython2.7:amd64                              install
libpython2.7-minimal:amd64                      install
libpython2.7-stdlib:amd64                       install
libpython3-stdlib:amd64                         install
libpython3.6:amd64                              install
libpython3.6-minimal:amd64                      install
libpython3.6-stdlib:amd64                       install
python                                          install
python-appindicator                             install
python-apt-common                               install
python-asn1crypto                               install
python-backports.ssl-match-hostname             install
python-cached-property                          install
python-cairo:amd64                              install
python-certifi                                  install
python-cffi-backend                             install
python-chardet                                  install
python-cryptography                             install
python-dbus                                     install
python-docker                                   install
python-dockerpty                                install
python-dockerpycreds                            install
python-docopt                                   install
python-enchant                                  install
python-enum34                                   install
python-funcsigs                                 install
python-functools32                              install
python-gi                                       install
python-glade2                                   install
python-gobject                                  install
python-gobject-2                                install
python-gtk2                                     install
python-gtksourceview2                           install
python-idna                                     install
python-ipaddress                                install
python-jsonschema                               install
python-minimal                                  install
python-mock                                     install
python-mysql.connector                          install
python-openssl                                  install
python-paramiko                                 install
python-pbr                                      install
python-pexpect                                  install
python-pkg-resources                            install
python-ptyprocess                               install
python-pyasn1                                   install
python-pyodbc                                   install
python-pysqlite2                                install
python-qt4-dbus                                 install
python-requests                                 install
python-six                                      install
python-talloc                                   install
python-texttable                                install
python-urllib3                                  install
python-websocket                                install
python-yaml                                     install
python2.7                                       install
python2.7-minimal                               install
python3                                         install
python3-apport                                  install
python3-apt                                     install
python3-aptdaemon                               install
python3-aptdaemon.gtk3widgets                   install
python3-asn1crypto                              install
python3-blinker                                 install
python3-bs4                                     install
python3-cairo:amd64                             install
python3-certifi                                 install
python3-cffi-backend                            install
python3-chardet                                 install
python3-commandnotfound                         install
python3-cryptography                            install
python3-cups                                    install
python3-cupshelpers                             install
python3-dbus                                    install
python3-dbus.mainloop.pyqt5                     install
python3-debconf                                 install
python3-debian                                  install
python3-defer                                   install
python3-distro-info                             install
python3-distupgrade                             install
python3-feedparser                              install
python3-gdbm:amd64                              install
python3-gi                                      install
python3-gi-cairo                                install
python3-html5lib                                install
python3-httplib2                                install
python3-idna                                    install
python3-jwt                                     install
python3-lxml:amd64                              install
python3-macaroonbakery                          install
python3-mako                                    install
python3-markupsafe                              install
python3-minimal                                 install
python3-nacl                                    install
python3-oauthlib                                install
python3-olefile                                 install
python3-pexpect                                 install
python3-pil:amd64                               install
python3-pkg-resources                           install
python3-problem-report                          install
python3-protobuf                                install
python3-ptyprocess                              install
python3-pymacaroons                             install
python3-pyqt5                                   install
python3-pyxattr                                 install
python3-renderpm:amd64                          install
python3-reportlab                               install
python3-reportlab-accel:amd64                   install
python3-requests                                install
python3-requests-unixsocket                     install
python3-rfc3339                                 install
python3-sip                                     install
python3-six                                     install
python3-software-properties                     install
python3-systemd                                 install
python3-tz                                      install
python3-uno                                     install
python3-update-manager                          install
python3-urllib3                                 install
python3-webencodings                            install
python3-xapian                                  install
python3-xdg                                     install
python3-xkit                                    install
python3-yaml                                    install
python3.6                                       install
python3.6-minimal                               install

Can it be that docker runs invalid python and how fix it ?

$ lsb_release -d; uname -r; uname -i
Description:    Ubuntu 18.04.3 LTS
4.15.0-20-generic
x86_64
$ docker -v
Docker version 19.03.2, build 6a30dfc

Thanks!

28 Aug
3 weeks ago

PetroGromovo left a reply on Selecting Time In Vue2-datepicker Picker

After some additive testing I found that to have valid default value for time picker I need to convert string time value 21:50:00 into format 2019-08-27T21:50:00.000Z I have installed :

        "vue": "^2.6.10",
        "moment-timezone": "^0.5.26",
        "vue-moment": "^4.0.0",

and in my resources/js/app.js :

import moment from 'moment-timezone'

timezone-in-vuejs-8b1df48d35bb
moment.tz.setDefault('Europe/Kiev')

How better to make this convirting without depend on timezone ?

26 Aug
3 weeks ago

PetroGromovo started a new conversation Selecting Time In Vue2-datepicker Picker

Hello! In my Laravel 5/vuejs 2.6 I use "vue2-datepicker": "^2.11.2" and I need to use it as time selector, which is related mysql time field. I do it with code :

<date-picker
      v-model="hostelExtraDetailsArray.reception_hours_start"
      type="datetime"
      :time-picker-options="timePickerOptions"
      id="cbx_extra_details_reception_hours_start"
      :lang="'en'"
      :type="'time'"
      :format="'hh:mm A'"
      :placeholder="'Select hours start'"
></date-picker>

<label :for="'cbx_extra_details_reception_hours_start'" class="">&nbsp;
   <span>Reception hours start</span>
</label>

        data() {
            return {
                ...
                hostelExtraDetailsArray : [],
                timePickerOptions:{
                    start: '00:00',
                    step: '00:10',
                    end: '23:50'
                },

But when I open the page and read data from db(hostelExtraDetailsArray.reception_hours_start), which is "08:30:00", nothing is shown in time picker, but I expected to see "08:30"...

If to select some value, ex . 01:20 AM hostelExtraDetailsArray.reception_hours_start is filled with value 019-08-18T22:20:00.000Z and my question to to fill it with time value only and why I have 3 hours shift?

On my kubuntu 18 I have GMT+2 time zone, but I am not sure if I have timezone for my vue ...

How to make it ?

Thanks!

22 Aug
1 month ago

PetroGromovo started a new conversation With Vue-form-wizard Define If Capture Is Clicked?

Hello In my Laravel 5/vuejs 2.6 I use https://github.com/BinarCode/vue-form-wizard and on the last tab I added captura component from DanSnow/vue-recaptcha.

With DanSnow/vue-recaptcha I managed to set to my var is_recaptcha_verified if recaptcha is checked. What I search is how to set finish-button-text button enabled/disabled depending on my is_recaptcha_verified var ?

If enabled/disabled of finish-button-text button is not supported, how in some other way to finish from finishing the wizard ? I tried to use method

  @on-validate="handleValidation"

but failed.

Which is valid way? Please example.

17 Aug
1 month ago

PetroGromovo left a reply on Which Service Have I To Select ?

Could you, please, provide some link to tutorial relative to current Maps Javascript API ?

16 Aug
1 month ago

PetroGromovo started a new conversation Which Service Have I To Select ?

Hello! I want to show google map by coordinates in my Laravel 5/vuejs 2.6 app and I found https://github.com/xkjyeah/vue-google-maps plugin and it has link to https://developers.google.com/maps/documentation/javascript/get-api-key url and following I opened page with noumerous choice : https://prnt.sc/otflf9 Have I select Maps Jacascript API or something else ?

Thanks!

12 Aug
1 month ago

PetroGromovo left a reply on Uploading File With Vue-upload-component Can Not Get Width/height Of The File

I uploaded this example live. Please, take a look at http://hostels2.my-demo-apps.tk/customer-register : when image on 3rd tab is selected event is triggered.

But I see that onload is not triggered and error in method : https://imgur.com/a/oGZjJdc

09 Aug
1 month ago

PetroGromovo started a new conversation Uploading File With Vue-upload-component Can Not Get Width/height Of The File

Hello! Looking how vue-upload-component works (https://lian-yue.github.io/vue-upload-component/#/documents) on events when file is uploaded I see structure of avatarFiles array with uploaded file:

                    <file-upload
                            ref="upload"
                            v-model="avatarFiles"
                            post-action="/post.method"
                            put-action="/put.method"
                            @input-file="inputFile"
                            @input-filter="inputFilter"
                            :multiple="false"
                            class="btn btn-outline-danger btn-sm"
                    >
                        Upload avatar
                    </file-upload>

I need to get width/height of any uploaded file. I found a way with watch :

        watch: {
            avatarFiles(file){
                console.log("avatarFiles  file::")
                console.log( file )
                console.log( this.toObject(file) )

                let uploadedImage= this.toObject(file)
                console.log("uploadedImage[0].blob::")
                console.log( uploadedImage[0].blob )

                var image = new FileReader(uploadedImage[0].blob);
                console.log("-2 avatarFiles image::")
                console.log(image)
                image.onload = (e) => {
                    console.log("INSIDE image.onload e::")
                    console.log( e )

                    console.log(`++the image dimensions are ${image.width}x${image.height}`);
                }
            }

I suppose that file varthat is just uploaded file and console output confirms this. this.toObject is my method I use to convert from Observer class :

toObject(arr) {
    var rv = {};
    for (var i = 0; i < arr.length; ++i)
    rv[i] = arr[i];
    return rv;
},

But code inside of method

image.onload = (e) => {
   ...

is not triggered at all and in console I see error : https://imgur.com/a/vX60fMA I see that in var uploadedImage[0].blob -valid path to uploaded image and I sent it for

    var image = new FileReader(uploadedImage[0].blob);

But why error in cosole and how to fix it ?

vuejs 2.6 / vue-slider-component 3.0.33

Thanks!

06 Aug
1 month ago

PetroGromovo left a reply on Which Versions Of Composer , Npm, Nodejs For Installed Ubuntu 18

no 18.04, as it is LTS. I am afraid it has too old versions

PetroGromovo started a new conversation Which Versions Of Composer , Npm, Nodejs For Installed Ubuntu 18

Hello, I reinstalled ubuntu 18. Please remind which versions of composer , npm, nodejs must be installed and from which source ? looksx like in ubuntu they are too old...

Thanks!

31 Jul
1 month ago

PetroGromovo left a reply on How Read Paypal Plans With Different State

Thank you, it helped! Also I searched and did not find in paypal account/app settings are there some pages/console/tools helping with crud for plans(also descriptions, agreements)?

30 Jul
1 month ago

PetroGromovo started a new conversation How Read Paypal Plans With Different State

Hello, Looking at this doc http://paypal.github.io/PayPal-PHP-SDK/sample/doc/billing/ListPlans.html in my laravel 5.8 app using "paypal/rest-api-sdk-php": "*", I read all my paypal plans with :

        $params   = array('page_size' => '20');
        $planList = Plan::all($params, $this->apiContext);

I read all paypal plans with

State = “CREATED”

But paypal plans which were activated before are not in lists above:

In file : vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/Plan.php I see function :

    public static function all($params, $apiContext = null, $restCall = null)
    {
        ArgumentValidator::validate($params, 'params');
        $payLoad = "";
        $allowedParams = array(
            'page_size' => 1,
            'status' => 1,
            'page' => 1,
            'total_required' => 1
        );
        $json = self::executeCall(
            "/v1/payments/billing-plans/" . "?" . http_build_query(array_intersect_key($params, $allowedParams)),
            "GET",
            $payLoad,
            null,
            $apiContext,
            $restCall
        );
        $ret = new PlanList();
        $ret->fromJson($json);
        return $ret;
    }

I tried to set state parameter to return all paypal plans, like :

        $params   = array('page_size' => '20', 'state'=>'ACTIVE');
        $planList = Plan::all($params, $this->apiContext);
        return $planList;

but failed, anyway only

State = “CREATED”

are returned?

How to get listing of all paypal plans ( or only activated ) ?

Also looking at paypal doc https://developer.paypal.com/docs/api/overview/#list-plans I do not see any filter state options. Any idea ?

Thanks!

27 Jul
1 month ago
26 Jul
1 month ago

PetroGromovo started a new conversation Error Collection::appends Does Not Exist In Pagination With Mapping

Hello!

In my Laravel 5.8 app I have database request with mapping, like:

        $paymentItems        = PaymentItem
            ::getByStatus('C', 'payments')
            ->select(
                $this->payment_items_tb . '.*',
                $this->downloads_tb . '.title as payed_item_title',
                $this->users_tb     . '.username as payment_username',
                $this->payments_tb . '.payment_type',
                ...
                $this->payments_tb . '.payer_shipping_address'
            )
            ->orderBy($this->payment_items_tb . '.created_at', 'desc')
            ->join($this->payments_tb, $this->payments_tb . '.id', '=', $this->payment_items_tb . '.payment_id')
            ->join($this->users_tb, $this->users_tb . '.id', '=', $this->payments_tb . '.user_id')
            ->join($this->downloads_tb, $this->downloads_tb . '.id', '=', $this->payment_items_tb . '.item_id')
            ->get()
            ->map(function ($item) {
                return [
                    'id'               => $item->id,
                    'total'            => $item->price * $item->quantity,
                        ....
                    'payment_type_label'     => Payment::getPaymentTypeLabel($item->payment_type),
                ];
            });

It worked ok for me untill I decided to remake this listing as pagination, like:

        $paymentItems        = PaymentItem
            ::getByStatus('C', 'payments')
            ->select(
                $this->payment_items_tb . '.*',
                $this->downloads_tb . '.title as payed_item_title',
                $this->users_tb     . '.username as payment_username',
                $this->payments_tb . '.payment_type',
                ...
                $this->payments_tb . '.payer_shipping_address'
            )
            ->orderBy($this->payment_items_tb . '.created_at', 'desc')
            ->join($this->payments_tb, $this->payments_tb . '.id', '=', $this->payment_items_tb . '.payment_id')
            ->join($this->users_tb, $this->users_tb . '.id', '=', $this->payments_tb . '.user_id')
            ->join($this->downloads_tb, $this->downloads_tb . '.id', '=', $this->payment_items_tb . '.item_id')
            ->paginate($ref_items_per_pagination, null, null, $page)
            ->onEachSide((int)($ref_items_per_pagination / 2))

            ->map(function ($item) {
                return [
                    'id'               => $item->id,
                    'total'            => $item->price * $item->quantity,
                    ...
                    'payment_type_label'     => Payment::getPaymentTypeLabel($item->payment_type),
                ];
            });

But In my blade template I got error :

Method Illuminate\Support\Collection::appends does not exist. (View: /resources/views/defaultBS41Backend/admin/dashboard/payments_rows.blade.php) {"userId":5,"exception":"[object] (ErrorException(code: 0): Method Illuminate\Support\Collection::appends does not exist. (View: /resources/views/defaultBS41Backend/admin/dashboard/payments_rows.blade.php) at /vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php:102, BadMethodCallException(code: 0): Method Illuminate\Support\Collection::appends does not exist.
trying to show pagination links block:
            <div class="row">
                {{ $paymentItems->appends([])->links() }}
                <input type="button" class="btn btn-primary" value="Refresh" onclick="javascript:backendDashboard.showPaymentsRows(1); return false;">
        </div>

Is there is a way to fix this error and to show paginations links ?

Thanks!

22 Jul
2 months ago

PetroGromovo started a new conversation If Paypal Plan Has “inactive” Status?

Hello, Testing pagination in laravel 5 app with request

Working with Update Plan API http://paypal.github.io/PayPal-PHP-SDK/sample/doc/billing/UpdatePlan.html I did not find if plan has inactive state and which key have I to use for it? I made :

   $value = new PayPalModel('{
       "state":"INACTIVE"
     }');

But got error : Requested state change is invalid.

  1. How valid?

  2. If in my developer's account there is a page where I can see all my plans and work with them in my developer's account ?

Thanks!

16 Jul
2 months ago

PetroGromovo started a new conversation How To Multiply Number Of Rows In Result Set Testing Pagination

Hello, Testing pagination in laravel 5 app with request

$modelsList = Model
    ::getByStatus('A')
    ->get();

I have difficulties as there are too few data in Model table. If there is a way with eloquent/collection to multiply number of rows in result set with less code as possible and easy to return ?

Ex : In my case I got 5 rows, as the app is at dev stage with some default data from migration. but I would easily have, 50, 200, 500 rows.

Thanks!

10 Jul
2 months ago

PetroGromovo left a reply on How From Intervention Image Get Resource For Imagepng?

That is clear for me db issue, but not clear this simple How to show images to the page. Must it be like <img src="[email protected]?image=6" returning response from psrResponse ?

PetroGromovo left a reply on How From Intervention Image Get Resource For Imagepng?

Thank you !

  1. I managed to save file on disk as :
$img->save( public_path('result_foo.png'), /* best quality */100, 'png' );
  1. returning in a control :
        $response = $img->psrResponse('png', 1000);
        return $response;

I show my image in browser

  1. But how can I use this script in my blade template, as I need on some page to show several programmatically generated images ?

PetroGromovo started a new conversation How From Intervention Image Get Resource For Imagepng?

Hello, In laravel 5.8 app I want to banner generation programmatically, like base image, image at left, text at center, watermark at right. I do it as :

        // create new Intervention Image
        $img = \Image::make( public_path('foo.jpg') );

// paste another image
        $img->insert( public_path('bar.png') );

// create a new Image instance for inserting
        $watermark = \Image::make( public_path('watermark.png') );
        $img->insert($watermark, 'center');

        // insert watermark at bottom-right corner with 10px offset
        $img->insert( public_path('watermark.png'), 'bottom-right', 10, 10);



        // create Image from file
        $img = \Image::make( public_path('foo.jpg') );

// write text
        $img->text('The quick brown fox jumps over the lazy dog.');

// write text at position
        $img->text('The quick brown fox jumps over the lazy dog.', 120, 100);

// use callback to define details
        $img->text('foo', 0, 0, function($font) {
            $font->file( public_path('fonts/themify/themify.ttf') );
            $font->size(24);
            $font->color('#fdf6e3');
            $font->align('center');
            $font->valign('top');
            $font->angle(45);
        });

//        var_dump($img);

        // draw transparent text
        $img->text('foo', 0, 0, function($font) {
            $font->color(array(255, 255, 255, 0.5));
        });

        header('Content-Type: image/png');
        imagepng($img, null, 100);
//        imagedestroy($img); //Free up memory

And I got error :

imagepng() expects parameter 1 to be resource, object given

dumping $img I got :

object(Intervention\Image\Image)#910 (9) { ["driver":protected]=> object(Intervention\Image\Gd\Driver)#907 (2) { ["decoder"]=> object(Intervention\Image\Gd\Decoder)#908 (1) { ["data":"Intervention\Image\AbstractDecoder":private]=> NULL } ["encoder"]=> object(Intervention\Image\Gd\Encoder)#905 (4) { ["result"]=> NULL ["image"]=> NULL ["format"]=> NULL ["quality"]=> NULL } } ["core":protected]=> resource(45) of type (gd) ["backups":protected]=> array(0) { } ["encoded"]=> string(0) "" ["mime"]=> string(10) "image/jpeg" ["dirname"]=> string(40) "/mnt/_work_sdb8/wwwroot/lar/votes/public" ["basename"]=> string(7) "foo.jpg" ["extension"]=> string(3) "jpg" ["filename"]=> string(3) "foo" }

I see that $img has protected resource property. How can I resource from $img for imagepng? Do I move in valid way ?

Thanks!

09 Jul
2 months ago

PetroGromovo left a reply on Structure Of Laravel 5/vuejs 2 With Flexbox

But in which way it can be fixed ? 1) Can I replace mainapp with some other tag that would not raise error? Whivh tag can it be? Is it normal idea of checking my vuejs app under validator.w3, as I do with non vuejs apps?

08 Jul
2 months ago

PetroGromovo started a new conversation Are Routes With "_" Chars Valid ?

Hello, If there is a difference in route description of my laravel 5 app as :

ASK Route::post('run-user-list-export-to-csv', '[email protected]_user_list_export_to_csv');

and

ASK Route::post('run_user_list_export_to_csv', '[email protected]_user_list_export_to_csv');

I mean if second variant will work without problems on any modern browsers and does it fit any strict SOLID,DRY, SEO FREANDLY, Any route rules?

I mean that second variant is more convinient to searching in my PHPStorm editor , as writing in seasrch like run_user_list_export_to_csv will find all js script all, web routes and control definitions ...

Thanks!

06 Jul
2 months ago

PetroGromovo started a new conversation Structure Of Laravel 5/vuejs 2 With Flexbox

Hello!

I am making layout of my app with flexbox and I got a page:

http://hostels-tours.nilov-sergey-demo-apps.tk/

I decided to check it under https://validator.w3.org service

And got errors:

Error: Element mainapp not allowed as child of element main in this context. (Suppressing further errors from this subtree.)

From line 47, column 13; to line 47, column 21

          <mainapp></main

Content model for element main:
Flow content.

And as I see message :

Suppressing further errors from this subtree

it could have a lot errors more...

That is Laravel 5/vuejs 2 / bootstrap 4 app and I need to keep structure of my app and for this in my container file :

</head>

<body>

    <div id="app">

        <header>
            <AppHeader />
        </header>
        <main>
            <mainapp></mainapp>
            <nav>Nav</nav>
            <aside>Aside</aside>
        </main>
        <footer>Footer</footer>

    </div>

</body>

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

</html>

Main vuejs container resources/js/components/BS4/MainApp.vue :

<template>
    <div id="page_content">
        
        <notifications group="hostels2_notification" />
        <router-view></router-view>
    ...

In resources/js/app.js :

import mainapp from './components/BS4/MainApp.vue';

I do not like defining inside app div elements main/header/footer , but I had to make it as I need all parts of the app be inside vuejs block.

How do you think which my app structure must be to keep good style and exclude errors in https://validator.w3.org or some other bad styling ?

Thanks!

04 Jul
2 months ago

PetroGromovo started a new conversation Implementing Google Calendar In Laravel App

Hello, in a tasks description I meet a demand to work with Google Calendar Api with Laravel framework. Priorly I worked with fullcalendar, when data were saved in db and in this calendar I could work with data and save my changes to db.

Can you say me if Google Calendar has some advantages in comparison with fullcalendar? Where data are kept etc...

I have worked with other google products so I have

"google/apiclient": "^2.2"

installed in my app. Is it enough or are there some bettr tools for Google Calendar implementation ?

Thanks!

03 Jul
2 months ago

PetroGromovo started a new conversation How Html Developer Can Work With Live Site?

I have a situation when to a laravel/vuejs/bootstrap project we need to add html developer, who knows html/css, but no .vue/.scss with npm watch utility and that seems very complicated for him to install this app on his side.

As far as I know there are possibilities in such cases for html developer to edit site view live.

I even know such plugin https://forum.vivaldi.net/topic/10124/user-css-extensions I worked with it a but. Are there some tools for html developer to work with live pages in browsers?

Thanks!

26 Jun
2 months ago

PetroGromovo left a reply on Why Installing Laravel 5.7 On Ubuntu I Have Fork Failed - Cannot Allocate Memory In Error

I tried

composer clear-cache

did not help me

I run with additive parameter :

$ sudo composer install  --profile
[6.2MB/0.20s] Loading composer repositories with package information
[6.4MB/0.35s] Updating dependencies (including require-dev)
[1449.1MB/271.30s]   - Installing psr/log (1.1.0)
[448.4MB/317.90s] The following exception is caused by a lack of memory and not having swap configured
[448.4MB/317.91s] Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details

PHP Fatal error:  Uncaught ErrorException: proc_open(): fork failed - Cannot allocate memory in /usr/share/php/Symfony/Component/Console/Application.php:943
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', '/usr/share/php/...', 943, Array)
#1 /usr/share/php/Symfony/Component/Console/Application.php(943): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 /usr/share/php/Symfony/Component/Console/Application.php(751): Symfony\Component\Console\Application->getSttyColumns()
#3 /usr/share/php/Symfony/Component/Console/Application.php(712): Symfony\Component\Console\Application->getTerminalDimensions()
#4 /usr/share/php/Symfony/Component/Console/Application.php(645): Symfony\Component\Console\Application->getTerminalWidth()
#5 /usr/share/php/Symfony/Component/Console/Application.php(127): Symfony\Component\Console\Application->renderException(Object(ErrorException), Object(Symfony\Component\Console\Output\StreamOutput))
#6 /usr/share/php/Composer/Console/Application.ph in /usr/share/php/Symfony/Component/Console/Application.php on line 943

Fatal error: Uncaught ErrorException: proc_open(): fork failed - Cannot allocate memory in /usr/share/php/Symfony/Component/Console/Application.php:943
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', '/usr/share/php/...', 943, Array)
#1 /usr/share/php/Symfony/Component/Console/Application.php(943): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 /usr/share/php/Symfony/Component/Console/Application.php(751): Symfony\Component\Console\Application->getSttyColumns()
#3 /usr/share/php/Symfony/Component/Console/Application.php(712): Symfony\Component\Console\Application->getTerminalDimensions()
#4 /usr/share/php/Symfony/Component/Console/Application.php(645): Symfony\Component\Console\Application->getTerminalWidth()
#5 /usr/share/php/Symfony/Component/Console/Application.php(127): Symfony\Component\Console\Application->renderException(Object(ErrorException), Object(Symfony\Component\Console\Output\StreamOutput))
#6 /usr/share/php/Composer/Console/Application.ph in /usr/share/php/Symfony/Component/Console/Application.php on line 943
$ free
              total        used        free      shared  buff/cache   available
Mem:        1014384       49112      873628        1308       91644      832716
Swap:       1048572      257092      791480

It was very strange to read in error's description:

The following exception is caused by a lack of memory and not having swap configured

as my free command show that I have swap . Also I need to notice that command

sudo composer install

was hung for more 5 minutes...

Any ideas?

P.S : I created new laravel app with default packages and composer installed it ok... as it has very few packeges? Can it be that some packages in my packages listing above raised this problem ?

21 Jun
3 months ago

PetroGromovo left a reply on Why Installing Laravel 5.7 On Ubuntu I Have Fork Failed - Cannot Allocate Memory In Error

I still search for a decision. I tried to install other project, which has less number of installed packages(actually that is laravel / vuejs app), but I got the same error :

# composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing symfony/polyfill-ctype (v1.11.0)
    Downloading: 100%         
The following exception is caused by a lack of memory and not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details

PHP Fatal error:  Uncaught ErrorException: proc_open(): fork failed - Cannot allocate memory in /usr/share/php/Symfony/Component/Console/Application.php:943
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', '/usr/share/php/...', 943, Array)
#1 /usr/share/php/Symfony/Component/Console/Application.php(943): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 /usr/share/php/Symfony/Component/Console/Application.php(751): Symfony\Component\Console\Application->getSttyColumns()
#3 /usr/share/php/Symfony/Component/Console/Application.php(712): Symfony\Component\Console\Application->getTerminalDimensions()
#4 /usr/share/php/Symfony/Component/Console/Application.php(645): Symfony\Component\Console\Application->getTerminalWidth()
#5 /usr/share/php/Symfony/Component/Console/Application.php(127): Symfony\Component\Console\Application->renderException(Object(ErrorException), Object(Symfony\Component\Console\Output\StreamOutput))
#6 /usr/share/php/Composer/Console/Application.ph in /usr/share/php/Symfony/Component/Console/Application.php on line 943

Fatal error: Uncaught ErrorException: proc_open(): fork failed - Cannot allocate memory in /usr/share/php/Symfony/Component/Console/Application.php:943
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', '/usr/share/php/...', 943, Array)
#1 /usr/share/php/Symfony/Component/Console/Application.php(943): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 /usr/share/php/Symfony/Component/Console/Application.php(751): Symfony\Component\Console\Application->getSttyColumns()
#3 /usr/share/php/Symfony/Component/Console/Application.php(712): Symfony\Component\Console\Application->getTerminalDimensions()
#4 /usr/share/php/Symfony/Component/Console/Application.php(645): Symfony\Component\Console\Application->getTerminalWidth()
#5 /usr/share/php/Symfony/Component/Console/Application.php(127): Symfony\Component\Console\Application->renderException(Object(ErrorException), Object(Symfony\Component\Console\Output\StreamOutput))
#6 /usr/share/php/Composer/Console/Application.ph in /usr/share/php/Symfony/Component/Console/Application.php on line 943

composer.json of this project:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "fzaninotto/faker": "^1.8",
        "intervention/image": "^2.4",
        "laracasts/utilities": "^3.0",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0",
        "orangehill/iseed": "^2.6",
        "pusher/pusher-php-server": "^3.4",
        "tymon/jwt-auth": "^1.0.0",
        "wboyz/laravel-enum": "^0.2.1",
        "zizaco/entrust": "^1.9"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "beyondcode/laravel-query-detector": "^1.0",
        "filp/whoops": "^2.0",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0",
        "xethron/migrations-generator": "^2.0"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

Also strange thing that I have installed both applications in ubuntu 18 under Digital Ocean with the same memory quantity. on AWS Ubuntu 16:

# lsb_release -d; uname -r; uname -i
Description:    Ubuntu 16.04.6 LTS
4.4.0-1084-aws
x86_64

# free
              total        used        free      shared  buff/cache   available
Mem:        1014384       48724      856564         700      109096      824368
Swap:       1048572      264404      784168

on Digital Ocean Ubuntu 18 (both apps works ok):

# lsb_release -d; uname -r; uname -i
Description:    Ubuntu 18.04.1 LTS
4.15.0-47-generic
x86_64
# free
              total        used        free      shared  buff/cache   available
Mem:        1009156      324640      109012       52520      575504      473160
Swap:       1048572      357888      690684

Can the reason of error on AWS Ubuntu 16 that something is not configured properly? Though I installed and configured both servers, maybe I missed something on AWS Ubuntu 16 ?

20 Jun
3 months ago

PetroGromovo started a new conversation How To Install Postgresql And Phppgadmin With Nginx?

Hello,

I need to install postgresql and phppgadmin with nginx installed under ubuntu 16(AWS) I installed packages :

$ sudo apt-get -y install postgresql postgresql-contrib phppgadmin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
phppgadmin is already the newest version (5.1+ds-1ubuntu1).
postgresql is already the newest version (9.5+173ubuntu0.2).
postgresql-contrib is already the newest version (9.5+173ubuntu0.2).
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.

in phpinfo I see drivers installed http://ec2-18-224-82-207.us-east-2.compute.amazonaws.com/info.php

PostgreSQL driver for PDO   Edin Kadribasic, Ilia Alshanetsky
PostgreSQL  Jouni Ahto, Zeev Suraski, Yasuo Ohgaki, Chris Kings-Lynne

But running phppgadmin in url like : http://ec2-18-224-82-207.us-east-2.compute.amazonaws.com/phppgadmin I got error :

404 Not Found
nginx/1.10.3 (Ubuntu)

Searching for decision I found that /etc/nginx/sites-available/phppgadmin directory, but :

$ cd /etc/nginx/sites-available
[email protected]:/etc/nginx/sites-available$ ls -la
total 16
drwxr-xr-x 2 root root 4096 Jun 18 05:15 .
drwxr-xr-x 6 root root 4096 Jun 12 15:46 ..
-rw-r--r-- 1 root root 2327 Jun 17 12:02 default
-rw-r--r-- 1 root root 2074 Jun 12 15:49 default.bak

Which steps I have to take to run phppgadmin and laravel 5 app ?

Thanks!

15 Jun
3 months ago

PetroGromovo left a reply on Why Installing Laravel 5.7 On Ubuntu I Have Fork Failed - Cannot Allocate Memory In Error

Do you mean that it depends on (count of) my installed packeges?

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


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

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

any of them could demand too much of memory?

and additively package.json :
{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.18",
        "bootstrap": "^4.1.0",
        "cross-env": "^5.1",
        "laravel-mix": "^2.1.14",
        "lodash": "^4.17.11",
        "popper.js": "^1.14.6",
        "vue": "^2.5.7"
    },
    "dependencies": {
        "bootstrap-colorpicker": "^3.0.3",
        "datatables.net-bs": "^1.10.19",
        "font-awesome": "^4.7.0",
        "jquery": "^3.3.1",
        "jquery-confirm": "^3.3.2",
        "laravel-echo": "^1.5.2",
        "mustache": "^2.3.0",
        "puppeteer": "^1.14.0",
        "pusher-js": "^4.3.1"
    }
}

PetroGromovo started a new conversation Why Installing Laravel 5.7 On Ubuntu I Have Fork Failed - Cannot Allocate Memory In Error

Hello, Installing Laravel 5.7 app with LEMP on ubunutu 16 under AWS I got allocate memory error :

$ composer install
Cannot create cache directory /home/ubuntu/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/ubuntu/.composer/cache/files/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Updating dependencies (including require-dev)

PHP Fatal error:  Uncaught ErrorException: proc_open(): fork failed - Cannot allocate memory in /usr/share/php/Symfony/Component/Console/Application.php:943
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', '/usr/share/php/...', 943, Array)
#1 /usr/share/php/Symfony/Component/Console/Application.php(943): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 /usr/share/php/Symfony/Component/Console/Application.php(751): Symfony\Component\Console\Application->getSttyColumns()
#3 /usr/share/php/Symfony/Component/Console/Application.php(712): Symfony\Component\Console\Application->getTerminalDimensions()
#4 /usr/share/php/Symfony/Component/Console/Application.php(645): Symfony\Component\Console\Application->getTerminalWidth()
#5 /usr/share/php/Symfony/Component/Console/Application.php(127): Symfony\Component\Console\Application->renderException(Object(RuntimeException), Object(Symfony\Component\Console\Output\StreamOutput))
#6 /usr/share/php/Composer/Console/Application. in /usr/share/php/Symfony/Component/Console/Application.php on line 943

Fatal error: Uncaught ErrorException: proc_open(): fork failed - Cannot allocate memory in /usr/share/php/Symfony/Component/Console/Application.php:943
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', '/usr/share/php/...', 943, Array)
#1 /usr/share/php/Symfony/Component/Console/Application.php(943): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 /usr/share/php/Symfony/Component/Console/Application.php(751): Symfony\Component\Console\Application->getSttyColumns()
#3 /usr/share/php/Symfony/Component/Console/Application.php(712): Symfony\Component\Console\Application->getTerminalDimensions()
#4 /usr/share/php/Symfony/Component/Console/Application.php(645): Symfony\Component\Console\Application->getTerminalWidth()
#5 /usr/share/php/Symfony/Component/Console/Application.php(127): Symfony\Component\Console\Application->renderException(Object(RuntimeException), Object(Symfony\Component\Console\Output\StreamOutput))
#6 /usr/share/php/Composer/Console/Application. in /usr/share/php/Symfony/Component/Console/Application.php on line 943

I suppose that is memory lack error

phpinfo shows me :
memory_limit    2056M   2056M

I checked parameters both in /etc/php/7.2/fpm/php.ini and files /etc/php/7.2/cli/php.ini files:

memory_limit = 2056M
max_execution_time = 3300 
max_input_time = 240 

upload_max_filesize = 200M 
post_max_size = 200M
output_buffering = on 
short_open_tag = On  



$ uname -a
Linux serge 4.15.0-51-generic #55-Ubuntu SMP Wed May 15 14:27:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux


$ free
              total        used        free      shared  buff/cache   available
Mem:        1014384      224744      454504       13848      335136      611300
Swap:       1048572           0     1048572

$ whoami
ubuntu

I think this memory must be enough for my app, but why error ? Which parameters have I to pay attention at ?

Thanks!

13 Jun
3 months ago

PetroGromovo left a reply on Can You Advice Some Bootstrap / Vuejs Templates?

Thank you, very interesting! I found https://www.creative-tim.com/product/now-ui-dashboard very interesting, but

  1. I want to clarify where can I check that is bootstrao 4/vuejs template?
  2. I see "Upgrade to PRO" buttom. I have to pay $49 for full version?

PetroGromovo left a reply on Can You Advice Some Bootstrap / Vuejs Templates?

Thank you for provided link, but I need more practice in bootstrap, especially with bootstrap/vuejs templates. Sure I searched and found some, but they do not like very good at my glance...

12 Jun
3 months ago

PetroGromovo started a new conversation Can You Advice Some Bootstrap / Vuejs Templates?

Hello, I am a php/laravel developer and I have some expierence with Bootstrap and vuejs. I want more of practice with bootstrap 4.3/ vuejs 2.5 templates. Can you advice some? Free preferable.

Thanks!

04 Jun
3 months ago

PetroGromovo left a reply on When Page Is Opened Image In Vue-carousel Is Not Visible. Need To Click.

Searching for a decision I found vue-focus directive. I installed it to my app and checking it on simple text input I see that it works ok. I tried to use it in carousel component as :

                    <carousel
                            v-show="hostelImages.length"
                            :centerMode="false"
                            :perPage="1"
                            :navigationEnabled="true"
                            paginationColor="#7e7e7e"
                            paginationPosition="bottom"
                            class="m-4"
                            zIndex= "100 !important"
                    >
                        <slide v-for="nextHostelImage, index in hostelImages" :key="nextHostelImage.id">
                            <img
                                    :src="nextHostelImage.filenameData.image_url"
                                    :alt="nextHostelImage.filename"
                                    style="width:320px; height : auto; "
                                    v-focus.lazy="true"
                            >
                            <p class="description-text pl-5 pr-5">
                                {{ nextHostelImage.info }}
                            </p>
                        </slide>
                    </carousel>

OR

                    <carousel
                            v-show="hostelImages.length"
                            :centerMode="false"
                            :perPage="1"
                            :navigationEnabled="true"
                            paginationColor="#7e7e7e"
                            paginationPosition="bottom"
                            class="m-4"
                            zIndex= "100 !important"
                            v-focus.lazy="true"
                    >
                        <slide v-for="nextHostelImage, index in hostelImages" :key="nextHostelImage.id">
                            <img
                                    :src="nextHostelImage.filenameData.image_url"
                                    :alt="nextHostelImage.filename"
                                    style="width:320px; height : auto; "
                            >
                            <p class="description-text pl-5 pr-5">
                                {{ nextHostelImage.info }}
                            </p>
                        </slide>
                    </carousel>

But in both cases I do not see images on page opened.

  1. If there is a way to simulate click of a mouse on carousel's image?

  2. Testing in browser I noticed that when I change device in browse I see that my carousel's image becomes visible. Can that be decision for my problem ?

03 Jun
3 months ago

PetroGromovo started a new conversation When Page Is Opened Image In Vue-carousel Is Not Visible. Need To Click.

Hello, Working with Laravel 5.7 / Vuejs 2.6 / Bootstrap 4.3 app I use "vue-carousel": "^0.18.0" I have a problem that defing carousel with images at page opening the page is not visible at all. But if to click on the empty image space then image is visible and carousel works ok. in vue file :

                <div class="col-sm-12">

                    <div class="pull-left" style="max-width: 350px;">
                        <carousel
                                v-show="hostelImages.length"
                                :centerMode="false"
                                :perPage="1"
                                :navigationEnabled="true"
                                paginationColor="#7e7e7e"
                                paginationPosition="bottom"
                                class="m-4"
                                zIndex= "100 !important"
                        >
                            <slide v-for="nextHostelImage, index in hostelImages" :key="nextHostelImage.id">
                                <img :src="nextHostelImage.filenameData.image_url" :alt="nextHostelImage.filename" style="width:320px; height : auto; ">
                                <p class="description-text pl-5 pr-5">
                                    {{ nextHostelImage.info }}
                                </p>
                            </slide>
                        </carousel>

                        <a class="a_link" href="/images/emptyImg.png" v-show="!hostelImages.length">
                            <!--{{  "?dt=".time()  }}-->
                            <img class="single_vote_image_left_aligned" src="/images/emptyImg.png" alt="alt text">
                        </a>
                    </div>


                    <p class="card-text mt-3 description-text" v-html="hostelRow.descr"></p>
                    ...

<script>
    import {bus} from '../../../app';
    import appMixin from '../../../appMixin';
    import hostelsMixin from '../../../hostelsMixin';
    import {Carousel, Slide} from 'vue-carousel';

    export default {

        components: {
            Carousel,
            Slide
        },

...
<style scoped lang="css">

   #container {
      padding: 0 60px;
   }

   .VueCarousel-slide {
      position: relative;
      background: #42b983;
      border: 2px dotted green;
      color: #fff;
      font-size: 24px;
      text-align: center;
      min-height: 100px;
   }

   .label {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
   }

</style>

You can look at it live : http://hostels-tours.nilov-sergey-demo-apps.tk/hostel/new-hostel-test21/south-australia/far-north/adelaide-1

Why error and how to fix it ?

Thanks!

01 Jun
3 months ago

PetroGromovo started a new conversation Error With Style Definitions For Vuejs-paginate

Hello, Working with Laravel 5.7 / Vuejs 2.6 / Bootstrap 4.3 app I use "vuejs-paginate": "^2.1.0" and I have styles problems, that defining in the same vue file paginate component ans css definitions, like

        <div class="row p-0 pl-3 pr-3 m-0">
            <paginate
                    :page-count="getPagesCount"
                    :click-handler="paginationPageClicked"
                    :prev-text="'Prev'"
                    :next-text="'Next'"
                    :container-class="'className'"

                    :pageRange="3"
                    :marginPages="2"
                    :page-class="'paginate-page-item'"

                    :active-class="'paginate-active'"
                    :first-last-button="true"
                    :margin-pages="5"

            >
            </paginate>
        </div>

<style lang="css" >
    ul.className {
        list-style-type: none;
        padding: 0;
        max-height: 30px !important;
    }

    /*li {*/
    li.paginate-page-item {
        display: inline-block !important;
        margin: 0 10px !important;
        background: yellow !important;
    }

    .paginate-active {
        font-weight: bold !important;
        color: grey;
        background-color: lightgrey;
        padding: 2px 5px 2px 5px;
    }


</style>

If to uncomment line :

/*li {*/

above, my pagination looks good. But I do not like this way, as li style definition influence other pages

If to define :

    li.paginate-page-item {

then paginaion conponent is broken, you can look to it live: http://hostels-tours.nilov-sergey-demo-apps.tk/

I added yellow class to the background of the component to see definitions are applied.

Why error and how to fix it ?

Thanks!

31 May
3 months ago

PetroGromovo started a new conversation Purifier For Vuejs ?

Hello, Working with Laravel 5 / blade I use mews/purifier and in blade template I wrote :

                {!! Purifier::clean($voteItemImagePropsAttribute['file_info']) !!}

Do we need to use are there similar tools for vuejs >= 2.5 ? I searched including here https://github.com/vuejs/awesome-vue

and did not frind a solution...

Thanks!

26 May
3 months ago

PetroGromovo started a new conversation How Set Password In Envoy

Hello, With laravel 5.7 app running envoy command I can set some parameters, like

envoy run Hostels2Deploy  --lardeployer_password=mypass 

and on any block I have to enter manually password. How can I use password parameter if in my envoy file I have

@setup
    $server_login_user= 'lardeployer';
    ...
@endsetup
    ...
    @servers(['dev' => $server_login_user.'@NN.NN.NN.NN'])

Thanks!

22 May
4 months ago

PetroGromovo left a reply on How To Send Report In In Scheduled Time

My report is run by (local )url : http://local-boxbooking2.com/admin/report/available-spaces-by-zones I remade so that if to run url http://local-boxbooking2.com/admin/report/available-spaces-by-zones/send-email-on-open

in browser report is opened and checking “send-email-on-open” javascript function is triggered to sent by email (with Sendgrid service ) content of the page(report actually)

I tried to trigger command by cron tasks : In app/Console/Commands/reportAvailableSpacesByZones.php :

class reportAvailableSpacesByZones extends Command
{
    public function handle()
    {
        \Log::info( 'Report From inside app/Console/Commands/reportAvailableSpacesByZones.php run # ' . time()  );
        return redirect()->to('/admin/report/available-spaces-by-zones/send-email-on-open');
    }

I see log info , but no reports by email. Which way is correct ?

18 May
4 months ago

PetroGromovo left a reply on How Better To Filter Data Which Were Read With Curl ?

Searching I found using of temporary table in laravel, like https://stackoverflow.com/questions/42555512/how-to-create-temporary-table-in-laravel and https://laracasts.com/discuss/channels/laravel/how-to-implement-temporary-table . which are session based. I want take advantage of filters for Model, Which I will create for this temporary tanle. That looks like what I need, but is it ok for my task. I hope I explained clearly what I need. Has laravel some better tools for it? Who worked with it?

16 May
4 months ago

PetroGromovo started a new conversation How Better To Filter Data Which Were Read With Curl ?

Hello, In my new Laravel 5.8 app I read data from external source using curl which has some filters. I need more filters applied and to save filtered rows in db. My question is how better to filter data which were read with curl.

First idea to save all data in temp table with session_unique_id field as system is multiuser and apply filters on these data. The thing is that there more 10 filters in the system and using scopes I can controle filteres like:

    public function scopeGetByVote($query, $vote_id= null)
    {
        if (!empty($vote_id)) {
            if ( is_array($vote_id) ) {
                $query->whereIn( with(new VoteItem)->getTable().'.vote_id', $vote_id );
            } else {
                $query->where( with(new VoteItem)->getTable() . '.vote_id', $vote_id );
            }
        }
        return $query;
    }

as some filters can be selected, but some not.

Has Laravel 5.8 some better tools for rows filtering without writing data to temp tables? Are there some better tools from point of productivity? That is multiusers system and can have quite a lot of requests...

Thanks!

13 May
4 months ago

PetroGromovo started a new conversation How To Send Report In In Scheduled Time

Hallo, In laravel 5.8 I have a report with a button “Send Email” by clicking on this button ajax request is run, with content of a report in “report_html” var to control like:

    public function sentReportEmailContent()
    {
        $request= request();
        $requestData= $request->all();

        $report_html= $requestData['report_html'];

        $loggedUser= Auth::user();

        $reportAvailableSpacesByZonesAcceptorsArray = config('app.reportAvailableSpacesByZonesAcceptorsArray', []);
        $site_name                                  = config('app.name', '');
        if ( count($reportAvailableSpacesByZonesAcceptorsArray) == 0 ) {
            return response()->json(['error_code' => 1, 'message' => 'There are no receiver emails specified !'], HTTP_RESPONSE_INTERNAL_SERVER_ERROR);
        }

        $to= $reportAvailableSpacesByZonesAcceptorsArray[0];
        $subject= 'Available Spaces By Zones report was sent at ' . $site_name;
        $additiveVars= [ 'html'=> $report_html ];

        unset($reportAvailableSpacesByZonesAcceptorsArray[0]);
        $cc= $reportAvailableSpacesByZonesAcceptorsArray;
        \Mail::to($to)->send( new SendgridMail( 'emailContainer', $to, $cc, $subject , $additiveVars ) );

        return response()->json(['error_code' => 0, 'message' => '', 'user'=> $loggedUser->id], HTTP_RESPONSE_OK);
    }

and with Sendgrid service report is sent to users defined in config ok.

Now I need to run this report and send email to recievers in scheduler.

I created a new command :

php artisan make:command reportAvailableSpacesByZones  --command=report:available-spaces-by-zones
which has handle method:
    public function handle()
    {
        \Log::info( 'Report run # ' . time()  );
    }

which is triggered in scheduled time. But how can I run my report and sent it's content like it is done manually ?

Thanks!

11 May
4 months ago

PetroGromovo started a new conversation I Have No Access To Console Of My Server

Hello, Working with laravel 5.8 I have no access to console of my server(only ftp access) and I have problems with running console commands. I know that there is Artisan::call method, which can be usefull in my case, but are some plugings/tools helfull in this case ?

Thanks!

10 May
4 months ago

PetroGromovo started a new conversation How In Laravel / Vuejs / Jwt To Make Time Of Session Much Bigger?

Hello, In my laravel 5.8 / "vue": "^2.5.17" / "vuex": "^3.1.0" / "tymon/jwt-auth": "^1.0.0" app I login into the system and current logged user is saved in localStorage with line like:

     localStorage.setItem("loggedUser", JSON.stringify(state.currentLoggedUser));

I want to make time of session much bigger, and I found option in my config/auth.php :

<?php

return [


    'defaults' => [
        'guard' => 'api',
        'passwords' => 'users',
    ],

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'jwt',
            'provider' => 'users',
            'hash' => false,
        ],
    ],

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],

    ],


    'passwords' => [
        'users' => [
            'provider' => 'users',
            'table' => 'password_resets',
            'expire' => 460, // I modified this option !
        ],
    ],

];

But as I see that does not help, and seems tine of my session expired is rather short, withing 1 hour. Are there some other config options to make time of session much bigger ?

Thanks!