MaverickChan

Experience

56,410

32 Best Reply Awards

  • Member Since 1 Year Ago
  • 354 Lessons Completed
  • 0 Favorites

20th October, 2017

MaverickChan left a reply on Array Not Returning Values From Controller With Axios Request • 2 days ago


.then(response => {

    console.log(response.data);

});

19th October, 2017

MaverickChan left a reply on Hide And Show Some Content • 3 days ago

better try vue , much easier

16th October, 2017

MaverickChan left a reply on What's The Scope Of 'this'? Dynamic Form Validation With VueJs • 6 days ago

@Yugi

you know what? i just found you single quote email and password in the user sector, get rid of them.That is why your errors working , but user part is not.

data() {
    return {
        formInputs: {
         emai': '',// email cannot have single quote
         password: '',// so is password
        },
        errors: {
          email: '',
          password: ''
        }
    }
  },

MaverickChan left a reply on What's The Scope Of 'this'? Dynamic Form Validation With VueJs • 1 week ago

you need to use it in java way :

actually you can define email and password directly in the data ;

    email = '',

    password = '',

if you want to do it you way ,

axios.post('/login', user).then(function(response) {

        this.inputForm.email = '';
    this.inputForm.password = '';   

        };

        this.errors.email = '';
        this.errors.password =  '';
        };

      }, function (error) {
        errors.email = error.response.data.errors.email[0];
      });

the truth is , because it is a java Json request , the php side would return a json form data instead of redirect , you have to do it in vue.

for example , if the controller return a data called 'loggedIN', then in java , you need to check it .

if true , then window.location = 'your landing page url';'

if false , display some error data .

15th October, 2017

MaverickChan left a reply on How To Print The Value In Vue JS? • 1 week ago

@abhishek009 yes you can .

like :


<button class="btn btn-info" :data-clipboard-text="'http://www.url.com/id/' + data.id"

MaverickChan left a reply on How To Print The Value In Vue JS? • 1 week ago

you need to pass as a prop

14th October, 2017

MaverickChan left a reply on Sending Data To Component • 1 week ago

MaverickChan left a reply on Sending Data To Component • 1 week ago

maybe

 <dynamic-form :form-values="formItemsList"></dynamic-form>

or

use single quote

props : ['formValues;],

MaverickChan left a reply on To See Laravel Mix Succesfull Message • 1 week ago

will not appear PC.

13th October, 2017

MaverickChan left a reply on Fresh Install Error: "No Application Encryption Key Has Been Specified," • 1 week ago

check your php environment .

8th October, 2017

MaverickChan left a reply on When Using Vue , Blank Page (?) • 2 weeks ago

change v-if to v-show

MaverickChan left a reply on Npm Run Watch Error, Not Working In Laravel • 2 weeks ago

run npm install

then npm run watch

2 steps

and can you show some npm -v and node -v info?

5th October, 2017

MaverickChan left a reply on Npm Issue In Laravel • 2 weeks ago

you don't have to sudo , maybe that's why the modules not loading.

MaverickChan left a reply on Npm Issue In Laravel • 2 weeks ago

did you run npm install first?

3rd October, 2017

MaverickChan left a reply on Using JS And CSS In A Laravel Package • 2 weeks ago

read the doc

<script src=" {{ asset('js/app.js') }} "></script>

if you want to use special js files , there is another way , and , it's all in the docs

MaverickChan left a reply on Trying To Get Property Of Non-object • 2 weeks ago

@tinaye , this is a trap i fell in before , latest() returns a collection cannot eager loading anything . My solution is create a help function in your model called path(), or , create a attribute append to the model, if you only need the id of channel .

 public function path ()

    {

        return '/threads/'.$this->channel->slug.'/'.$this->id;

    }

then quote $thread->path() in your blade file

MaverickChan left a reply on Trying To Get Property Of Non-object • 2 weeks ago

@tinaye please show some controller and model

MaverickChan left a reply on Trying To Get Property Of Non-object • 2 weeks ago

dd would die and dump at the point of first record.

i am pretty sure you have some record has not been assigned to a channel.

check the database first.

1st October, 2017

MaverickChan left a reply on Fresh Install Mac OS High Sierra And Local Dev Sites Not Loading - Help! • 3 weeks ago

how did you install php7 ? did you use brew ?

if so , after install , run

brew unlink httpd24

MaverickChan left a reply on Ajax Post Request Returns 404 • 3 weeks ago


headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }


27th September, 2017

MaverickChan left a reply on How To Get Current Dropzone Selector • 3 weeks ago

you cannot do this .

one div , one script.

24th September, 2017

MaverickChan left a reply on Array Automatically Changed To Object After Deletion • 4 weeks ago

:data = "{{ $products }}"

add a : before data.

20th September, 2017

MaverickChan left a reply on Install Laravel 5.5 • 1 month ago

php version? 1.7.8?

MaverickChan left a reply on Learning Laravel • 1 month ago

no , basic sql would be good

18th September, 2017

MaverickChan left a reply on 5.5 With NPM Issues , Could Not Install Dependencies • 1 month ago

@sutherland yeah , that is the key! On that thread , "we are F**KED" is most popular word.....

MaverickChan left a reply on 5.5 With NPM Issues , Could Not Install Dependencies • 1 month ago

@sutherland after fresh install , run npm install

these error would appear :

npm ERR! path /Library/WebServer/Documents/sitetest/node_modules/js-beautify/js/bin/css-beautify.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/Library/WebServer/Documents/sitetest/node_modules/js-beautify/js/bin/css-beautify.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

and files and folders missing in node_modules.

MaverickChan started a new conversation 5.5 With NPM Issues , Could Not Install Dependencies • 1 month ago

i tried 2 Mac machines , php version 7.0 , npm version 5.4.2

