PetroGromovo

PetroGromovo

Member Since 1 Month Ago

Experience Points 530
Experience Level 1

4,470 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 Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

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

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

16 Mar
4 days ago

PetroGromovo started a new conversation I Have Problems Implementing Infinite-Scroll Functionality

Hello, with https://infinite-scroll.com/ plugin in my laravel 5.7 / Bootstrap v4.1. / blade / jquery-3.3.1 / Infinite Scroll PACKAGED v3.0.5 application I implemented infinite-scroll functionality It works, but not fully. The problem is that when I scroll more pages than I have rows pagination still continues working and I got invalid rows loaded label.

Please look live https://www.votes.nilov-sergey-demo-apps.tk/all-external-news at top left of the page there is number of items loaded, buit moving bottom I got invalid message like

540 of 121 External News loaded

and no end of the page:

My base template has :

@extends($frontend_template_name.'.layouts.frontend')

@section('content')

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


    <h1 class="text-center">
        @if(isset($site_heading))<span>{{ $site_heading }}@endif</span>
        <br> {{ $all_external_news_count }} News
    </h1>


    @include($frontend_template_name.'.layouts.logged_user')

    <div class="row ml-2 mb-3">
        {{ Breadcrumbs::render('all-external-news', 'External News') }}
    </div>
    <div class="row ml-2 mb-3 small_title">
        <span id="span_external_news_loaded_count">{{ $external_news_loaded_count }}</span>&nbsp;of&nbsp;{{ $all_external_news_count }}&nbsp;External News loaded
    </div>


    <div class="row ml-1 mr-1">
        <div class="col-sm-8 ">

            <div class="row">

                <div id="infinite_scroll_container">

                    @foreach($allExternalNews as $nextAllExternalNews)
                        <article class="all-external-news-listing-append-block">

                            <div class="card">
                                <div class="card-body pt-2">

                                    <h5 class="card-title mb-0 pb-0">
                                        <a href="{{ route('news', $nextAllExternalNews['slug'] ) }}">
                                            {{ Purifier::clean($nextAllExternalNews['title']) }}
                                        </a>
                                        @if( $nextAllExternalNews['is_featured'] )
                                            <span class="float-right mt-0 pt-0 badge badge-pill badge-primary">Featured</span>
                                        @endif
                                    </h5>

                                    @if( !empty($nextAllExternalNews['content_shortly']) )
                                        <div class="card-footer mt-0 pt-0 mb-0 pb-0">
                                            <small>{!! Purifier::clean($nextAllExternalNews['content_shortly']) !!}</small>
                                        </div>
                                    @endif

                                    <div class="card-footer  mt-0 pt-0">
                                        <div class="row float-right mt-0 pt-0 published_by_author">
                                            Published at {{ $viewFuncs->getFormattedDateTime($nextAllExternalNews['created_at'], 'mysql', 'ago_format') }} by {{
    $nextAllExternalNews['source_type'] }}
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </article>
                    @endforeach
                </div>

                <div class="all-external-news-listing-load-status-block">
                    END OF CONTENT
                    <div class="loader-ellips infinite-scroll-request">
                        <span class="loader-ellips__dot"></span>
                        <span class="loader-ellips__dot"></span>
                        <span class="loader-ellips__dot"></span>
                        <span class="loader-ellips__dot"></span>
                    </div>
                    <p class="infinite-scroll-last">End of content</p>
                    <p class="infinite-scroll-error">No more pages to load</p>
                </div>

            </div>
        </div>


        @include($frontend_template_name.'.layouts.right_menu_block' , ['show_questions_block' => false, 'show_most_rated_quizzes_block' => true,
'show_most_taggable_votes_block' => true, 'show_Vote_categories_block'=> true ] )

    </div>

@endsection



@section('scripts')

    <script src="{{ asset('js/infinite-scroll.pkgd.min.js') }}{{  "?dt=".time()  }}"></script>
    <script src="{{ asset('js/'.$frontend_template_name.'/all_external_news.js') }}{{  "?dt=".time()  }}"></script>

    <script>
        /*<![CDATA[*/

        var frontendAllExternalNews = new frontendAllExternalNews('view',  // must be called before jQuery(document).ready(function ($) {
            <?php echo $appParamsForJSArray ?>
        );
        jQuery(document).ready(function ($) {
            frontendAllExternalNews.onFrontendPageInit('view')
        });

        /*]]>*/
    </script>

