dippy

dippy

Member Since 1 Year Ago

Experience Points 810
Experience Level 1

4,190 experience to go until the next level!

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

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

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

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

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

25 Jun
3 weeks ago

dippy started a new conversation Names With Special Fonts Saved As Empty Value

I observed that a few values of field 'name' aren't getting saved in mysql table and the values are as follows. What should be done to save these values? I tried to insert using tsql and names were saved but with eloquent its saving empty value.

?????? ??????

???????

? ? ? ? ? ?

21 Jun
4 weeks ago

dippy started a new conversation Best Practice To Implement Code Revision

What is the best practice to update a laravel project after initial deployment to production environment. My development server is Windows but staging/production is on Linux. Code revisions are implemented by first uploading files through FTP on stating environment and then pushing from there to production environment. What are other possibilities.

01 Jun
1 month ago

dippy started a new conversation Disable Updated_at For A Job

I am using a job to update a table conditionally. I don't want to get updated_at column changed every time the job runs. I'm aware of how to disable it on model. But I just want to prevent it on the job. How can I do this?

30 May
1 month ago

dippy left a reply on Code Corruption

Its on my local computer and only accessed by me. I have blocked the ports with firewall and also scanned it with anti-virus software but no threat was detected. I think it will have to get formatted once. I had this doubt in mind but still wanted to make sure.

dippy left a reply on Code Corruption

One more blade which had a form to enter a new record shows something me like this.

https://drive.google.com/file/d/1sIPXxtJGswWhBlZOTPQWhegm1rqiNTZW/view?usp=sharing

dippy left a reply on Code Corruption

The code which I have shared here isn't the actual code, Its some code that I've never used anywhere in my project. This file has been modified but I don't know how.

I also found one more blade file that had a bootstrap table showing list of users but now it shows contents like this

on\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #59 D:\inetpub\vhosts imit\websites\app.leadzpipe.com\local\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #60 D:\inetpub\vhosts imit\websites\app.leadzpipe.com\local\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #61 D:\inetpub\vhosts imit\websites\app.leadzpipe.com\local\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #62 D:\inetpub\vhosts imit\websites\app.leadzpipe.com\local\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #63 D:\inetpub\vhosts imit\websites\app.leadzpipe.com\local\public\index.php(55): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #64 {main} "}

29 May
1 month ago

dippy started a new conversation Code Corruption

Hi

I often face problem of my laravel project files getting corrupted. Like today I saw a few blade files and found content which was not my actual code.

This has happened several times earlier. It also happened with Controllers and some static files as well.


/*!
 * Ladda
 * http://lab.hakim.se/ladda
 * MIT licensed
 *
 * Copyright (C) 2014 Hakim El Hattab, http://hakim.se
 */