composer has been updated , so is Laravel installer.

after install a new 5.5.4 laravel project , when i run npm install , some error appears , then it stop installing dependencies.

i tried copying node_modules folder from a 5.4 project , and it is working . but when i run update , it gives error message again . and also it delete the dependencies installed.

it is really strange.

then i tried a 5.4 project , same error happened. is that something wrong with composer update?

17th September, 2017

MaverickChan left a reply on Form • 1 month ago

did you import jquery first?

var $ = require('jquery');

before export default

then you can use jquery as before

14th September, 2017

MaverickChan left a reply on Cannot Get And Set Datepicker In Input Field With V-model • 1 month ago

datetimepicker require jquery, you need to import jquery first

var $ = require('jquery');

before export default , then you can use jquery methods like old time

and , i suggest you use element-ui , a vue based ui system , it will meet all your need.

10th September, 2017

MaverickChan left a reply on Can't Install PHP7?? • 1 month ago

@kims if you are using a Mac , try unlink php5 .

7th September, 2017

MaverickChan left a reply on Blade View Not Found • 1 month ago

did you yield('content') in your app.blade.php

5th September, 2017

MaverickChan left a reply on Vue SubmitButton Component - Form Does Not Submit • 1 month ago

@click.prevent = "isError"

isError must be a data declared , default true. once clicked let it be false .

declare another data called isSpinning default = false;

if (!isError){

    this.isSpinning = true;

}

MaverickChan left a reply on Vue Carousel - Setting Icons As Navigation Buttons • 1 month ago

@Leff7 oh , sorry ,

maybe you could assign 2 properties

a = "keyboard_arrow_right"

b="keyboard_arrow_left"

but , in my opinion , you need to rewrite the left right button in Vue way

MaverickChan left a reply on Vue Carousel - Setting Icons As Navigation Buttons • 1 month ago

<img v-if="testimonial.image" :src="testimonial.image.data.path + '?rand=' + new Date()" class="is-96x96">

try this , maybe

MaverickChan left a reply on Axios Response Return The Whole Html Rather Than Data • 1 month ago

 public function ajaxcall()
    {
        $posts=Post::all();
        return $posts;
    }

this will return only the posts , not the entire view file.

the previous function would return a view file , a whole blade file.....

MaverickChan left a reply on How Can I Assigning Null Value For Pots_id Value Using If Else Statement • 1 month ago

the logic should not be that complicated .

in your database design , add default value null to post_id.

when something meet true , then let the post_id = $id.

it can save you a lot of lines of code.

and , in if else statement , make it simple , or you will be crazy

MaverickChan left a reply on Axios Response Return The Whole Html Rather Than Data • 1 month ago

create another function for ajax call , return only the $posts instead of the view.

4th September, 2017

MaverickChan left a reply on 127.0.53.53 When Pining Laravel Project !!! • 1 month ago

chrome issue , not other browsers

31st August, 2017

MaverickChan left a reply on Ajax Not Calling Controller Function. • 1 month ago

come on , pal , you cannot use the code i gave you

you need to adjust it with your data .

i understand you might be new to laravel and js , but , please show me YOUR code , not mine.

MaverickChan left a reply on Ajax Not Calling Controller Function. • 1 month ago

@muazzamazaz you did NOT pass the data to controller.

where is your data ?

show me your full code.

MaverickChan left a reply on Npm Run Watch Ignoring Styles In *.vue Components. • 1 month ago

if you are using chrome , it happens .

just force refresh the browser , you will see the changes immediately

MaverickChan left a reply on Ajax Not Calling Controller Function. • 1 month ago

@muazzamazaz

ajax call does not accept delete method , you need to pass a _method variable .


$.ajax({
                    type:   'POST',
                    url:    url,
                    data:   {
                                data : data,
                                _method :"DELETE"
                            },

                    success : function(data){
                        console.log('ok');
                        
                    },
                    error: function (data) {
        //
}
                });

30th August, 2017

MaverickChan left a reply on Controller Don't Return View After AJAX Post • 1 month ago

show some controller codes please

1st August, 2017

MaverickChan left a reply on Vue Do Not "interpret" Javascript • 2 months ago

@realtebo my point is , if you wanna use variables in img tag , just put a : before src will do the trick

<img :src="{{ something }}">

29th July, 2017

MaverickChan left a reply on Image Src Won't Update • 2 months ago

if you are using chrome , that is chrome's cache bug.

you can add some sort of unique number at the end of your href

such as :

<img :src="your.vue.data + '?' + Math.Random()">

or , someone says , use src and srcset together

17th July, 2017

MaverickChan left a reply on GET Http://localhost:8000/undefined 404 (Not Found) Laravel DropzoneJs • 3 months ago

$location = public_path('gallery/images/' . $filename);

            $file->move($location);

and also , please show some of your view file , the dropzone javascript part.

MaverickChan left a reply on Need To Sort Prodcut By Price ASC And DESC • 3 months ago

you are making things complicated.

one function should only do one thing a time.

you can pass normal data to view files , then in view file , use ajax call to do sorting or anything else.

for those ajax calls , make backend functions , saprately.

MaverickChan left a reply on Need To Sort Prodcut By Price ASC And DESC • 3 months ago

Product::all()->orderBy('price','desc')->get();

asc is the same.

i would use vue.js to add a toggle button.

MaverickChan left a reply on GET Http://localhost:8000/undefined 404 (Not Found) Laravel DropzoneJs • 3 months ago

where is your function name in your controller?

14th July, 2017

MaverickChan left a reply on How To Use DiffForHumans() In Vue • 3 months ago

import a new package called Moment.js in your npm

then in Vue component , you can make method or a computed property

then it will render like cabon did

Edit Your Profile
Update

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