mstdmstd

mstdmstd

Member Since 3 Years Ago

Experience Points
18,380
Total
Experience

1,620 experience to go until the next level!

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

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
2
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start 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 4
18,380 XP
Oct
15
5 days ago
Activity icon

Started a new Conversation How In Adminer To Increase Current Session On Login?

Hi, Using adminer-4.7.7 with plugin login-password-less.php I found a way how to enter adminer without credentials entered. But entering adminer I would like to keep the current session as far as possible(including current db and table opened), even after browse closed/opened next day... Has adminer session time parameter/tools? That is for my home laptop ( kununtu18, apache 2, php 7.4), so security breaks are ignored... apache config decisions also possible.

How can I do it ?

Thanks!

Oct
08
1 week ago
Activity icon

Started a new Conversation How With Http-tests Make Tests On Ajax Event With Form Opened?

Hello, In laravel 6 / bootstrap 4 / jquery: 3.3.1 app I make http-tests with methods in https://laravel.com/docs/6.x/http-tests I need to make test on editor open event, which is triggered when operator clicks on button :

$.ajax({
    type: "GET",
    url: '/items/'+rowId+'/edit',
    data: {},
    success: function (data) {
        $("#h3_items_title_new").css("display", "none")
        $("#h3_items_title_edit").css("display", "block")
        $("#btn_item_cancel").css("display", "inline")

        $("#subject").val(data.item.subject)

        $("#created_at").val(data.item.created_at)
        $("#created_at").prop("readonly", true)
        $("#updated_at").val(data.item.updated_at)
        $("#updated_at").prop("readonly", true)

        $("#item_view_form").css("display", "none")
        $("#item_edit_form").css("display", "block")
            ...
    }
});

and item_edit_form block must be shown and item_view_form hidden. Can I make checks inside if item_edit_form block , say inputs are filled with valid values of the item? If yes, which methods have I to use ?

Thanks!

Oct
06
2 weeks ago
Activity icon

Started a new Conversation What For Are Your Numbers In Nexmo

Hello, Following Jeffrey lesson “Laravel From Scratch: Send SMS Notifications in 5 Minutes” ( https://laracasts.com/series/laravel-6-from-scratch/episodes/48 ) I created account at nexmo and entered Test Number. That is clear what is for : in dev mode that is enough to send sms to my own phone. But next it was proposed to open and fill “Your Numbers” : https://prnt.sc/utx273 I did not catch what is it for ? How thsese phones can be used in dev and in live mode?

Thanks!

Sep
27
3 weeks ago
Activity icon

Started a new Conversation How To Create Testing Database Under Docker?

Hello, In Kubuntu 18 I create docker for laravel 6 app with mysql defined :

  mysql:
    container_name: "vanilla-crm-db"
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: "MYSQL_ROOT_PASSWORD"
      MYSQL_DATABASE: "vanilla-crm-dev"
      MYSQL_USER: "MYSQL_USER"
      MYSQL_PASSWORD: "MYSQL_PASSWORD"
    ports:
      - "3330:3306"
    volumes:
      - "./docker/mysql/data:/var/lib/mysql"

and it works for me.

Next I make http tests and I need to create new database for this and load dump of my database in it. Name of this database is writen in config/database.php under 'mysql_testing' block

  1. I enter the bash with command :
docker-compose exec mysql bash

[email protected]:/# uname -a 
Linux f216ef80c104 4.15.0-118-generic #119-Ubuntu SMP Tue Sep 8 12:30:01 UTC 2020 x86_64 GNU/Linux

Where mysql is container_name in docker-compose.yml

Usually I enter mysql console with command:

mysql -u root -h localhost -p

But which must be format of this command in the docker console? I tried several ways and failed...

  1. I use DBeaver and logged into my database and tried to create new database for testing. I got error: https://prnt.sc/uol0z7

How to fix it ? Have I to add some more right my mysql container definitions?

Thanks!

Sep
26
3 weeks ago
Activity icon

Started a new Conversation Why Users Are Not Activated With Cartalyst/sentinel Method?

With laravel 7 /"cartalyst/sentinel": "^4.0" app making seeding data for Users I want to activate users with code like:

        \DB::table('users')->insert(array (
            6 =>
            array (
                'id' => 7,
                'username' => 'JohnDoe',
                'email' => '[email protected]',
                'password' => NULL,
                'status' => 'A',
                'account_type' => 'I',
                'first_name' => 'John',
                'last_name' => 'Doe',
                'phone' => '7659879638765',
                'website' => 'http://[email protected]',
                'notes' => 'Some notes on <strong>John Doe</strong>, who lorem <i>ipsum dolor sit</i> amet, consectetur adipiscing elit, sed do eiusmod  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim  veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea  commodo consequat. Duis aute irure dolor in reprehenderit in voluptate  velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint  occaecat cupidatat non proident, sunt in culpa qui officia deserunt  mollit anim id est laborum. 
lorem <i>ipsum dolor sit</i> amet, consectetur adipiscing elit, sed do eiusmod  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim  veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea  commodo consequat. Duis aute irure dolor in reprehenderit in voluptate  velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint  occaecat cupidatat non proident, sunt in culpa qui officia deserunt  mollit anim id est laborum.',
                'activated_at' => NULL,
                'avatar' => NULL,
                'created_at' => '2019-04-29 11:03:50',
                'updated_at' => NULL,
            ),

        ...
        
        $user = Sentinel::findById(7);
        $customerRole->users()->attach($user);
        if (Activation::complete($user, generateRandomString(32))) {
            echo 'Activation::complete SUCCESS # 7::</br>';
        } else {
            echo 'Activation::complete ERROR # 7::</br>';
        }


    function generateRandomString($length = 10) {
        $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $charactersLength = strlen($characters);
        $randomString = '';
        for ($i = 0; $i < $length; $i++) {
            $randomString .= $characters[rand(0, $charactersLength - 1)];
        }
        echo '<pre>==$randomString::'.print_r($randomString,true).'</pre>';
        return $randomString;
    }

As result I see error messages and new users are not activated. What can be reason? Has Sentinel some debugging mode to show errors ?

Thanks!

Sep
25
3 weeks ago
Activity icon

Replied to I Got Composer Install Error Under Php 7.4

  1. What could you advice to fix it ? 2) Are there some replacement of mews/purifier ?
Activity icon

Replied to I Got Composer Install Error Under Php 7.4

I modified line :

      "mews/purifier": "~4.0",

and again got error :

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)

In ComposerRepository.php line 637:
                                                                                                                                                                   
  Could not load package mews/purifier in http://packagist.org: [UnexpectedValueException] Could not parse version constraint ~4.*: Invalid version string "~4.*"  
                                                                                                                                                                   

In VersionParser.php line 485:
                                                                          
  Could not parse version constraint ~4.*: Invalid version string "~4.*"

?

Activity icon

Started a new Conversation I Got Composer Install Error Under Php 7.4

Hello, I try to run laravel 7 under php 7.4 (I worked under php 7.3 before) and I got error:

$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)

In ComposerRepository.php line 637:
                                                                                                                                                                   
  Could not load package mews/purifier in http://packagist.org: [UnexpectedValueException] Could not parse version constraint ~4.*: Invalid version string "~4.*"  
                                                                                                                                                                   

