MaverickChan

MaverickChan

Member Since 2 Years Ago

Experience Points 81,070
Experience
Level
Lessons Completed 550
Lessons
Completed
Best Reply Awards 35
Best Answer
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.

10 Nov
2 months ago

MaverickChan left a reply on Installing PHP 7.2 Extensions On Mac?

@THEBIGK - remove some lines in your php.ini such like

extension=mbstring

because you don't need those in php 7.2 , if you write these , php will think you are trying to use customized lib.

BTW , what is your php version before updated to 7.2?

09 Nov
2 months ago

MaverickChan left a reply on Trying To Use Moment.js

@MARTINBEAN - yeah , copy only takes you 1 sec.

Level 50 means nothing.

you DID COPY MY REPLY , this thread , that is a fact.

MaverickChan left a reply on Love The New Interface

@MARTINBEAN - Really? You copied again? OMG, you should see a doc

MaverickChan left a reply on Trying To Use Moment.js

@MARTINBEAN - right , good excuse , please write your OWN reply next time , don't touch others'

MaverickChan left a reply on Trying To Use Moment.js

@martinbean Are you copying my reply????

where does your this.givenDate come from? Not declared in your code , this is NOT cool , man!

MaverickChan left a reply on Trying To Use Moment.js

use computed property , because moment returns a object , you only need some string format.

try this :

<template>
    <div>
        {{ yourYear  }}
    </div>
</template>

<script>

const moment = require('moment')

props: {
    initial : {
        type: Object,
        default: moment
    },          
},

created () {
    this.givenDate = this.initial
},

computed: {
    yourYear () {
        return moment(this.givenDate).format('YYYY')
    }
}
</script>

Then you can give moment any time you want , let moment do the job.

07 Nov
2 months ago

MaverickChan left a reply on Troubleshoot Mojave

@X-MAC - check the 80 port , could be used by another httpd session

MaverickChan started a new conversation Love The New Interface

nice theme , i love it .

but , course percentage display is missing , and new thread cannot autocomplete at users now

06 Nov
2 months ago

MaverickChan left a reply on Troubleshoot Mojave

check which php first

then if not working , brew reinstall php , should work.

31 Oct
2 months ago

MaverickChan left a reply on Upload File With Form

please use normal form , make it easy and readable .

29 Oct
2 months ago

MaverickChan left a reply on Login Route Redirecting To Image!?!

my guess is browser cache problem.

try these steps :

  1. php artisan cache:clear

  2. php artisan view:clear

  3. make a hard refresh of your browser

24 Oct
2 months ago

MaverickChan left a reply on Where Is A Beginners Tutorial For Scopes?

this guy's tutorial is really inspiring , he use query scope as a trait within the model .

YouTube Video of Query Scope

Hope you can learn something.

MaverickChan left a reply on Calendar Package

actually , you can make your own calendar , it is not that hard , only takes you about 200 lines code ,top, including the html. PHP has datetime function could do all the work for you , all you need to do is display it.

18 Oct
2 months ago

MaverickChan left a reply on Brew Update, Now Nothing Works

run php -v in your console , what does it show?

mostly , you didn't install php right.

16 Oct
3 months ago

MaverickChan left a reply on Vim And Vue

don't torture yourself , try another

MaverickChan left a reply on Vue Crud

vue2 lessons are pretty enough for crud use....

15 Oct
3 months ago

MaverickChan left a reply on Fetch Post JSON Error

why don't you use axios to do the ajax calls?

MaverickChan left a reply on Laravel Update Record With AJAX

show your form html.'

and , request type should be patch or put

02 Oct
3 months ago

MaverickChan left a reply on Laravel App Working Fine On Live Server, But Not On Localhost

what is your local environment ? php artisan serve or using other server?

MaverickChan left a reply on Laravel App Working Fine On Live Server, But Not On Localhost

clear chrome cache . use another browser to test if it is ok. re-compile your js and sass files

30 Sep
3 months ago

MaverickChan left a reply on Displaying V-model Value

@tykus ok , my thought is , he should not assign any value to user.tasks first , leave it blank , then make a method , when select on change trigger that method to assign that value to tasks.

MaverickChan left a reply on Displaying V-model Value

@tykus i think he had a html mistake , you are right , a value could be an array;

@jstanotheract try this:

<select class="form-control" v-model="option">
    <option disabled hidden selected value="">* Please Select an Option</option>
                                
    <option v-for="option in options"  :value="option.id">
                                    
        {{ option.name }}

    </option>

</select>

and , you can get rid of user.task in data , you don't need it , because option 3 is the same , you can default option 3 in select part.

MaverickChan left a reply on [Vue Warn]: Cannot Find Element: #app

@nhayder show me the whole vue error message from console

MaverickChan left a reply on Displaying V-model Value

change

:value="option.id"

value needs to be a string or integer

29 Sep
3 months ago

MaverickChan left a reply on Would This Make Laracasts Forum Better?

history is great .....

MaverickChan left a reply on [Vue Warn]: Cannot Find Element: #app

i didn't see any of your component part