@endsection

so when page is opened first 20 rows are already shown

Moving down new data are uploaded with template :

@inject('viewFuncs', 'App\library\viewFuncs')
@if( !empty($latestExternalNewsData) and count($latestExternalNewsData) > 0 )
    <div class="latest-news-block mt-0 mb-0 mt-3 bordered">

        <h3 class="text-center">Our Partners  News</h3>
        <ul class="news-line">
        @foreach($latestExternalNewsData as $nextExternalLatestNew)

            <div class="card">
                <div class="card-body pt-0">

                    <h5 class="card-title mb-0 pb-0">
                        <a href="{{ $nextExternalLatestNew['source_url'] }}">
                            {!! Purifier::clean($nextExternalLatestNew['title']) !!}
                        </a>
                        @if( $nextExternalLatestNew['is_featured'] )
                            <span class="float-right mt-0 pt-0 badge badge-pill badge-primary">Featured</span>
                        @endif
                    </h5>

                    @if( !empty($nextExternalLatestNew['content_shortly']) )
                        <p class=" m-0 pt-0 ">
                            <small>
                                {!! Purifier::clean($nextExternalLatestNew['content_shortly']) !!}
                            </small>
                        </p>
                    @endif

                    <div class="card-footer  mt-0 pt-0">
                        <div class="row float-right mt-0 pt-0 published_by_author">
                            Published at {{ $viewFuncs->getFormattedDateTime($nextExternalLatestNew['created_at'], 'mysql', 'ago_format') }} by <b>&nbsp;{{
                            $nextExternalLatestNew['source_type'] }}</b>
                        </div>
                    </div>

                </div>
            </div>

        @endforeach
        </ul>


        @if( $all_external_news_count > count($latestExternalNewsData) )
            <div class="card">
                <div class="card-body pt-0">
                    <a href="{{ route('all-external-news' ) }}">
                        Our Partners All News
                    </a>
                </div>
            </div>
        @endif

    </div>
@else
    @if( !empty($config['show_no_items_label']) )
        <div class="alert alert-warning small" role="alert">
            There are no Our Partners news yet
        </div>
    @endif
@endif

and javascript file with infinity imnitialization :
var this_frontend_home_url
var this_infinite_scroll_rows_per_scroll_step
var this_csrf_token


function frontendAllExternalNews(page, paramsArray) {  // constructor of frontend AllExternalNews's editor - set all params from server
    // alert( "paramsArray page::"+var_dump(paramsArray) )
    this_frontend_home_url = paramsArray.frontend_home_url;
    this_infinite_scroll_rows_per_scroll_step = paramsArray.infinite_scroll_rows_per_scroll_step;
    this_csrf_token = paramsArray.csrf_token;

    if (page == "view") {
        this.InitInfiniteScroll()
    }
} // function frontendAllExternalNews(Params) {  constructor of frontend AllExternalNews's editor - set all params from server


frontendAllExternalNews.prototype.InitInfiniteScroll = function () {
    var infScroll = new InfiniteScroll('#infinite_scroll_container', {
            path: function () {
                console.log(" path this.loadCount::")
                console.log( this.loadCount )

                console.log("this.loadCount * this_infinite_scroll_rows_per_scroll_step::")
                console.log( this.loadCount * this_infinite_scroll_rows_per_scroll_step )

                if ( this.loadCount > 0 ) {
                    $("#span_external_news_loaded_count").html(this.loadCount * this_infinite_scroll_rows_per_scroll_step)
                }
                return '/get-all-external-news-listing/' + ( ( this.loadCount + 1 ) * this_infinite_scroll_rows_per_scroll_step );
            },
            append: '.all-external-news-listing-append-block',
            status: '.all-external-news-listing-load-status-block',
        }
        , function (data) {
        }
    )

}


frontendAllExternalNews.prototype.onFrontendPageInit = function (page) {  // all vars/objects init
    frontendInit()
} // frontendAllExternalNews.prototype.onFrontendPageInit= function(page) {

