MaverickChan

Experience

77,150

35 Best Reply Awards

  • Member Since 2 Years Ago
  • 514 Lessons Completed
  • 0 Favorites

18th October, 2018

MaverickChan left a reply on Brew Update, Now Nothing Works • 3 days ago

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

mostly , you didn't install php right.

16th October, 2018

MaverickChan left a reply on Vim And Vue • 4 days ago

don't torture yourself , try another

MaverickChan left a reply on Vue Crud • 5 days ago

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

15th October, 2018

MaverickChan left a reply on Fetch Post JSON Error • 5 days ago

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

MaverickChan left a reply on Laravel Update Record With AJAX • 6 days ago

show your form html.'

and , request type should be patch or put

2nd October, 2018

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

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 • 2 weeks ago

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

30th September, 2018

MaverickChan left a reply on Displaying V-model Value • 3 weeks ago

@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 • 3 weeks ago

@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 • 3 weeks ago

@nhayder show me the whole vue error message from console

MaverickChan left a reply on Displaying V-model Value • 3 weeks ago

change

:value="option.id"

value needs to be a string or integer

29th September, 2018

MaverickChan left a reply on Would This Make Laracasts Forum Better? • 3 weeks ago

history is great .....

MaverickChan left a reply on [Vue Warn]: Cannot Find Element: #app • 3 weeks ago

i didn't see any of your component part

MaverickChan left a reply on [Vue Warn]: Cannot Find Element: #app • 3 weeks ago


<div id="app">

    @yield('content')

</div>

MaverickChan left a reply on [Vue Warn]: Cannot Find Element: #app • 3 weeks ago

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? • 3 weeks ago

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

27th September, 2018

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

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 • 3 weeks ago

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 • 3 weeks ago

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 • 3 weeks ago

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

MaverickChan left a reply on Can't Pass Array To Vue. • 3 weeks ago

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 • 3 weeks ago

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.

26th September, 2018

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

        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) • 3 weeks ago

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 • 3 weeks ago

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) • 3 weeks ago

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) • 3 weeks ago

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

25th September, 2018

MaverickChan left a reply on Route PUT Returns 500 (internal Server Error) • 3 weeks ago

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.

23rd September, 2018

MaverickChan left a reply on Ajax Form Vs Regular Form? • 3 weeks ago

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? • 3 weeks ago

yes , browser support.

MaverickChan left a reply on Chartjs Video Lessaons With Relative Docs • 4 weeks ago

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 .

22nd September, 2018

MaverickChan left a reply on Saving Form Data • 4 weeks ago

you need to save ....

$officelocation->save();

before the last if

20th September, 2018

MaverickChan left a reply on Show Results Where Boolean Is Equal To • 1 month ago

Client::where('disabled_client', '0')->firstOrFail()->id;

18th September, 2018

MaverickChan left a reply on Npm Run Watch • 1 month ago

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.

17th September, 2018

MaverickChan left a reply on Execute Php Script With Axios • 1 month ago

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?

11th September, 2018

MaverickChan left a reply on How Can I Pass The Id In Ajax Url • 1 month ago

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

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

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

10th September, 2018

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

suggest you use Moment.js, just import moment to your vue component

8th September, 2018

MaverickChan left a reply on Hi, I Am New Here And I Decided To Work With Laravel :-) • 1 month ago

trust us , laravel is the best

6th September, 2018

MaverickChan left a reply on Route Not Found • 1 month ago

put a slash / before games

4th September, 2018

MaverickChan left a reply on 5.7 Requiring Ext-mcrypt • 1 month ago

laravel 5.7 requires php7.2 , you need to install php7.2

what system are you using ?windows ? mac ? linux?

actually it is not that hard.

MaverickChan left a reply on Templates Should Only Be Responsible For Mapping The State To The UI. • 1 month ago

it is 404 , because you add an additional coma at the end of the link. You can click to test.

3rd September, 2018

MaverickChan left a reply on Problem With Vhosts • 1 month ago

you need to enable the vhosts mods first in httpd.conf file.

remove the # before Inlclue .../httpd- vhosts.conf

inside this httpd-vhosts.conf file , do as @NOMGUY said.

MaverickChan left a reply on Templates Should Only Be Responsible For Mapping The State To The UI. • 1 month ago

page not found

and , are you using laravel with Vue?

cos , your code looks like you are using your own css and js files without webpack.

really not sure it's a vue issue.

can you show the whole error message?

MaverickChan left a reply on How To Link An Link To V-on: • 1 month ago

should be

 <a href="'/customer/' + customer.id + '/edit'"></a> 

this is basic javascript rule , better know that

MaverickChan left a reply on How Can I Run Laravel 5.4 (Php Ver 5.6) Project Cloneing Someone, I Am Using Laravel 5.6 (php Ver 7.2)??? • 1 month ago

you will have lot of pain .....

the file structure is very different , for example , 5.4 doesn't have routes folder , its routes.php file do the job.

you have to copy most of the file.

my suggestion is , install another 5.4 project , copy all the files , php7 is not the problem.

MaverickChan left a reply on Problem Loop Json In V-for Vue.js • 1 month ago

this.read , not this.ready

please check your spell or change another name , whatever it is

2nd September, 2018

MaverickChan left a reply on Problem Loop Json In V-for Vue.js • 1 month ago

like i said before , you need to call the method in your mounted.

mounted () {

    this.read()

}

just that line, no other code

MaverickChan left a reply on Problem Loop Json In V-for Vue.js • 1 month ago

show whole code , you are hiding something

1st September, 2018

MaverickChan left a reply on Where In Laravvel With Ajax Not Working • 1 month ago

you did not pass the id right

it should be :

public function read_activity($id)
{
    $school_id = School::findOrFail($id)->id;
    $activities = Activity::with('group', 'cluster')
        ->where('school_id', '=', $school_id)
        ->get();

    return response()->json($activities);
}

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.