MaverickChan left a reply on [Vue Warn]: Cannot Find Element: #app


<div id="app">

    @yield('content')

</div>

MaverickChan left a reply on [Vue Warn]: Cannot Find Element: #app

1.change de section id to another name;

2, wrap your content in a div which id=app.

MaverickChan left a reply on How To Make Moment Js Alive?

it is nothing to do with moment.js.

your problem is about retrieve data every 10 seconds , because you need the last activity 's time , which is not sure.

in your methods , use setInterval , then in created() , put that method , your td content will be automatically renewed

27 Sep
3 months ago

MaverickChan left a reply on Building Tiny Text Editor With Vue? VUE Expert Advice Needed

using vue is a easy way to manipulate data and functions , in fact , a wysiwyg editor is a html thing or plus little js.

this is what i do , you can change it .

<template>

    <div class="mx-5 my-3">
        
        <div v-for="(item, index) in commands" :key="index" class="btn-group" :class="{ 'border-right':borderRight(index)}">

            <button type="button" class="btn btn-sm btn-outline-secondary border-0 rounded-0" data-toggle="tooltip" data-placement="bottom" :title="item.title" @click="exec(item.command)">

                <i :class="'fa ' + item.icon"></i>

            </button>           

        </div>




        <div class="editor border mt-2" id="editor" contenteditable="true" @mouseup="getCurrentTagName">
            


        </div>

        <div class="mt-3">
            
            <button class="btn btn-outline-secondary rounded-0 border" @click="clear">Clear</button>

        </div>

    </div>


</template>

<script>



export default {

    name: 'wysiwyg',

    mounted () {

        $(function () {

            $('[data-toggle="tooltip"]').tooltip()

        })

    },

    data () {

        return {

            commands : [

                { name: 'Bold', title: 'Bold', command: 'bold', icon: 'fa-bold' },

                { name: 'Italic', title: 'Italic', command: 'italic', icon: 'fa-italic' },

                { name: 'StrikeThrough', title: 'Strike Through', command: 'strikeThrough', icon: 'fa-strikethrough' },

                { name: 'Underline', title: 'Underline', command: 'underline', icon: 'fa-underline' },

                { name: 'HorizontalLine', title: 'Horizontal Line', command: 'insertHorizontalRule', icon: 'fa-minus' },

                { name: 'AlignLeft', title: 'Align Left', command: 'justifyLeft', icon: 'fa-align-left' },

                { name: 'AlignJustify', title: 'Align Justify', command: 'justifyFull', icon: 'fa-align-justify' },

                { name: 'AlignCenter', title: 'Align Center', command: 'justifyCenter', icon: 'fa-align-center' },

                { name: 'AlignRight', title: 'Align Right', command: 'justifyRight', icon: 'fa-align-right' },

                { name: 'FontSize', title: 'Font Size', command: 'fontSize', icon: 'fa-text-height' },

                { name: 'Fonts', title: 'Fonts', command: 'fontName', icon: 'fa-font' },

                { name: 'Heading', title: 'Heading', command: 'header', icon: 'fa-header' },

                { name: 'Paragraph', title: 'Paragraph', command: 'insertParagraph', icon: 'fa-paragraph' },

                { name: 'Undo', title: 'Undo', command: 'undo', icon: 'fa-undo' },

                { name: 'Redo', title: 'Redo', command: 'redo', icon: 'fa-repeat' },

                { name: 'Copy', title: 'Copy', command: 'copy', icon: 'fa-copy' },

                { name: 'Paste', title: 'Paste', command: 'paste', icon: 'fa-paste' },

                { name: 'Cut', title: 'Cut', command: 'cut', icon: 'fa-cut' },

                { name: 'Subscript', title: 'Subscript', command: 'subscript', icon: 'fa-subscript' },

                { name: 'Superscript', title: 'Superscript', command: 'superscript', icon: 'fa-superscript' },

                { name: 'OrderedList', title: 'Ordered List', command: 'insertOrderedList', icon: 'fa-list-ol' },

                { name: 'UnorderdList', title: 'Unorderd List', command: 'insertUnorderedList', icon: 'fa-list-ul' },

                { name: 'Link', title: 'Link', command: 'createLink', icon: 'fa-link' },

                { name: 'Unlink', title: 'Unlink', command: 'unlink', icon: 'fa-unlink' },

                { name: 'Video', title: 'Video', command: 'video', icon: 'fa-video-camera' },

                { name: 'Image', title: 'Image', command: 'insertImage', icon: 'fa-image' },

                { name: 'RemoveFormat', title: 'Remove Format', command: 'removeFormat', icon: 'fa-times' },


            ],

            currentTagName: '',




        }

    },

    watch : {

        currentTagName () {

            this.getCurrentTagName()

        }

    },

    methods : {

        exec (command,arg) {

            document.execCommand(command , false , arg)

        },

        clear () {

            document.getElementById("editor").innerHTML = ''

        },

        borderRight (index) {

            var clubs = [

                5,9,13,15,18,20,22,24,26

            ]

            return !!clubs.includes(index + 1)

        },

        getCurrentTagName () {

            if (window.getSelection().baseNode) {

                this.currentTagName = window.getSelection().baseNode.parentNode.tagName                 

            }

        }

    }

}
</script>