I have defined status block but it does not work. Why? Can it be the reason?

  1. Scrolling down I see that my url is changed to https://www.votes.nilov-sergey-demo-apps.tk/get-all-external-news-listing/20 I suppose that is not valid, but I do not see why?

Thanks!

PetroGromovo left a reply on Error In Migration With Use Prefix Set In Modal Constructor

Thank you, Looks like that was a reason of my errors.

Could, you, also,please, look at the net example:

        $mostRatingQuizQualityResultsDataTemp = QuizQualityResult
            ::select( $votes_tb.'.name as vote_name', $votes_tb.'.slug as vote_slug', $quiz_quality_results_tb.'.vote_id', 'count('.$quiz_quality_results_tb.'.quiz_quality_id) as quiz_quality_count', 'avg('.$quiz_quality_results_tb . '.quiz_quality_id) as quiz_quality_avg' )
            ->getByVoteStatus('A')
            ->orderBy($this->config['order_by_field_name'], $this->config['order_by_field_ordering'])
            ->groupBy('vote_id')
            ->groupBy('vote_slug')
            ->groupBy('vote_name')
            ->join( $votes_tb, $votes_tb.'.id', '=', $quiz_quality_results_tb.'.vote_id' )
            ->limit ($this->config['items_per_block'] )
            ->get();

which raise error :