In VersionParser.php line 485:
                                                                          
  Could not parse version constraint ~4.*: Invalid version string "~4.*"  

In composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2.5",
        "cartalyst/sentinel": "^4.0",
        "cviebrock/eloquent-sluggable": "^7.0",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^1.0",
        "guzzlehttp/guzzle": "^6.3",
        "illuminate/database": "^7.27",
        "illuminate/events": "^7.27",
        "intervention/image": "dev-master",
        "laravel/framework": "^7.0",
        "laravel/tinker": "^2.0",
        "livewire/livewire": "^1.3",
        "mews/purifier": "^3.2",
        "prettus/l5-repository": "^2.6",
        "realrashid/sweet-alert": "^3.1",
        "spatie/laravel-image-optimizer": "^1.6",
        "spatie/laravel-medialibrary": "^7.19",
        "symfony/http-foundation": "^5.1",
        "wboyz/laravel-enum": "^0.2.1"
    },
    "require-dev": {
        "facade/ignition": "^2.0",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^4.1"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "files": [
            "app/library/helper.php"
        ],

        "psr-4": {
            "App\": "app/",
            "Modules\": "Modules/"
        },
        "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 I removed composer.lock and run again composer update with same results

Is syntax of this file wrong? What have I to change in it?

Thanks!

Sep
21
4 weeks ago
Activity icon

Replied to How Submitting Of Data With Ajax-requests Show Server Validation Errors ?

I have worked with this package. It is good when I store/update data with POST/PUT requests and data are validated on client but if validation is ok data are saved with page reloading and I want to escape it.

I store my data from JS code :

        function taskstore() {
            $.ajax({
                url: 'tasks',
                type: "post",
                dataType: 'json',
                data: {'_token': '{{csrf_token()}}'},
                success: function (data) {
                   ...
                },
                error: function (xhr) {
                    console.error(xhr)
                }
            });

        }

I do not see how this plugin can be useful in my case... Or have it some additive options?

Activity icon

Replied to How Submitting Of Data With Ajax-requests Show Server Validation Errors ?

Searching for decision I found this https://w3path.com/laravel-6-jquery-form-validation-example-tutorial/ manual. It seems good but with it I have to write similar rules both on client and server. That seems better but a bit tediously. Are there some ways to use only server validation ?

Sep
20
1 month ago
Activity icon

Replied to How Submitting Of Data With Ajax-requests Show Server Validation Errors ?

I use jQuery. Could you please give link to some decisions?

Activity icon

Started a new Conversation How Submitting Of Data With Ajax-requests Show Server Validation Errors ?

Hello , In laravel 6 app bootstrap 4 I for data validation and errors display I use code like

                    <div class="form-group required {{ $errors->has('subject') ? 'has-error' : '' }}">
                        {!! Form::label('subject', 'subject', ['class' => 'control-label required']) !!}
                        <div class="controls">
                            {!! Form::text('subject', null, ['class' => 'form-control']) !!}
                            <span class="help-block">{{ $errors->first('subject', ':message') }}</span>
                        </div>
                    </div>

Now I need to make submit of data with ajax-requests and I need to show (server) validation errors on client part. To make it manually seems very tediously... Are there some libs/scripts helping with it?

Thanks!

Sep
09
1 month ago
Activity icon

Replied to How To Share(video) My Screen With Skype ?

I can not find this plus button . Where is is?

Activity icon

Started a new Conversation How To Share(video) My Screen With Skype ?

Hello, Seems in skype(8.62.0.85) of Kubuntu 18.04 it is possible to share( I mean not printscreen image, but like online video) my screen with members of some group?

But I did not find such functionality of options for this? https://prnt.sc/ue2ynf

Is it there?

Sep
03
1 month ago
Activity icon

Started a new Conversation I Search Docs On Laravel Repositories

Hello, I need to use Repositories in my laravel 6 app, as I need to make abstract layer for data access Looking here https://laravel.com/docs/6.x/ I did not find any relative page. Seacrhing by “Repositories” I got many pages on laravel installation. Has it Repositories docs page ?

Also can you advice some useful extentions, step by steps manuals?

Thanks!

Sep
01
1 month ago
Activity icon

Replied to Adding Imagick To My Docker LAMP I Got Error :You Should Add “extension=imagick.so” To Php.ini

I added the line in /Dockerfile.yml :

  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 mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

    RUN echo "extension=imagick.so" >> "$PHP_INI_DIR/php.ini" \

    ADD https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions /usr/local/bin/

    RUN chmod uga+x /usr/local/bin/install-php-extensions && sync && \
    install-php-extensions imagick
  
    
COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf

and still got error :

Build process completed successfully 
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20180731/imagick.so' 
Installing '/usr/local/include/php/ext/imagick/php_imagick_shared.h' 
install ok: channel://pecl.php.net/imagick-3.4.4 
configuration option "php_ini" is not set to php.ini location 
You should add "extension=imagick.so" to php.ini 
/bin/sh: 1: imagick: not found 
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update &&     apt-get install -y     python     libfreetype6-dev     libwebp-dev     libjpeg62-turbo-dev     libpng-dev     lib
zip-dev     nano     mc     git-core  

Also I have virtualhost.conf included, with content :

<VirtualHost *:80>

  DocumentRoot /var/www/vanilla_crm_docker_root/public
  <Directory /var/www/vanilla_crm_docker_root/public>
    Order allow,deny
    Allow from all

    Options -MultiViews

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ / [L,R=301]


	php_value  memory_limit  2048M
	php_value  file_uploads  On
	php_value  upload_max_filesize  200M
	php_value  post_max_size  200M
	php_value  max_execution_time  1000
	php_value  short_open_tag  On


    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
  </Directory>

  ErrorLog /var/log/apache2/error.log

  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  LogLevel warn

</VirtualHost>
  1. can it be that this file overwrites “extension=imagick.so” option we prepare in our command?
  2. Can I add extension=imagick.so option in this file ?
Aug
31
1 month ago
Activity icon

Replied to Adding Imagick To My Docker LAMP I Got Error :You Should Add “extension=imagick.so” To Php.ini

I modified docker file:

  ...

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

  # ADDED THIS LINE

    RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

    ADD https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions /usr/local/bin/

    RUN chmod uga+x /usr/local/bin/install-php-extensions && sync && \
    install-php-extensions imagick
  
    
COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf

but got error :

Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20180731/imagick.so'
Installing '/usr/local/include/php/ext/imagick/php_imagick_shared.h'
install ok: channel://pecl.php.net/imagick-3.4.4
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
/bin/sh: 1: imagick: not found
ERROR: Service 'web' failed to build:
Activity icon

Replied to Adding Imagick To My Docker LAMP I Got Error :You Should Add “extension=imagick.so” To Php.ini

I am not sure which must be modifications. I modified my Dockerfile.yml as :

FROM php:7.3-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 \

   # I LEFT THESE 3 LINES
   libmagickwand-dev --no-install-recommends && \
   pecl install imagick && imagick && \
   docker-php-ext-enable imagick && \

    curl \
    build-essential \
    openssl \
    libssl-dev \
    libgmp-dev \
    libldap2-dev \
    netcat \
    locate \
    # composer \
    && git clone https://github.com/nodejs/node.git \
    && cd node \
    && git checkout v12.0.0 \
    && ./configure \
     && make \
     && make install

  RUN npm install cross-env

  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

  # THESE 2 LINES ADDES

    ADD https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions /usr/local/bin/

    RUN chmod uga+x /usr/local/bin/install-php-extensions && sync && \
    install-php-extensions imagick
    
COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf

But I got error anyway :

Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20180731/imagick.so'
Installing '/usr/local/include/php/ext/imagick/php_imagick_shared.h'
install ok: channel://pecl.php.net/imagick-3.4.4
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
/bin/sh: 1: imagick: not found
ERROR: Service 'web' failed to build: 

?

Activity icon

Started a new Conversation Adding Imagick To My Docker LAMP I Got Error :You Should Add “extension=imagick.so” To Php.ini

Hello, Adding imagick to my docker LAMP installation I got error

Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20180731/imagick.so'
Installing '/usr/local/include/php/ext/imagick/php_imagick_shared.h'
install ok: channel://pecl.php.net/imagick-3.4.4
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
/bin/sh: 1: imagick: not found
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update &&     apt-get install -y     python     libfreetype6-dev     libwebp-dev     libjpeg62-turbo-dev     libpng-dev     libzip-dev     nano     mc     git-core     libmagickwand-dev --no-install-recommends &&     pecl install imagick && imagick &&     docker-php-ext-enable imagick &&     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' returned a non-zero code: 127

In Dockerfile.yml I added lines for imagick :

FROM php:7.3-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 \

    # I added these lines
    libmagickwand-dev --no-install-recommends && \
    pecl install imagick && imagick && \
    docker-php-ext-enable imagick && \

    curl \
    build-essential \
    openssl \
    libssl-dev \
    libgmp-dev \
    libldap2-dev \
    netcat \
    locate \
    # composer \
    && git clone https://github.com/nodejs/node.git \
    && cd node \
    && git checkout v12.0.0 \
    && ./configure \
     && make \
     && make install

  RUN npm install cross-env

  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

  # I added this line
  RUN install-php-extensions imagick

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

Which options did I miss ?

Aug
29
1 month ago
Activity icon

Replied to How To Redirect From Livewire Component Is Data Empty ?

If to make return redirect('/'); in render method of the component I got error

"render" method on [App\Http\Livewire\PageContent] must return instance of [Illuminate\View\View] (View: /var/www/hostels3_docker_root/vendor/livewire/livewire/src/Macros/livewire-view.blade.php)

In mount method

return redirect('/');

is just ignored, I check it by logging messages.

Activity icon

Started a new Conversation How To Redirect From Livewire Component Is Data Empty ?

Hello, In laravel 7 /livewire 1.3 / project I have a component which opened page by given slug. I want if data by slug was not found to redirect to home. In my component I have :

<?php

namespace App\Http\Livewire;

use Livewire\Component;
use App\Page;

class PageContent extends Component
{

    public $slug;
    public $page;

    public function render()
    {
        $this->page = Page::getBySlug(strtolower($this->slug))
            ->leftJoin('users', 'users.id', '=', 'pages.creator_id')
            ->select(
                'pages.*',
                'users.username as creator_username'
            )
            ->first();
        \Log::info('-1 $this->page ::' . print_r($this->page, true));
        if (empty($this->page)) {
            \Log::info('-1 EMPTY ::');
        // I SEE MEGGAGE ABOVE IN LOG - means $this->page is empty
            redirect('/');
            // BIT NO REDIRECTION ABOVE
        }

        return view('livewire.page-content');
    }

    public function mount($slug)
    {
        $this->slug = $slug;
        \Log::info('-1 $this->slug ::' . print_r($this->slug, true));
        // I SEE MEGGAGE ABOVE IN LOG
    }

}

and I got runtime error as trying to read method of null $page var in template...

In routes/web.php I have :

Route::livewire('/', 'home')->name('home');

How can I make redirection ?

Thanks!

Aug
27
1 month ago
Activity icon

Replied to In Listing Of Data Form Is Rendered When Any Input Edited?

I still search for a decision. How it can be implemented ? Who have similar issue : please share your expiernce.

Aug
25
1 month ago
Activity icon

Replied to How To Use Docker-ce Nder Umy Ubuntu / Digital Ocean ?

Searching in net I found this https://github.com/nginx-proxy/nginx-proxy extention, but my docker apps are based on apache. Are there something like that, but for apache?

Activity icon

Replied to How In AlpineJS To Shadow Content Beyond Bootstrap Modal Dialog?

I tried and it did not not help as div with class "modal_editor_container" does not cover all page. I mean to shadow content beyond modal_editor_container

Activity icon

Started a new Conversation How In AlpineJS To Shadow Content Beyond Bootstrap Modal Dialog?

Hello, In Bootstrap 4.5/jquery 3.3 / alpinejs 2.2 app I show image with size restrictions and to show image in full size clicking on the image I open modal dialog with aplineJS method x-on:click="show_hostel_image_modal = true" and it is opened ok, but I dislike that all content behind the dialog box is visible. If there is a way to shadow it, without calling bootstrap js methods, as I move from jquery methods to alpinejs?

I have :

@if(!empty($currentHostelImage))
    <div
        x-data="{ show_hostel_image_modal: false, hostelImages: <?php print prepareEncodeArray($hostelImages) ?>,  current_image_id:
{{$currentHostelImage->id }}, currentImage : {{$currentHostelImage }} } "
        class="hostel_images_block_wrapper">
        
        
        <div
            class="modal_editor_container p-2"
            x-show="show_hostel_image_modal"
            @click.away="show_hostel_image_modal = false"
        >
            <div
                class="modal_editor_title"
            >
                <h4 class="modal-title p-2">
                    {!! $viewFuncs->showAppIcon('image') !!}Image view : <span x-html="currentImage.filenameData.image"></span>
                    <button class="close" type="button" x-on:click="show_hostel_image_modal= false">
                        <i class="test-device p-2 pl-4 pr-4 m-0"></i>
                        <span aria-hidden="true">&times;</span>
                    </button>
                </h4>
            </div> <!-- modal_editor_title -->
            
            <div class="modal_editor_fields" :style="'max-height: ' + ( modalHeight() - 20 ) +'px; '">
                <div x-show="typeof currentImage.filenameData != 'undefined'">
                    <img :src="currentImage.filenameData.image_url" class="hostel_dialog_image m-1 p-1"
                    
                         :class="{ 'hostel_image' : true }"
                    >
                    
                    <div class="alert alert-info" role="alert">
                        {!! $viewFuncs->showAppIcon('info') !!}
                        <span x-html="currentImage.filenameData.file_info"></span>
                    </div>
                
                </div> <!-- <div> -->
            </div>  <!-- modal_editor_fields-->
            
            
            <div class="modal_editor_footer row_content_right_aligned">
                <button x-on:click="show_hostel_image_modal= false" class="btn btn-secondary btn-sm action_link" type="button">
                    {!! $viewFuncs->showAppIcon('cancel', 'white') !!} Cancel
                </button>
            </div>  <!-- modal_editor_footer -->
        
        </div> <!-- <div class="modal_editor_container"> -->
        
        
        <template x-for="nextHostelImage in hostelImages">
            <div class="hostel_view_current_image_wrapper" x-show="current_image_id === nextHostelImage.id ">
                <img :src="nextHostelImage.filenameData.image_url" class="hostel_view_current_image"
                     :alt="nextHostelImage.filenameData.file_info" x-on:click="show_hostel_image_modal = true" data-toggle="tooltip"
                     data-placement="top" title="Click to view in full size">
            </div>
        </template>
    
    
    </div>