<style lang="scss" scoped>

    .editor {

        min-height: 20em;

        padding: 1em;


    }

    .btn:hover {

        background: lighten(black, 90%);

        color: lighten(black, 10%);

    }

    [contenteditable]:focus {

        outline: none;

    }

    [contenteditable] {

        font-size: 120%;

    }

</style>

MaverickChan left a reply on Building Tiny Text Editor With Vue? VUE Expert Advice Needed

it is very hard . For example

make a div contenteditable , or using the textarea ,building with basic execCommand is easy , you will have bold , italic , and other format going .

but , getting fonts , link , image upload ,insert media ... those will cause tons of lines of code...

you can get some vue components on github.

i used to try to build one , took me a lot of time ....

MaverickChan left a reply on Parse Data In Vue Selector

you can pass creator as a array or object to vue component.

in vue component , use a prop to accept it.

<accordion-item :creator="{{ $creator }}"></accordion-item>

MaverickChan left a reply on Check If Entry Exists

there is a method called firstOrCreate or firstOrNew will do the trick

MaverickChan left a reply on Can't Pass Array To Vue.

don't use words like array , try another , put a :before the word

<my-component :something="$array"></my-component>

in your vue component , define props to accept the value.


props: {

    something: {

        type: Object,

    }

},

MaverickChan left a reply on Fa Icon Support In HTML::link Blade

like @Snapey said , don't use that junk , not clean , not readable .

eg

<a href="{{ url('media/add') }}" class="btn btn-primary">

    ADD MEDIA

    <i class="fa fa-heart"></i>

</a>

you will get a heart on the button.

26 Sep
3 months ago

MaverickChan left a reply on How To Initialize Bootstrap Tooltip In JavaScript Not Jquery In Vue/Nuxt.js?

        created () {

            $(function () {

                $('[data-toggle="tooltip"]').tooltip()

            })

        },
                

this will do the trick , you can use tooltip as normal bootstrap

MaverickChan left a reply on Route PUT Returns 500 (internal Server Error)

if you are trying to use a put method , then there should be some data from retrieved the database in you modal form , i could not find any.

MaverickChan left a reply on Ajax Post To Controller Give Method Not Allowed

you need disable the default form submit action by adding this line of code:

.click(function(e){
    
    e.preventDefault();

    ...

    ...

})

remove the quotation mark.

$.ajax({
        url: "/sist",
        type: "POST",
        data: { 'jid' :jid,
                'domain' :domain,
                'week' :week,
                'kwnum' :kwnum,
              },
        DataType: 'JSON',
        success: function(){
            $('#spinner').show();
        }
        //complete:function(){
            //$('#spinner').hide(),
        //}
    });

and , add csrf header as @aurawindsurfing says , correct the url as @tykus says as well

MaverickChan left a reply on Route PUT Returns 500 (internal Server Error)

show us your html form , and what version laravel are you using ? because diffirence token names

MaverickChan left a reply on Route PUT Returns 500 (internal Server Error)

maybe , put var before id and book_no , you need to delare the variables .

25 Sep
3 months ago

MaverickChan left a reply on Route PUT Returns 500 (internal Server Error)

no message means you never sent any data to the server but ask the server to do a put request.

check your html , i think there are some errors there , and also the jquery part.

23 Sep
3 months ago

MaverickChan left a reply on Ajax Form Vs Regular Form?

sorry , i'm afraid i can't answer that because i don't have any experience of mobile develop.

MaverickChan left a reply on Ajax Form Vs Regular Form?

yes , browser support.

MaverickChan left a reply on Chartjs Video Lessaons With Relative Docs

i would suggest you learn some Vue.js 2 lessons first , chart.js is not that hard , combining these two would be little tricky for starters .But the idea is very much same , using vue to retrieve data dynamically from the server , then pass data to a independent vue component which has a chartjs function , then display it .

22 Sep
3 months ago

MaverickChan left a reply on Saving Form Data

you need to save ....

$officelocation->save();

before the last if

20 Sep
3 months ago

MaverickChan left a reply on Show Results Where Boolean Is Equal To

Client::where('disabled_client', '0')->firstOrFail()->id;
18 Sep
3 months ago

MaverickChan left a reply on Npm Run Watch

how did you install node.js? don't use apt , download directly from the website , and , there are still some issues on ubuntu , luckily , most could be found on google.

17 Sep
3 months ago

MaverickChan left a reply on Execute Php Script With Axios

if you are using a php framework like laravel , you need to give a uri or route url , instead of a php filename .

can you execute the php file directly from php server side?

11 Sep
4 months ago

MaverickChan left a reply on How Can I Pass The Id In Ajax Url

url: 'delete_hub' + {{ id }},

MaverickChan left a reply on Displaying Time From Database Query In Vue Without The Seconds.

tried Moment.js ?how ?please show me your code with moment