/* jshint node:true, browser:true */
(function( root, factory ) {
// CommonJS
if( typeof exports === 'object' )  {
    module.exports = factory(require('spin.js'));
}
// AMD module
else if( typeof define === 'function' && define.amd ) {
    define( [ 'spin' ], factory );
}
// Browser global
else {
    root.Ladda = factory( root.Spinner );
}

} (this, function( Spinner ) { 'use strict';

// All currently instantiated instances of Ladda
var ALL_INSTANCES = [];

/**
 * Creates a new instance of Ladda which wraps the
 * target button element.
 *
 * @return An API object that can be used to control
 * the loading animation state.
 */
function create( button ) {

    if( typeof button === 'undefined' ) {
        console.warn( "Ladda button target must be defined." );
        return;
    }

    // The text contents must be wrapped in a ladda-label
    // element, create one if it doesn't already exist
    if( !button.querySelector( '.ladda-label' ) ) {
        button.innerHTML = '<span class="ladda-label">'+ button.innerHTML +'</span>';
    }

    // The spinner component
    var spinner;

    // Wrapper element for the spinner
    var spinnerWrapper = document.createElement( 'span' );
    spinnerWrapper.className = 'ladda-spinner';
    button.appendChild( spinnerWrapper );

    // Timer used to delay starting/stopping
    var timer;

    var instance = {

        /**
         * Enter the loading state.
         */
        start: function() {

            // Create the spinner if it doesn't already exist
            if( !spinner ) spinner = createSpinner( button );

            button.setAttribute( 'disabled', '' );
            button.setAttribute( 'data-loading', '' );

            clearTimeout( timer );
            spinner.spin( spinnerWrapper );

            this.setProgress( 0 );

            return this; // chain

        },

        /**
         * Enter the loading state, after a delay.
         */
        startAfter: function( delay ) {

            clearTimeout( timer );
            timer = setTimeout( function() { instance.start(); }, delay );

            return this; // chain

        },

        /**
         * Exit the loading state.
         */
        stop: function() {

            button.removeAttribute( 'disabled' );
            button.removeAttribute( 'data-loading' );

            // Kill the animation after a delay to make sure it
            // runs for the duration of the button transition
            clearTimeout( timer );

            if( spinner ) {
                timer = setTimeout( function() { spinner.stop(); }, 1000 );
            }

            return this; // chain

        },

        /**
         * Toggle the loading state on/off.
         */
        toggle: function() {

            if( this.isLoading() ) {
                this.stop();
            }
            else {
                this.start();
            }

            return this; // chain

        },

        /**
         * Sets the width of the visual progress bar inside of
         * this Ladda button
         *
         * @param {Number} progress in the range of 0-1
         */
        setProgress: function( progress ) {

            // Cap it
            progress = Math.max( Math.min( progress, 1 ), 0 );

            var progressElement = button.querySelector( '.ladda-progress' );

            // Remove the progress bar if we're at 0 progress
            if( progress === 0 && progressElement && progressElement.parentNode ) {
                progressElement.parentNode.removeChild( progressElement );
            }
            else {
                if( !progressElement ) {
                    progressElement = document.createElement( 'div' );
                    progressElement.className = 'ladda-progress';
                    button.appendChild( progressElement );
                }

                progressElement.style.width = ( ( progress || 0 ) * button.offsetWidth ) + 'px';
            }

        },

        enable: function() {

            this.stop();

            return this; // chain

        },

        disable: function () {

            this.stop();
            button.setAttribute( 'disabled', '' );

            return this; // chain

        },

        isLoading: function() {

            return button.hasAttribute( 'data-loading' );

        },

        remove: function() {

            clearTimeout( timer );

            button.removeAttribute( 'disabled', '' );
            button.removeAttribute( 'data-loading', '' );

            if( spinner ) {
                spinner.stop();
                spinner = null;
            }

            for( var i = 0, len = ALL_INSTANCES.length; i < len; i++ ) {
                if( instance === ALL_INSTANCES[i] ) {
                    ALL_INSTANCES.splice( i, 1 );
                    break;
                }
            }

        }

    };

    ALL_INSTANCES.push( instance );

    return instance;

}

/**
* Get the first ancestor node from an element, having a
* certain type.
*
* @param elem An HTML element
* @param type an HTML tag type (uppercased)
*
* @return An HTML element
*/
function getAncestorOfTagType( elem, type ) {

    while ( elem.parentNode && elem.tagName !== type ) {
        elem = elem.parentNode;
    }

    return ( type === elem.tagName ) ? elem : undefined;

}

/**
 * Returns a list of all inputs in the given form that
 * have their `required` attribute set.
 *
 * @param form The from HTML element to look in
 *
 * @return A list of elements
 */
function getRequiredFields( form ) {

    var requirables = [ 'input', 'textarea' ];
    var inputs = [];

    for( var i = 0; i < requirables.length; i++ ) {
        var candidates = form.getElementsByTagName( requirables[i] );
        for( var j = 0; j < candidates.length; j++ ) {
            if ( candidates[j].hasAttribute( 'required' ) ) {
                inputs.push( candidates[j] );
            }
        }
    }

    return inputs;

}


/**
 * Binds the target buttons to automatically enter the
 * loading state when clicked.
 *
 * @param target Either an HTML element or a CSS selector.
 * @param options
 *          - timeout Number of milliseconds to wait before
 *            automatically cancelling the animation.
 */
function bind( target, options ) {

    options = options || {};

    var targets = [];

    if( typeof target === 'string' ) {
        targets = toArray( document.querySelectorAll( target ) );
    }
    else if( typeof target === 'object' && typeof target.nodeName === 'string' ) {
        targets = [ target ];
    }

    for( var i = 0, len = targets.length; i < len; i++ ) {

        (function() {
            var element = targets[i];

            // Make sure we're working with a DOM element
            if( typeof element.addEventListener === 'function' ) {
                var instance = create( element );
                var timeout = -1;

                element.addEventListener( 'click', function( event ) {

                    // If the button belongs to a form, make sure all the
                    // fields in that form are filled out
                    var valid = true;
                    var form = getAncestorOfTagType( element, 'FORM' );

                    if( typeof form !== 'undefined' ) {
                        var requireds = getRequiredFields( form );
                        for( var i = 0; i < requireds.length; i++ ) {
                            // Alternatively to this trim() check,
                            // we could have use .checkValidity() or .validity.valid
                            if( requireds[i].value.replace( /^\s+|\s+$/g, '' ) === '' ) {
                                valid = false;
                            }
                        }
                    }

                    if( valid ) {
                        // This is asynchronous to avoid an issue where setting
                        // the disabled attribute on the button prevents forms
                        // from submitting
                        instance.startAfter( 1 );

                        // Set a loading timeout if one is specified
                        if( typeof options.timeout === 'number' ) {
                            clearTimeout( timeout );
                            timeout = setTimeout( instance.stop, options.timeout );
                        }

                        // Invoke callbacks
                        if( typeof options.callback === 'function' ) {
                            options.callback.apply( null, [ instance ] );
                        }
                    }

                }, false );
            }
        })();

    }

}

/**
 * Stops ALL current loading animations.
 */
function stopAll() {

    for( var i = 0, len = ALL_INSTANCES.length; i < len; i++ ) {
        ALL_INSTANCES[i].stop();
    }

}

function createSpinner( button ) {

    var height = button.offsetHeight,
        spinnerColor;

    if( height === 0 ) {
        // We may have an element that is not visible so
        // we attempt to get the height in a different way
        height = parseFloat( window.getComputedStyle( button ).height );
    }

    // If the button is tall we can afford some padding
    if( height > 32 ) {
        height *= 0.8;
    }

    // Prefer an explicit height if one is defined
    if( button.hasAttribute( 'data-spinner-size' ) ) {
        height = parseInt( button.getAttribute( 'data-spinner-size' ), 10 );
    }

    // Allow buttons to specify the color of the spinner element
    if( button.hasAttribute( 'data-spinner-color' ) ) {
        spinnerColor = button.getAttribute( 'data-spinner-color' );
    }

    var lines = 12,
        radius = height * 0.2,
        length = radius * 0.6,
        width = radius < 7 ? 2 : 3;

    return new Spinner( {
        color: spinnerColor || '#fff',
        lines: lines,
        radius: radius,
        length: length,
        width: width,
        zIndex: 'auto',
        top: 'auto',
        left: 'auto',
        className: ''
    } );

}

function toArray( nodes ) {

    var a = [];

    for ( var i = 0; i < nodes.length; i++ ) {
        a.push( nodes[ i ] );
    }

    return a;

}

// Public API
return {

    bind: bind,
    create: create,
    stopAll: stopAll

};

})); /* Base16 Atelier Plateau Light - Theme / / by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/plateau) / / Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */

/* Atelier-Plateau Comment */ .hljs-comment { color: #655d5d; }

/* Atelier-Plateau Red */ .hljs-variable, .hljs-attribute, .hljs-tag, .hljs-regexp, .hljs-name, .ruby .hljs-constant, .xml .hljs-tag .hljs-title, .xml .hljs-pi, .xml .hljs-doctype, .html .hljs-doctype, .css .hljs-id, .css .hljs-class, .css .hljs-pseudo { color: #ca4949; }

/* Atelier-Plateau Orange */ .hljs-number, .hljs-preprocessor, .hljs-built_in, .hljs-literal, .hljs-params, .hljs-constant { color: #b45a3c; }

/* Atelier-Plateau Yellow */ .ruby .hljs-class .hljs-title, .css .hljs-rule .hljs-attribute { color: #a06e3b; }

/* Atelier-Plateau Green */ .hljs-string, .hljs-value, .hljs-inheritance, .hljs-header, .ruby .hljs-symbol, .xml .hljs-cdata { color: #4b8b8b; }

/* Atelier-Plateau Aqua */ .hljs-title, .css .hljs-hexcolor { color: #5485b6; }

/* Atelier-Plateau Blue */ .hljs-function, .python .hljs-decorator, .python .hljs-title, .ruby .hljs-function .hljs-title, .ruby .hljs-title .hljs-keyword, .perl .hljs-sub, .javascript .hljs-title, .coffeescript .hljs-title { color: #7272ca; }

/* Atelier-Plateau Purple */ .hljs-keyword, .javascript .hljs-function { color: #8464c4; }

.diff .hljs-deletion, .diff .hljs-addition { display: inline-block; width: 100%; color: #1b1818; }

.diff .hljs-deletion { background-color: #ca4949; }

.diff .hljs-addition { background-color: #4b8b8b; }

.diff .hljs-change { color: #7272ca; }

.hljs { display: block; padding: .5em; overflow-x: auto; color: #585050; -webkit-text-size-adjust: none; background: #f4ecec; }

.coffeescript .javascript, .javascript .xml, .tex .hljs-formula, .xml .javascript, .xml .vbscript, .xml .css, .xml .hljs-cdata { opacity: .5; } }, } },

         socialmedia: {
            validators: {
                notEmpty: {
                    message: 'Required'
                },
            }
        },
        
         googleAds: {
            validators: {
                notEmpty: {
                    message: 'Required'
                },
            }
        },
        
         leadgentools: {
            validators: {
                notEmpty: {
                    message: 'Required'
                },
            }
        },
        
         challenges: {
            validators: {
                notEmpty: {
                    message: 'Required'
                },
            }
        },
        
         mBudget: {
            validators: {
                notEmpty: {
                    message: 'Required'
                },
            }
        },
        
    }
});


$('#photoform').formValidation({
    framework: 'bootstrap',
    button: {
        selector: '#photovalidateButton',
        disabled: 'disabled'
    },
    icon: {
        valid: 'icon md-spellcheck',
        invalid: 'icon md-close',
        validating: 'icon md-refresh-alt'
    },
    fields: {
        profile_photo: {
            validators: {
                notEmpty: {
                    message: 'Please select your photo'
                }                    
            }
        },              
    }
});

});

@stop

@stop

27 Mar
3 months ago

dippy left a reply on Filter Records As Per User's Preferred Timezone

Hi Snapey

Working absolutely fine now. Thanks a lot!

dippy left a reply on Filter Records As Per User's Preferred Timezone

@SNAPEY - It's UTC in config.

All records are saved in UTC in mysql. I display on front as per user's choice (tz).

26 Mar
3 months ago

dippy started a new conversation Filter Records As Per User's Preferred Timezone

I'm looking to develop a filter based on timezone selected by user. All records are stored with dates in UTC. Logically I need to convert the dates passed on filter request in user timezone format and also convert the dates from model to same timezone and compare but not sure how to achieve this.

Done this so far which isn't working.

$start_date_local = Carbon::parse($start_date, $tz)->startOfDay(); $end_date_local = Carbon::parse($end_date, $tz)->endOfDay();

$leads_ds = $leads_ds->whereBetween('created_at',[$start_date_local,$end_date_local]);

04 Jan
6 months ago

dippy left a reply on Laravel Serves Blank Pages Randomly

Thanks realrandyallen

I have implemented the suggested solution on this post. Will observed it.

dippy left a reply on Laravel Serves Blank Pages Randomly

Yes, I just checked. I found bugs not related to the pages that went blank. Browser console didn't give any error. These pages work just fine when I reset IIS.

dippy left a reply on Laravel Serves Blank Pages Randomly

Hi

Any help would be highly appreciated. I'm facing this issue very often now. Its a windows server and I am able to solve this after resetting IIS which makes all other sites go down.

21 Dec
6 months ago

dippy left a reply on Datetime Zone Issue

Thank you all for response. Actually both are working as expected. After some efforts I came to know that there was a mysql trigger which was using local timezone.

19 Dec
7 months ago

dippy left a reply on Datetime Zone Issue

@BURLRESEARCH - I checked config. Its already set to UTC

dippy left a reply on Laravel Serves Blank Pages Randomly

Here is my web.php. I have various controllers and the issue happens with different pages, Sharing my dashboard class.

dippy started a new conversation Datetime Zone Issue

While adding a new record, created_at and updated_at are auto saved with local timezone but with Carbon::now() the timezone is UTC. How can I make both save with UTC.

dippy started a new conversation Laravel Serves Blank Pages Randomly

I'm having a strange issue. I get to see blank pages randomly that otherwise worked fine. My dashboard suddenly went blank yesterday which is working fine now but couple of other pages are gone blank.

20 Nov
8 months ago

dippy left a reply on Email Verification

Thanks a lot Kiruba. Its working now.

19 Nov
8 months ago

dippy left a reply on Email Verification

Yes, its done.

dippy left a reply on Email Verification

Yes, I've modified .env file and config/mail.php as well. Resend verification email is working fine but on registration it does not work

dippy left a reply on Email Verification

Hi Petrit

Thanks for prompt response. I have already modified the routes to use verification. But no email is sent out on registration.

Actually I have put the following code in RegisterController. Do I need to add call to notification that sends out email for verification here?

protected function register(Request $request) {

    $validatedData = $request->validate([
        'name'     => 'required|string|max:255',
    'company_name'     => 'required|string|max:255',
        'email'    => 'required|string|email|max:255|unique:users',         
    'phone_number' => 'required|numeric|unique:users|min:6',
        'password' => 'required|string|min:8|confirmed',
    ]);

    try {
    
        $access_token = bin2hex(random_bytes(64));
        $companyData = ['name' => $request->company_name, 'website' => $request->company_website, 'access_token' =>$access_token];
        $c_id = Company::create($companyData)->id;
        
                $validatedData['password']        = Hash::make(trim(array_get($validatedData, 'password')));                       
        $validatedData['dial_code'] = $request->dial_code;
        $validatedData['country_code'] = $request->country_code;
                $validatedData['salt'] = str_random(10).time();
        $validatedData['c_id'] = $c_id;
        $user                             = app(User::class)->create($validatedData);
        
    } catch (\Exception $exception) {
        logger()->error($exception);
        return redirect()->back()->withErrors('message', 'Unable to create new user.');
    }

    return redirect()->to('signup-success');
}

dippy started a new conversation Email Verification

I have customized login and register controllers as I need to populate few more tables apart from users. But I want to use laravel's email verification feature. How can I use it on custom function.

08 Oct
9 months ago

dippy left a reply on Api To Create Contact

Hi xkrupal2, I have created the api and its working fine on my local environment but when I tested on server, it produced 404 error. It worked fine when I tried it through postman but when I called api from another page, it gave 404.

04 Oct
9 months ago

dippy started a new conversation Api To Create Contact

I need to create an api that allows users to create a contact. How can I use laravel's api authentication to implement develop this api.

03 May
1 year ago

dippy left a reply on Redirection To Https

Thanks for help Vilfago. I'm using windows. I have fixed the issue. I had tried .htaccess rule but it did not work. After some efforts I realized the issue was due to web.config file. Removing it resolved the issue.

30 Apr
1 year ago

dippy started a new conversation Redirection To Https

Hi,

How can I set redirection from http to https for a website. On safer side I want to show user an error message when domain is accessed with http protocol and show the website when https is used. Is this possible?

17 Jan
1 year ago

dippy left a reply on Security Issue

Thanks for responding, bashy and ejdelmonico. Actually there was some confusion. While decompressing the folder, something went wrong and controller files were copied in the folder. I checked the original compressed folder again and it did not find my code files.

16 Jan
1 year ago

dippy started a new conversation Security Issue

Hi I'm new to laravel. I had a strange experience today. I raised a support request to one of the online payment service providers and shared with them the code which wasn't working. They sent me a compressed folder with their custom code along with all of the controller files I had on my website. How did they managed to get all files? I'm using windows server and IIS. I've mapped public folder of laravel project to the website in IIS.