@endif

and in styles :

.modal_editor_container {
  width: 90%;// !important;
  top: 20px;
  left: 50px;
  position: absolute;
  z-index: 900;
  flex: 1;
  flex-direction: column;
  justify-items: flex-start;
  padding: 0;
  margin: 0;// !important;
}

Thanks!

Aug
23
1 month ago
Activity icon

Started a new Conversation How To Use Docker-ce Nder Umy Ubuntu / Digital Ocean ?

Hi all, Using docker-ce for lamp apps I got url like http://127.0.0.1:8084/ and it works under my local ubuntu 18. I need to install docker-ce under my ubuntu 16 on Digital Ocean with hosting which I created in https://my.freenom.com

Are there some addons/instructions how can I do it ?

Thanks!

Aug
22
1 month ago
Activity icon

Replied to About "How To Build Modular Applications In Laravel" Articles

Authors answer was somewhat strange for me:

@DestinyAjax This was part 1 actually. But I will make time to write a part 3 of the article, as there's much to still write about.

Are there similar articles on modules with step by step explanations?

Activity icon

Started a new Conversation About "How To Build Modular Applications In Laravel" Articles

Hello , I read "How To Build Modular Applications in Laravel: The Plug N Play Approach — Part 2" at https://medium.com/@destinyajax/how-to-build-modular-applications-in-laravel-the-plug-n-play-approach-part-2-c23e8089aeee and Part 3 was promissed there, but I did not find it there. Has this article Part 3? Please give link? Maybe similar articles on modules with step by step explanations?

Thanks

Aug
21
1 month ago
Activity icon

Replied to In Listing Of Data Form Is Rendered When Any Input Edited?

As I use alpinejs2 I try to use it in this case:

<div class="card form-admin-facilities" x-data="adminFacilitiesComponent()">
...

    filter_name: {{$filter_name}}<br>
...
    temp_filter_name: <span x-html="temp_filter_name"></span><br>
...

                <fieldset class="bordered text-muted p-2 m-2">
                    <legend class="bordered">Filters</legend>
                    <div class="content_with_right_button" wire:model.lazy="filter_name">
                        <div class="content_with_right_button_left_content" >
                            <input
                                class="form-control admin_filter_input"
                                x-model="temp_filter_name"
                                
                                type="text"
                            >
                        </div>
                        <div class="content_with_right_button_right_button pl-2" >
                            <button class="btn btn-outline-secondary" @click="$dispatch('input', temp_filter_name)"  type="button">Search
                            </button>
                            <!-- In more complicated form can be several filter fields : text and select inputs -->
                        </div>
                    </div>
                
                </fieldset> <!-- Filters -->