ErrorException (E_ERROR)
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'vt2_count(quiz_quality_results.quiz_quality_id)' in 'field list' (SQL: select `vt2_votes`.`name` as `vote_name`, `vt2_votes`.`slug` as `vote_slug`, `vt2_quiz_quality_results`.`vote_id`, `vt2_count(quiz_quality_results`.`quiz_quality_id)` as `quiz_quality_count`, `vt2_avg(quiz_quality_results`.`quiz_quality_id)` as `quiz_quality_avg` from `vt2_quiz_quality_results` inner join `vt2_votes` on `vt2_votes`.`id` = `vt2_quiz_quality_results`.`vote_id` where `vt2_votes`.`status` = A group by `vote_id`, `vote_slug`, `vote_name` order by `quiz_quality_avg` desc limit 8

?

15 Mar
5 days ago

PetroGromovo left a reply on Error In Migration With Use Prefix Set In Modal Constructor

Please look at this request, joining 2 tables :

        $activeQuizVotes = Vote
            ::getByStatus('A')
            ->getByIsHomepage(true)
            ->getByIsQuiz(true)
            ->orderBy('ordering', 'desc')
            ->orderBy('created_at', 'desc')
            ->leftJoin( "vote_categories", 'vote_categories.id', '=', 'votes.vote_category_id' )
            ->select( "votes.*, vote_categories.name as vote_category_name, vote_categories.slug as vote_category_slug" )
            ->paginate($home_page_ref_items_per_pagination)
            ->onEachSide((int)($home_page_ref_items_per_pagination / 2));

and it raised error :

Column not found: 1054 Unknown column 'vt2_votes.*, vote_categories.name' in 'field list' (SQL: select `vt2_votes`.`*, vote_categories`.`name` as `vote_category_name, vote_categories.slug` from `vt2_votes` left join `vt2_vote_categories` on `vt2_vote_categories`.`id` = `vt2_votes`.`vote_category_id` where `vt2_votes`.`status` = A and `vt2_votes`.`is_homepage` = 1 and `vt2_votes`.`is_quiz` = 1 order by `ordering` desc, `created_at` desc limit 8 offset 0)

I made vt2_ prefix in config/database.php file : and no prefix defined in config/app.php or model's constructor, what I show before.

PetroGromovo left a reply on Error In Migration With Use Prefix Set In Modal Constructor

@NASH - Thank you for your feedback! Actually I need DB::raw( for ->select( statement. I had problems in this part of requests. Let me check it more, but please look at your join requests with ->select definition , like in my example. Does it work for you without any raw methods?

PetroGromovo left a reply on Error In Migration With Use Prefix Set In Modal Constructor

I tried to keep db_prefix in configuration file and assign it in constructor. That way seems correct as I wrote above.

14 Mar
6 days ago

PetroGromovo left a reply on Error In Migration With Use Prefix Set In Modal Constructor

Thanks, you are right, But I suppose that not relative to my problem?

PetroGromovo left a reply on Error In Migration With Use Prefix Set In Modal Constructor

I know that means that error and as I wrote at start that migration scripts had been working for sevaral monthes, untill I tried to use prefix in tables name with construct definition. It looks like with construct definition for some models something has overwritten my routing with null values for my defined fields. Very strange for me...

PetroGromovo left a reply on Error In Migration With Use Prefix Set In Modal Constructor

database/migrations/2018_11_01_150912_create_banners_table.php :

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use App\Banner;

class CreateBannersTable extends Migration
{
    private $banners_tb;
    public function __construct()
    {
        $this->banners_tb= with(new Banner)->getTable();
    }
    public function up()
    {
        Schema::create($this->banners_tb, function (Blueprint $table) {
            $table->increments('id');
            $table->string('text', 20)->unique();
            $table->string('url', 255)->unique();
            $table->boolean('active')->default(false);

            $table->integer('ordering')->unsigned();
            $table->integer('view_type')->unsigned();

            $table->timestamp('created_at')->useCurrent();

            $table->index(['ordering', 'active'], 'banners_ordering_active_index');
            $table->index(['created_at'], 'banners_created_at_index');
        });
        Artisan::call('db:seed', array('--class' => 'BannersInitData'));

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists($this->banners_tb);
    }
}

I got table name from its model.

PetroGromovo left a reply on Error In Migration With Use Prefix Set In Modal Constructor

@NASH - That is right, until I tried to work with joined tables. Did you work with joined tables like in my example above? Please look at it and give an example here.

PetroGromovo left a reply on Error In Migration With Use Prefix Set In Modal Constructor

I tried this way, but I have problems with joining tables and setting some fields from several tables, like :

 $nextVote = Vote
                ::where(with(new Vote)->getTable() . '.id', $nextTempTagRelatedVote->taggable_id)
                ->getByStatus('A')
                ->leftJoin(\DB::raw('vote_categories'), \DB::raw('vote_categories.id'), '=', \DB::raw('votes.vote_category_id'))
                ->select(\DB::raw(" votes.*, votes.image as vote_image, vote_categories.name as vote_category_name, vote_categories.slug as vote_category_slug"))
                ->get()
                ->first();

It seems more complicated and less readable. Simply to show prefix in table definition :

    protected $table = 'my_tablename';

seems ok in all cases, expect I prefer to keep this prefix in 1 place, like config file.

But testing I found that defining of constructor raise problems for some models...

13 Mar
1 week ago

PetroGromovo started a new conversation Error In Migration With Use Prefix Set In Modal Constructor

Hello, In my laravel 5.7 app with use of migration file I had to implement prefix of tables in database , After some tests I found a good way to set prefix of tables as config parameter, but leaving empty parameter database=>prefix in config/database.php. And I set prefi of tables in constructor of any model, like:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

use DB;
use App\MyAppModel;
use App\Http\Traits\funcsTrait;
use Illuminate\Validation\Rule;


class Banner extends MyAppModel
{
    use funcsTrait;

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

    protected $fillable = [ 'text', 'url', 'active', 'ordering', 'view_type' ];


    public function __construct()
    {
        parent::__construct();
        $this->table = config('app.db_prefix').'banners';
    }

But running migrations I found that eror was triggerer for some tables(not for all), like

Migrating: 2018_11_01_150912_create_banners_table

   Illuminate\Database\QueryException  : SQLSTATE[HY000]: General error: 1364 Field 'text' doesn't have a default value (SQL: insert into `banners` () values ())

  at /mnt/_work_sdb8/wwwroot/lar/votes/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668| 

  Exception trace:

  1   Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000]: General error: 1364 Field 'text' doesn't have a default value")

Commenting __construct above and setting line 
    protected $table = 'banners';

in the model above fixed this error, but similar problems on some other tables. Can you say why using of __construct raised this error ? If there is a better way for such prefix setting ?

Thanks!

06 Mar
2 weeks ago

PetroGromovo left a reply on Access Error Running Envoy In Laravel 5.7

  1. Could you, please, how setting password to empty string influence on the deploy work? Passwords on local system and on server are different.
  2. Have I too run on my local ubuntu command
envoy run deploy

under root?

I did not find to these questionbs in the docs https://laravel.com/docs/5.7/envoy

PetroGromovo left a reply on Access Error Running Envoy In Laravel 5.7

my .env :

APP_NAME="The Box Booking"
NOREPLY_EMAIL= '[email protected]'
SUPPORT_SIGNATURE= 'Best Regards,<br>    Support of The Box Booking'
APP_ENV=local
APP_KEY=base64:qtoXMAngtHCS8A+oa4DeIlGn7uTs/+HvXIRhXHy/uLo=
APP_DEBUG=true
APP_URL=local-boxbooking2.com

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=Boxbooking2_DEV
DB_USERNAME=root
DB_PASSWORD=1

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=sendgrid

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

SENDGRID_API_KEY = 'XXXX'

and config/database.php :

<?php

return [


    'default' => env('DB_CONNECTION', 'mysql'),


    'connections' => [

        'sqlite' => [
            'driver' => 'sqlite',
            'database' => env('DB_DATABASE', database_path('database.sqlite')),
            'prefix' => '',
            'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
        ],

        'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
        ],

        'pgsql' => [
            'driver' => 'pgsql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '5432'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
            'schema' => 'public',
            'sslmode' => 'prefer',
        ],

        'sqlsrv' => [
            'driver' => 'sqlsrv',
            'host' => env('DB_HOST', 'localhost'),
            'port' => env('DB_PORT', '1433'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
        ],

    ],

    
    'migrations' => 'migrations',


    'redis' => [

        'client' => 'predis',

        'default' => [
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_DB', 0),
        ],

        'cache' => [
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_CACHE_DB', 1),
        ],

    ],

];
05 Mar
2 weeks ago

PetroGromovo left a reply on Access Error Running Envoy In Laravel 5.7

I tried to run you command, but got error :

$ sudo su -u www-data envoy run deploy
su: invalid option -- 'u'
Usage: su [options] [LOGIN]
...

I made several attempts also, but failed :

$ sudo su www-data envoy run deploy   
This account is currently not available.
$ sudo su lardeployer envoy run deploy
sh: 0: Can't open envoy

Could you please provide a link, where these options are described ? I do not see at https://laravel.com/docs/5.7/envoy

PetroGromovo started a new conversation Access Error Running Envoy In Laravel 5.7

I created envoy file in my laravel 5.7 app, but running on my local comp it I got error :

    $ envoy run deploy
    PHP Warning:  file_get_contents(/home/user/.ssh/config): failed to open stream: Permission denied in /home/user/.composer/vendor/laravel/envoy/src/SSHConfigFile.php on line 33
    [email protected]'s password: 

Are that wrong access on my local system ?

Which commands have I to run ?

Thanks!

PetroGromovo started a new conversation Error In AppServiceProvider On Table Data Reading On App Installing

Hello, In my laravel 5.7 app I keep some settings in my db table and in my app/Providers/AppServiceProvider.php I have next lines :

class AppServiceProvider extends ServiceProvider
{
    use funcsTrait;

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {

        if ( \Schema::hasTable(with( new Settings)->getTable() ) ) {
            $settingsArray = Settings::getSettingsList(['site_name', 'site_heading', 'noreply_email'], true);
            $site_name     = ($settingsArray['site_name'] ? $settingsArray['site_name'] : '');
            ...
            config(['feed.feeds.main.title' => htmlspecialchars_decode($site_name . ' : ' . $site_heading)]);
            config(['mail.from.name' => htmlspecialchars_decode($site_name . ' support')]);
            ...
        }

But installing my app on production server I got error:

 php artisan config:cache
In Connection.php line 664:                                                                                                                                                                           
  SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select * from information_schema.tables where table_schema = Votes and table_name = vt_settings)  

Looks like hasTable( checks is not enough at some cases... Are there some other checks for this case.? If to comment all block with hasTable( above I have no this error...

Thanks!

27 Feb
3 weeks ago

PetroGromovo started a new conversation How Correctly To Replace Auth Module With Passport ?

Hello, In my laravel 5.7 app I use Auth module for Authentication, with a lot of definitions in my routes/web.php :

<?php
Auth::routes();
Route::feeds(); //  https://github.com/spatie/laravel-feed

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

Route::post('logged-user', [ //logged-user
        'as'   => 'logged-user',
        'uses' => '[email protected]_logged_user']
);


Route::group(['middleware' => [ 'auth']], function(){
    Route::get('/user', '[email protected]');
    Route::post('/user', '[email protected]');
    Route::post('/page', '[email protected]');
});

Route::get('/auth/{provider}', 'Auth\[email protected]');
Route::get('/auth/{provider}/callback', 'Auth\[email protected]');

$router->get('forgot-password', 'Auth\[email protected]')->name('forgot-password');
$router->post('password/reset/{token}', 'Auth\[email protected]'); // password.request

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

Now I need to install and use https://laravel.com/docs/5.7/passport and remove auth.

Which steps have I to take?

Thanks!

26 Feb
3 weeks ago

PetroGromovo started a new conversation Problems With Subscribing/unsubscribing To List Of Mailchimp

Hello, In my laravel 5.7 app I try to subscribe/unsubscribe to list of mailchimp using https://github.com/spatie/laravel-newsletter

It works and I see subscribed user under mailchimp list. But testing my app when I delete them on “Unsubscribe people” page and this function works ok

But retuning to the page of all Subscribers of my list I see that all users has “Unsubscribed” status, but they are still in my listing: https://prnt.sc/mq7835

and when testing in my app I run subscribe function again, it does not work. I suppoose as it is in listing with “Unsubscribed” status. Have I to take some more steps to delete these users from my list ?

Thanks!

21 Feb
3 weeks ago

PetroGromovo started a new conversation Can Spatie/laravel-newsletter Plugin Be Used For Tasks Like Confirmation Of Registered User, Forget Password Etc ?

Hello, In my laravel 5.7 app I need to make integration with mailchimp, for tasks like subscribing of registered users to newsletters of the site

Googling I found this https://github.com/spatie/laravel-newsletter plugin and it seems good for this purpose, but before subscribing I need to send email for more common, tasks like confirmation of registered user, forget password etc... Is it plugin sutable for such tasks?

In my prior expierence I used snowfire/beautymail plugin when templated were located under “views” directory and I sent my variables to this view.

But snowfire/beautymail seems absolute now and I wonder if I can use mailchimp for such tasks with spatie/laravel-newsletter plugin or some other tools ?

Thanks!

14 Feb
1 month ago

PetroGromovo left a reply on How To Set Button At Right Top Of The Page

@SERGIU17 - I needed left side menu for my app and googling found similar implementation. Looks like it is really not good as I encounter some problems with this menu... Can you advice some example of left side menu compatible with jQuery 3 / Bootstrap 4.1 ? Thanks!

PetroGromovo started a new conversation How To Set Button At Right Top Of The Page

Hi all, In my jQuery v3.3.1 / Bootstrap v4.1.2 application I try to add button at right top of the page over the data listing and search area.

with code :

        <section class="card-body content_block_admin_clients_wrapper ">

            <h1 class="card-title">Manage Clients</h1>

            <div class="row float-right mr-3">
                <button type="button" onclick="javascript:document.location='{{ url('/admin/clients/create') }}'" class="btn btn-primary ">
                    <span class="btn-label"><i class="fa fa-plus fa-submit-button"></i></span>&nbsp;I need button here
                </button>&nbsp;&nbsp;
            </div>

            <div class="row ">

                <div class="col-xs-12 col-sm-6 mb-3">
                    {!! $viewFuncs->text('filter_name', '', "form-control editable_field string_input ", [ "autocomplete"=>"off", 'placeholder'=> 'Enter search string' ]  ) !!}
                </div>

                <div class="col-xs-12 col-sm-6 mb-3 mt-1 pl-2">
                    <input type="submit" class="btn btn-primary" value="Search" onclick="javascript:backendClient.runSearch(oTable); return false;" id="btn_run_search">
                </div>
                
                <div class="table-responsive">
                    <table class="table table-bordered table-striped text-primary" id="get-client-dt-listing-table">

I have the button, but I need over search area and without gap at right of the right of he data grid.

Please open http://demo2.nilov-sergey-demo-apps.tk/admin/clients It is under credentials [email protected] 111111

How to fix it and set “I need button here” button properly?

Thanks!