...
<script>
    function adminFacilitiesComponent() {
        return {
            temp_filter_name:'',

and in the component I defined public $filter_name var, which is used in render method :

class Facilities extends Component
{
    public $form= [
        'name'=>'',
        'descr'=> '',
        'created_at'=> '',
        'is_reopen'       => false,
    ];

    public $current_facility_id;
    public $filter_name= '';
    public $updateMode = 'browse';

    public function render()
    {
        \Log::info( '-1 render Facilities $this->filter_name ::' . print_r(  $this->filter_name, true  ) );
        $this->facility_rows_count = Facility
            ::getByName($this->filter_name, true)
            ->count();
        $backend_per_page = Settings::getValue('backend_per_page', CheckValueType::cvtInteger, 20);

        return view('livewire.admin.facilities.container', [
            'facilityDataRows' => Facility
                ::orderBy('created_at', 'desc')
                ->getByName($this->filter_name, true)
                ->paginate($backend_per_page),
            'facility_rows_count'=> $this->facility_rows_count
        ]);
    }

But it does not work as I expect : entering value in text input when this input lose focus form is rendered again. I expected form to be rendered only when I click on “Search” button and form will be rendered with new entered value. I do not use blur event for text input and do not understand why the form is rendered when this input lose focus? Which way is valid ?

Aug
20
2 months ago
Activity icon

Replied to In Listing Of Data Form Is Rendered When Any Input Edited?

You wrote

Understand that render() will always run if the search field is changed and the field loses focus It is how it works now?

Can you propose any decision ?

Activity icon

Replied to In Listing Of Data Form Is Rendered When Any Input Edited?

No Ideas? maybe current rendering is valid and I have to implement it in some other way ?

Aug
18
2 months ago
Activity icon

Replied to In Listing Of Data Form Is Rendered When Any Input Edited?

I try to make in this way, but result was different I expected: entering values in input with lazy option, when this input lose focus I see spinner visible and message in log file, which is logged in render method of the component.

In app/Http/Livewire/Admin/Facilities.php :

<?php

namespace App\Http\Livewire\Admin;

use App\library\CheckValueType;
use App\Settings;
use DB;
use Livewire\Component;
use App\Facility;
use Livewire\WithPagination;


class Facilities extends Component
{
    use WithPagination;

    public $form= [
        'name'=>'',
        'descr'=> '',
        'created_at'=> '',
        'is_reopen'       => false,
    ];

    public $current_facility_id;
    public $filter_name;       // VALUE TO IT IS ASSIGNED IN SEARCH BUTTON CLICK
    public $temp_filter_name;  // THIS PROPERTY IN THE FORM

    public function render()
    {
        // I SEE THIS MESSAGE  IN LOG FILE WHEN INPUT LOSE FOCUS
        \Log::info( '-1 render Facilities $this->filter_name ::' . print_r(  $this->filter_name, true  ) );
        $this->facility_rows_count = Facility
            ::getByName($this->filter_name, true)
            ->count();
        $backend_per_page = Settings::getValue('backend_per_page', CheckValueType::cvtInteger, 20);

        $this->emit('facility_opened', [ 'mode'=>'browse', 'id'=>null ] );

        return view('livewire.admin.facilities.container', [
            'facilityDataRows' => Facility
                ::orderBy('created_at', 'desc')
                ->getByName($this->filter_name, true)
                ->paginate($backend_per_page),
            'facility_rows_count'=> $this->facility_rows_count
        ]);
    }


    public function makeSearch()
    {
        // I SEE THIS MESSAGE  ONLY WHEN I CLICK ON SEARCH BUTTON
        \Log::info( '-1 makeSearch $this->temp_filter_name::' . print_r(  $this->temp_filter_name, true  ) );
        $this->filter_name= $this->temp_filter_name;
    }

and in template :

<article class="admin_page_container">

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


<div class="card form-admin-facilities" x-data="adminFacilitiesComponent()">
    
    <div class="card-body card-block">
        
        
        <h3 class="card-header">
            
            <!--  I SEE THIS SPINNER WHEN INPUT LOSE FOCUS  -->
            <span class="spinner-border" role="status" wire:loading>
                <span class="sr-only">Loading...</span>
            </span>
            {!! $viewFuncs->showAppIcon('facility') !!}
            &nbsp;{{ $facility_rows_count }}
            {{ Str::plural('Item', $facility_rows_count) }}
        </h3>
        
        <div class="content_with_right_button">
            <div class="content_with_right_button_left_content">
                <h4 class="card-subtitle ml-3 mr-3">
                    {!! $viewFuncs->showAppIcon('info') !!}
                    Your can create/edit/delete facilities
                </h4>
            </div>
            <div class="content_with_right_button_right_button m-0 m-0">
                <button type="button" wire:click="add()" class="btn btn-xs btn-success action_link">Add</button>
            </div>
        </div>
        
        <fieldset class="bordered text-muted p-2 m-2">
            <legend class="bordered">Filters</legend>
            <div class="content_with_right_button">

                <div class="content_with_right_button_left_content">
                    <!-- FILTER INPUT -->
                    <input class="form-control admin_filter_input" type="text" wire:model.lazy="temp_filter_name">
                </div>

                <div class="content_with_right_button_right_button pl-2">
                    <!-- SEARCH BUTTON -->
                    <button class="btn btn-outline-secondary nowrap_block" wire:click="makeSearch" type="button">
                        {!! $viewFuncs->showAppIcon('filter') !!}Search
                    </button>
                </div>
            </div>
        
        </fieldset> <!-- Filters -->

Also I have sql trace set and I see sql traces lines only when I click on "Search" button. Is it correct ?

Aug
17
2 months ago
Activity icon

Started a new Conversation In Listing Of Data Form Is Rendered When Any Input Edited?

Hello, In laravel 7 with livewire 1.3 I make listing of data with filter text input(it has wire:model.lazy defined) and “Search” button and I need to run search when “Search” button is clicked. But search is run when text input lose focus without clicking on “Search” button. I have a component app/Http/Livewire/Admin/Facilities.php:

<?php

namespace App\Http\Livewire\Admin;

use App\library\CheckValueType;
use App\Settings;
use DB;
use Illuminate\Validation\Rule;
use Livewire\Component;
use App\Facility;
use Livewire\WithPagination;


class Facilities extends Component
{
    use WithPagination;

    public $form= [
        'name'=>'',
        'descr'=> '',
        'created_at'=> ''
    ];

    public $current_facility_id;
    public $filter_name;
    public $updateMode = 'browse';

    public function render()
    {
        \Log::info( '-1 Facilities $this->filter_name ::' . print_r(  $this->filter_name, true  ) );
        // when text input lose focus I see tracing code above is added to log

        $facility_rows_count = Facility
            ::getByName($this->filter_name, true)
            ->count();
        $backend_per_page = Settings::getValue('backend_per_page', CheckValueType::cvtInteger, 20);

        $this->emit('facility_opened', [ 'mode'=>'browse', 'id'=>null ] );
        return view('livewire.admin.facilities.container', [
            'facilityDataRows' => Facility
                ::orderBy('created_at', 'desc')
                ->getByName($this->filter_name, true)
                ->paginate($backend_per_page),
            'facility_rows_count'=> $facility_rows_count
        ]);
    }

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

<div>
    
    @inject('viewFuncs', 'App\library\viewFuncs')
    
    <div class="page_content">
        
        @include('livewire.common.alert_messages')
        
        <div class="card form-admin-facilities">
            
            <div class="card-body card-block">
                
                @if($updateMode=='browse')
                    <h3 class="card-header">
                        {{ $facility_rows_count }}
                        {{ Str::plural('Facility', $facility_rows_count) }}
                    </h3>
                    
                    <div class="content_with_right_button">
                        <div class="content_with_right_button_left_content">
                            <h4 class="card-subtitle ml-3 mr-3">
                                Your can create/edit/delete facilities
                            </h4>
                        </div>
                        <div class="content_with_right_button_right_button m-0 m-0">
                            <button type="button" wire:click="add()" class="btn btn-xs btn-success action_link">Add</button>
                        </div>
                    </div>
                    
                    <fieldset class="bordered text-muted p-2 m-2">
                        <legend class="bordered">Filters</legend>
                        <div class="content_with_right_button">
                            <div class="content_with_right_button_left_content">
                                <input class="form-control admin_control_input" type="text" wire:model.lazy="filter_name">
                            </div>
                            <div class="content_with_right_button_right_button pl-2">
                                <button class="btn btn-outline-secondary nowrap_block" wire:click="render" type="button">
                                    Search
                                </button>
                            </div>
                        </div>
                    </fieldset>
                @endif {{-- @if($updateMode=='browse')--}}
                
                @if($updateMode=='browse')
                    
                    @if(count($facilityDataRows) > 0)
                        <div class="table-responsive table-wrapper-for-data-listing">
                            <table class="table table-striped table-data-listing">
                                <thead>
                                <tr>
                                    <th>Id</th>
                                    <th>Name</th>
                                    <th>Description</th>
                                    <th>Created</th>
                                    <th></th>
                                </tr>
                                </thead>
                                
                                @foreach($facilityDataRows as $nextFacilityDataRow)
                                    <tr>
                                        <td class="text-right m-0">
                                            <a wire:click="edit({{$nextFacilityDataRow->id}})"
                                               class="p-1 a_edit_item_{{$nextFacilityDataRow->id}} a_link">
                                                {{$nextFacilityDataRow->id}}
                                            </a>
                                        </td>
                                        <td class="text-left m-0">
                                            {{$nextFacilityDataRow->name}}
                                        </td>
                                        <td class="text-left m-0">{{$nextFacilityDataRow->descr}}</td>
                                        <td class="text-left m-0">{{$viewFuncs->getFormattedDate($nextFacilityDataRow->created_at)}}</td>
                                        <td class="nowrap_block m-1">
                                            <a wire:click="edit({{$nextFacilityDataRow->id}})"
                                               class="p-1 a_edit_item_{{$nextFacilityDataRow->id}} a_link">
                                            </a>
                                            <a onclick="return confirm('Are you sure you want to remove the facility?') || event.stopImmediatePropagation()"
                                               wire:click="destroy({{$nextFacilityDataRow->id}})" type="button" class="p-1
                                                a_delete_item_{{$nextFacilityDataRow->id}} a_link">
                                            </a>
                                        </td>
                                    </tr>
                                @endforeach
                            
                            </table>
                        </div> <!-- <div class="table-responsive table-wrapper-for-data-listing"> -->
                    
                    @endif {{-- @if(count($facilityDataRows) > 0) --}}
                @endif {{-- @if($updateMode=='browse')  --}}
            </div> <!-- <div class="card-body card-block"> -->
            
            <section class="card-footer">
                @if($updateMode=='browse')
                    {{ $facilityDataRows->links() }}
                @endif {{-- @if($updateMode=='browse')  --}}
            </section>
        
        </div> <!-- <div class="card form-admin-facilities"> -->
    
    </div>
</div>

<script>
    window.livewire.on('facility_opened', data => {
        console.log('facility_opened data::')
        console.log(data)
        alertsInit(data.mode,data.id)
    })
</script>

My “Search” button has type="button" and no submit rule for form(I do not have any form) or button. Why it works in wrong way and how to fix it ? Thanks!

Aug
15
2 months ago
Activity icon

Replied to Who To Connect In Filezilla With Provided Ftp Credentials ?

Sorry, if my questions silly. I remember this feature, my questions is how to keep listing of files I modified : When working for a long time I do not want to keep listing of modified files what I can check in git with

git status 

command

Activity icon

Replied to Who To Connect In Filezilla With Provided Ftp Credentials ?

I mean I need similar functionality like with git :

git status 

?

Activity icon

Replied to Who To Connect In Filezilla With Provided Ftp Credentials ?

program. And very inconvenient. A question at once : how to track modified files, what I did with

git status 

command?

Activity icon

Replied to Who To Connect In Filezilla With Provided Ftp Credentials ?

Thanks! But are there something better of filezilla(for kubuntu 18). Last years I worked with git and now filezilla seems very slow...

Activity icon

Replied to Who To Connect In Filezilla With Provided Ftp Credentials ?

I tried : https://prnt.sc/u00nlb But got error:

Error:	Disconnected: No supported authentication methods available (server sent: publickey)
Error:	Could not connect to server

I do not have any ssh keys...

Activity icon

Started a new Conversation Who To Connect In Filezilla With Provided Ftp Credentials ?

Hello,

From my client I received ftp account and sample listing, that credentials are valid:

[email protected]_IP:~$ ftp CLIENT.REMOTE.SERVER
Connected to CLIENT.REMOTE.SERVER.
220 ProFTPD Server (ProFTPD) [CLIENT.SERVER.IP]
Name (CLIENT.REMOTE.SERVER:ubuntu): SERVERUSER
331 Password required for SERVERUSER
Password:
230 User SERVERUSER logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful
150 Opening BINARY mode data connection for file list
-rwxrwxrwx 1 SERVERUSER psacln 692 Mar 9 21:29 Dockerfile-composer
-rwxrwxrwx 1 SERVERUSER psacln 508 Mar 9 21:29 Dockerfile-nginx

I have not worked with ftp last several years and maybe I forgot something, but I opened filezilla and tried to connect with provided credentials and got error :

I got error :

Status:	Connecting to CLIENT.SERVER.IP:22...
Status:	Connection established, waiting for welcome message...
Response:	SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
Error:	Cannot establish FTP connection to an SFTP server. Please select proper protocol.
Error:	Critical error: Could not connect to server

I entered parameters : https://prnt.sc/u005uz

Are some of them wrong ? Which valid?

Thanks!

Aug
14
2 months ago
Activity icon

Started a new Conversation Why In Livewire Register Form Prior Button Is Not Triggered?

Hi, with livewire / alpinejs I make register form as wizard, with Next/Prior buttons. Problem is that Prior button is not triggered I my component app/Http/Livewire/Register.php I have :

    <?php
    
    namespace App\Http\Livewire;
    
    use Facade\Ignition\SolutionProviders\IncorrectValetDbCredentialsSolutionProvider;
    use Livewire\Component;
    use App\User;
    use Auth;
    use DB;
    use App\Config;
    use Mockery\Generator\Method;
    
    class Register extends Component
    {
        public $current_step= 1;
    
        public $form= [
            'username'=>'User',
            'email'=>'[email protected]',
            'password'=> '123456',
            'password_confirm'=> '123456',
            'status'=> '',
            'account_type'=> '',
            'first_name'=> '',
            'last_name'=> '',
            'phone'=> '',
            'website'=> '',
            'notes'=> '',
            'avatar'=> '',
    
        ];
    
        public function nextStep()
        {
            $registerRules= User::getUserValidationRulesArray('register_step_' . $this->current_step);
    
            $this->validate($registerRules);
            $this->current_step++;
            if($this->current_step == 5) { // last Preview step submitted - can create user
                ...
            } //if($this->current_step == 5) { // last Preview step submitted - can create user
    
        } // public function nextStep()
    
    
        public function priorStep()
        {
            \Log::info( '-1 priorStep $this->current_step ::' . print_r(  $this->current_step, true  ) );
            $this->current_step--;
        }
    
        public function render()
        {
            return view('livewire.auth.register');
        }
    }

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

    <article class="page_content_container">
    
    @inject('viewFuncs', 'App\library\viewFuncs')
    
    
    @include('livewire.common.alert_messages')
    
    <form class="form-register" wire:submit.prevent="nextStep">
        <div class="card">
            <div class="card-body card-block">
                
                <h3 class="card-header">
                    {!! $viewFuncs->showAppIcon('register') !!}
                    <div class="spinner-border" role="status" wire:loading>
                        <span class="sr-only">Loading...</span>
                    </div>
                    {{ $current_step }}Register
                </h3>
                
                @if($current_step === 1)
                    <h4 class="card-subtitle">Fill your username and Email. Both must be unique</h4>
                    <dl class="block_2columns_md m-3"> <!-- username FIELD DEFINITION -->
                        <dt class="key_values_rows_label_13">
                            <label class="col-form-label" for="username">Username:<span class="required"> * </span></label>
                        </dt>
                        <dd class="key_values_rows_value_13">
                            <div class="input-group">
                                <div class="input-group-addon">
                                    {!! $viewFuncs->showAppIcon('user') !!}
                                </div>
                                <input
                                    wire:model.lazy="form.username"
                                    id="username"
                                    class="form-control editable_field"
                                    placeholder="Your username"
                                    autocomplete=off
                                >
                            </div>
                            @error('form.username')
                            <div class="validation_error">{{ clearValidationError($message,['form.'=>'']) }}</div> @enderror
                        </dd>
                    </dl> <!-- <dt class="block_2columns_md m-0"> username FIELD DEFINITION -->
                    
                    
                    <dl class="block_2columns_md m-3"> <!-- email FIELD DEFINITION -->
                        <dt class="key_values_rows_label_13">
                            <label class="col-form-label" for="email">Email:<span class="required"> * </span></label>
                        </dt>
                        <dd class="key_values_rows_value_13">
                            <div class="input-group">
                                <div class="input-group-addon">
                                    {!! $viewFuncs->showAppIcon('email') !!}
                                </div>
                                <input
                                    wire:model.lazy="form.email"
                                    id="email"
                                    class="form-control editable_field"
                                    placeholder="Your email address"
                                    autocomplete=off
                                >
                            </div>
                            @error('form.email')
                            <div class="validation_error">{{ clearValidationError($message,['form.'=>'']) }}</div> @enderror
                        </dd>
                    </dl> <!-- <dt class="block_2columns_md m-0"> email FIELD DEFINITION -->
                @endif
                
                @if($current_step === 2)
                    <h4 class="card-subtitle">Fill your password. It must be strong enough</h4>
                    <dl class="block_2columns_md m-3"> <!-- password FIELD DEFINITION -->
                        <dt class="key_values_rows_label_13">
                            <label class="col-form-label" for="password">Password:<span class="required"> * </span></label>
                        </dt>
                        <dd class="key_values_rows_value_13">
                            <div class="input-group">
                                <div class="input-group-addon">
                                    {!! $viewFuncs->showAppIcon('password') !!}
                                </div>
                                <input type="password"
                                       wire:model.lazy="form.password"
                                       id="password"
                                       class="form-control editable_field"
                                       placeholder="Your password"
                                       autocomplete=off
                                >
                            </div>
                            @error('form.password')
                            <div class="validation_error">{{ clearValidationError($message,['form.'=>'']) }}</div> @enderror
                        </dd>
                    </dl> <!-- <dl class="block_2columns_md m-0"> password FIELD DEFINITION -->
                    
                    
                    <dl class="block_2columns_md m-3"> <!-- password_confirm FIELD DEFINITION -->
                        <dt class="key_values_rows_label_13">
                            <label class="col-form-label" for="password_confirm">Password confirm:<span class="required"> * </span></label>
                        </dt>
                        <dd class="key_values_rows_value_13">
                            <div class="input-group">
                                <div class="input-group-addon">
                                    {!! $viewFuncs->showAppIcon('password') !!}
                                </div>
                                <input type="password"
                                       wire:model.lazy="form.password_confirm"
                                       id="password_confirm"
                                       class="form-control editable_field"
                                       placeholder="Your password confirm(must be equal password)"
                                       autocomplete=off
                                >
                            </div>
                            @error('form.password_confirm')
                            <div class="validation_error">{{ clearValidationError($message,['form.'=>'']) }}</div> @enderror
                        </dd>
                    </dl> <!-- <dl class="block_2columns_md m-0"> password_confirm FIELD DEFINITION -->
                @endif  {{--     @if($current_step === 2)--}}
                
                @if($current_step === 3)
                    ...
                @endif {{--  @if($current_step === 3)--}}
                
            
            </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 action_link">
                    {!! $viewFuncs->showAppIcon('cancel', 'white') !!}Cancel
                </button>
                
                @if($current_step > 1)
                    <button wire:click.prevent="priorStep" class="btn btn-secondary btn-sm m-2 ml-4 mr-4 action_link" type="button">
                        {!! $viewFuncs->showAppIcon('back', 'white') !!}Prior
                    </button>
                @endif
                <button type="submit" class="btn btn-primary btn-sm m-2 ml-4 mr-4 action_link">
                    {!! $viewFuncs->showAppIcon('next', 'white') !!}Next
                </button>
            </section>
        
        </div> <!-- <div class="card"> -->
    
    </form>
    </article> <!-- page_content_container -->
    
    
    @push('styles')
        <link href="/css/quill.snow.css" rel="stylesheet">
    @endpush
    
    @push('scripts')
        <script src="{{ asset('/js/quill.js') }}"></script>
    @endpush
    
    @section('scripts')
        <script>
            $("#username").focus();
        </script>
    @endsection

with priorStep method calling...

Method:: priorStep( of the component is not triggered, I do not see Log lines or events in the console and can not understand why?

Thanks!

Aug
12
2 months ago
Activity icon

Replied to I Search For User Idle Plugin/decision For Livewire / Alpine App

Yes, it looks like what I need, but how to use it? I added code in resources/js/app.js :

window.$ = window.jQuery = require('jquery');
require('./bootstrap');
window.toastr = require('toastr');

import { Idle } from 'idlejs';

// with predefined events on `document`
const idle = new Idle()
    .whenNotInteractive()
    .within(1) // I suppose that in 1 minute logoutUser() function will be triggered!
    .do(() => logoutUser())  // But not logoutUser - is not triggered
    .start();


var Turbolinks = require("turbolinks")
Turbolinks.start()

function logoutUser() {
    alert( 'logoutUser::' )
}

Which way is valid ?

Aug
11
2 months ago
Activity icon

Started a new Conversation I Search For User Idle Plugin/decision For Livewire / Alpine App

Are there something like https://github.com/soixantecircuits/idle-vue ( detects when the user hasn't interacted with your app for a while) compatible with laravel 7 /livewire 1.3 / turbolinks:5 / [email protected] ?

Thanks!

Aug
09
2 months ago
Activity icon

Replied to I Got Memory Lack Error In Docker Installing Laravel Plugin

In __DOCKER/web/Dockerfile.yml :

FROM php:7.3-apache
Activity icon

Started a new Conversation I Got Memory Lack Error In Docker Installing Laravel Plugin

Hello, Trying to add new package in laravel 7 under docker I got memory lack error :

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

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

But in the console I see a lot of memory allowed:

[email protected]:/var/www/hostels3_docker_root# free
              total        used        free      shared  buff/cache   available
Mem:        8085252     5778240     1520788       86808      786224     1956736
Swap:       2104476     2026072       78404

In the php info I see :

memory_limit	2048M	128M

In __DOCKER/web/virtualhost.conf I have parameter :

	php_value  memory_limit  2048M

and

Configuration File (php.ini) Path	/usr/local/etc/php

but trying to open php.ini with command :

nano /usr/local/etc/php.ini

nothing was found. Seems this file is virtual ?

Also I know that (when using lamp) for console commands php cli must be configured. I tried to install php7.3-cli in my __DOCKER/web/Dockerfile.yml :

 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 php7.3-cli \
&& a2enmod rewrite

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

But I got error that php7.3-cli is not found.

In which way can I fix memory lack I have ?

In my hosting kubuntu 18 I have 8GiB of memory :

$ lsb_release -d; uname -r; uname -i
Description:    Ubuntu 18.04.4 LTS
4.15.0-112-generic
x86_64
$ free
              total        used        free      shared  buff/cache   available
Mem:        8085252     5623840      141952      110116     2319460     2073288
Swap:       2104476      302848     1801628

Thanks!

Aug
06
2 months ago
Activity icon

Replied to I Got Error Using Datepicker In Livewire App

Thanks! My date format is “Thu Aug 06 2020”, I want to change it and for this I modify file resources/views/components/date-picker.blade.php :


<div>
    <input
        x-data
        x-ref="input"
        x-init="new Pikaday({ field: $refs.input, format:'D MMM YY' })"
        type="text"
        {{ $attributes }}
    >
</div>

But date format is the same... Which way is valid ?

Aug
05
2 months ago
Activity icon

Started a new Conversation I Got Error Using Datepicker In Livewire App

Hello, In laravel 7 with livewire 1.3 I want to add datepicker from https://laravel-livewire.com/docs/alpine-js ("Creating A DatePicker Component" docs) But I get error :

Unable to locate a class or view for component [date-picker]. 
(View: /mnt/_work_sdb8/wwwroot/lar/hostels3/resources/views/livewire/hostel/hostel-view-page.blade.php)

and in my blade file I use <x:date-picker in modal dialog, which I open with alpinejs:

<div class="card item_container">
    
    ...
    
    <div
        class="modal_editor_title card-title"
    >
        <h4 class="modal-title p-2">
            <button class="close" type="button" x-on:click="show_booking_enquiry_modal= false">
                <span aria-hidden="true">&times;</span>
            </button>
        </h4>
    </div> <!-- modal_editor_title -->
    
    <div class="modal_editor_fields card-body" :style="'max-height: ' + ( modalHeight() - 20 ) +'px; overflow-y: scroll;'">
        
        <form class="form-login" wire:submit.prevent="newBookingEnquirySubmit">
            <div class="card">
                <div class="card-body card-block">
                    
                    <h4 class="card-subtitle">Fill your enquery</h4>
                    
                    
                    <dl class="block_2columns_md m-3"> <!-- start_date FIELD DEFINITION -->
                        <dt class="key_values_rows_label_13">
                            <label class="col-form-label" for="start_date">Start date:</label>
                        </dt>
                        <dd class="key_values_rows_value_13">
                            <label for="start_date">Start Date</label>
                            
                            <x:date-picker wire:model="start_date" id="start_date"/>
                            
                            
                            @error('hostelEnqueryForm.start_date')
                            <div class="validation_error">{{ $message }}</div> @enderror
                        </dd>
                    </dl> <!-- <dt class="block_2columns_md m-0"> start_date FIELD DEFINITION -->
                    
                    ...
                
                
                </div> <!-- <div class="card"> -->
            </div> <!-- <div class="card"> -->
        
        </form>
    
    </div>  <!-- modal_editor_fields-->
    
    ...
    
    <div class="modal_editor_footer card-footer row_content_right_aligned">
        <div class="m-2">
            <button wire:click="submitBookingEnquery()" class="btn btn-primary editor_button_submit ml-5" type="button">
                {!! $viewFuncs->showAppIcon('save', 'white') !!} Submit
            </button>
            <button x-on:click="show_booking_enquiry_modal= false" class="btn btn-cancel-action" type="button">
                {!! $viewFuncs->showAppIcon('cancel', 'white') !!} Cancel
            </button>

In layout file In my resources/views/layouts/app.blade.php I have : I add Pikaday .js and .css files:

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <title>Laravel:Livewire</title>
    
    <!-- Fonts -->
    <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
    
    <!-- Styles -->
    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/pikaday/css/pikaday.css">
    <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="{{ 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" defer></script>
    <script src="https://cdn.jsdelivr.net/npm/pikaday/pikaday.js"></script>
    
    @livewireScripts
    @stack('scripts')
    
    
    <script src="{{ asset('/js/app/app_funcs.js') }}"></script>

</head>

As I see installation rules in https://github.com/Pikaday/Pikaday . What did I miss ? Can it be order of refs in app.blade.php file ?

Thanks!

Aug
04
2 months ago
Activity icon

Started a new Conversation I Search WYSIWYG Ediitor Livewire/alpine

Hello, Can you advice some modern WYSIWYG ediitor compatible with laravel 7 /livewire 1.3 / turbolinks:5.2 / [email protected] / bootstrap 4.5

and link to installation guide. Thanks!

Aug
01
2 months ago
Activity icon

Replied to Upgrade Php To 7.3 I See 7.2 In My Browser

But I got error :

# sudo a2dismod php7.2
Module php7.2 disabled.
To activate the new configuration, you need to run:
  systemctl restart apache2
[email protected]:/mnt/_work_sdb8/wwwroot/lar/hostels3# sudo a2enmod php7.3
ERROR: Module php7.3 does not exist!

?

Activity icon

Started a new Conversation Upgrade Php To 7.3 I See 7.2 In My Browser

Hello, Looking at this https://www.cloudbooklet.com/how-to-install-php-7-3-on-ubuntu-18-04/ article I try to upgrade php to 7.3 on my local Ubuntu 18

But after I run command:

sudo apt install php7.3
restyarting the OS I see in the console : 
$ php -v
PHP 7.3.20-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jul  9 2020 16:34:09) ( NTS )

But phpinfo in the browser shows me PHP Version 7.2 :

PHP Version 7.2.24-0ubuntu0.18.04.6
System	Linux athoe 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64
Build Date	May 26 2020 13:09:11
Server API	Apache 2.0 Handler
Virtual Directory Support	disabled
Configuration File (php.ini) Path	/etc/php/7.2/apache2
Loaded Configuration File	/etc/php/7.2/apache2/php.ini
Scan this dir for additional .ini files	/etc/php/7.2/apache2/conf.d

also I failed to open file : 
sudo nano /etc/php/7.3/apache2/php.ini
as directory /etc/php/7.3/apache2 was not found
and checking the system I see : 

[email protected]:/etc/php# ls -la
total 24
drwxr-xr-x   4 root root  4096 �����  1 17:33 .
drwxr-xr-x 156 root root 12288 �����  1 17:33 ..
drwxr-xr-x   5 root root  4096 �����  5  2019 7.2
drwxr-xr-x   5 root root  4096 �����  1 17:33 7.3
[email protected]:/etc/php# cd 7.2
[email protected]:/etc/php/7.2# ls -la
total 20
drwxr-xr-x 5 root root 4096  5  2019 .
drwxr-xr-x 4 root root 4096   1 17:33 ..
drwxr-xr-x 3 root root 4096  4 18:22 apache2
drwxr-xr-x 3 root root 4096   3 10:01 cli
drwxr-xr-x 2 root root 409613  2020 mods-available
[email protected]:/etc/php/7.2# cd ../
[email protected]:/etc/php# cd 7.3
[email protected]:/etc/php/7.3# ls -la
total 20
drwxr-xr-x 5 root root 4096  1 17:33 .
drwxr-xr-x 4 root root 4096  1 17:33 ..
drwxr-xr-x 3 root root 4096  1 17:33 cli
drwxr-xr-x 4 root root 4096  1 17:33 fpm
drwxr-xr-x 2 root root 4096  1 17:33 mods-available

What did I miss in my setup ?

Thanks!

Jul
26
2 months ago
Activity icon

Started a new Conversation Why Emitted Event Of Livewire Is Not Triggered?

Hello, In laravel 7 learning livewire/livewire 1.3 I encountered that emitted events are not always triggered

I created component with command

php artisan make:livewire hostel/hostelsHomepageSpotlight

and simplifying the code I do not see alert of event. In app/Http/Livewire/Hostel/HostelsHomepageSpotlight.php :

<?php

namespace App\Http\Livewire\Hostel;

use Auth;
use DB;
use App\Config;

use App\Hostel;
use App\HostelImage;
use App\library\CheckValueType;
use App\Settings;
use Livewire\Component;

class HostelsHomepageSpotlight extends Component
{

    public function render()
    {

        $hostels     = [];
        $current_page= 1;
        $hostel_rows_count = Hostel
            ::getByStatus('A')
            ->count();

        $this->emit('hostelsHomepageSpotlightOpened', [ 'mode'=> 'hostels_homepage_spotlight', 'current_page'=>$current_page, 'hostel_rows_count'=>$hostel_rows_count ] ); // EMIT EVENT

        return view('livewire.hostel.hostels-homepage-spotlight', [
            'hostelsDataRows' => $hostels,
            'hostel_rows_count'=> $hostel_rows_count,
            'current_page'=> $current_page,
        ]);
    }


}

and in resources/views/livewire/hostel/hostels-homepage-spotlight.blade.php:

<div>
    
    <h1>hostelsHomepageSpotlightOpened</h1>

</div>   

<script>
    // If to uncomment line below I see  alert
    // alert( 'resources/views/livewire/hostel/hostels-homepage-spotlight.blade.php::' )
    window.livewire.on('hostelsHomepageSpotlightOpened', data => {
        // I DO NOT SEE ALERT BELOW ANYWAY
        alert( 'hostelsHomepageSpotlightOpened::' )
        console.log('facility_opened data::')
        console.log(data)
        // alertsInit(data.mode)
        // lazyImagesInit("img.lazy_image")
    })
</script>

Why event is not triggered ? Is there is a way to debug it ?

Thanks!