MaverickChan

MaverickChan

Member Since 4 Years Ago

Experience Points
128,290
Total
Experience

1,710 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
846
Lessons
Completed
Best Reply Awards
55
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

Level 26
128,290 XP
Sep
18
1 month ago
Activity icon

Replied to Zsh: Command Not Found: Laravel

Make sure to place Composer's system-wide vendor bin directory in your $PATH so the laravel executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:

macOS: $HOME/.composer/vendor/bin

Activity icon

Replied to Vue V-for Loop Doesnt Always Work

paginate does not return a collection directly , that's why you cannot get the data and , you don't have to declare article outside articles

Sep
07
1 month ago
Activity icon

Replied to CSRF Token Mismatch In Dropzone.js

check your route , delete or post?

Sep
04
1 month ago
Activity icon

Replied to Axios Sends Two Requests

maybe you should see Jeffery's tutorial of Building a forum with TDD , i remember he has a favorite unfaoverite example, and pay attention to the controller

Sep
03
1 month ago
Activity icon

Replied to Axios Sends Two Requests

you can try my previous suggestion ,change delete route to /unfavorite

Activity icon

Replied to Laravel Vue SPA - Console Error _vm?

MORE experienced with Vue like yourself? Solve your problem without seeing a single piece of code?

OK, good luck with that....

Activity icon

Replied to Axios Sends Two Requests

in your controller , destroy () function , you authorize a 'update' instead of 'delete'

that could be the problem?

Sep
02
1 month ago
Activity icon

Replied to Laravel Vue SPA - Console Error _vm?

are you asking yourself? if not , please show some code

Sep
01
1 month ago
Activity icon

Replied to Axios Sends Two Requests

npm run dev or watch again and give the browser a hard refresh check your other component again

Activity icon

Replied to How To Insert Data With Laravel And Ajax?

you did not provide the monthly_id

Activity icon

Replied to Axios Sends Two Requests

Route::post('/notes/{note}/favorite', '[email protected]');
Route::delete('/notes/{note}/favorite', '[email protected]');

these 2 routes are the same change delete to unfavorite

Aug
31
1 month ago
Activity icon

Replied to JSON String Data Button Click Is Not Working In Vuejs

use a computed property to handler the data

computed: {

	newstyle () {
		return this.element[0].value // assuming you bring your data into data() or props
	}
}

then

<p v-html="newstyle"></p>
Activity icon

Replied to Axios Sends Two Requests

these are in your web.php file right? what is in your api.php? did you change anything.

as far as i can tell you provide 2 conflict route

post and delete at the same route name rename delete

Route::delete('/notes/{note}/unfavorite','[email protected]');
Activity icon

Replied to Adding Imagick To My Docker LAMP I Got Error :You Should Add “extension=imagick.so” To Php.ini

how did you install apache2 and php?

please always do : sudo apt update

before you install any app then sudo apt install your-app

if you have a fresh new linux system you can sudo apt install apache2 php

remember after installed php , you have to manually install some php extensions after all these then sudo apt install imagick

actually , linux is smart enough to add config to your server and php.ini

Activity icon

Replied to Axios Sends Two Requests

if you are buliding a SPA with vue-router , pay attention to the wildcard route model binding , don't use the same name , vue-router will transform request for example laravel route

post '/notes/{note}/favorate'

vue-router

path:  '/notes/:note' ,  //this is vue router path , a get request

so , change laravel route name to notestest and try again

Aug
30
1 month ago
Activity icon

Replied to Vue Model Binding For Jquery Datapicker

because jquery datepicker has its own onChange event , it is not a typical js event , that caused problem.

one solution is saperate input into 2 component , then use a v-model 2 way binding to bind the data.

Activity icon

Replied to $request->user() Is Fetching User Data From Db Instead Of Token

it is a really unsafe way to do this. you should check user is logged in before every import route

so saving important user info in localstorage or local session is very dangerous

Aug
25
1 month ago
Activity icon

Replied to 419 Error For Sanctum API Post Request.

sorry , i did not notice , then you should check your if your token is expired , and stick to your original code

Activity icon

Replied to 419 Error For Sanctum API Post Request.

are you using laravel ui vue preset?

and , if your axios setting is right(which i doubted) it may be a router conflict betweet laravel api and vue router wildcard please show some of your route file , laravel and vue both

Activity icon

Replied to 419 Error For Sanctum API Post Request.

you cannot get env like this , it is a laravel way not js way

and , the key name in headers does not need quote

first store your access token in localstorage then you can retrieve it from js second , headers should be like this :

headers: {
	Authorization: 'Bearer ' + localstorage.getItem('access_token')
}

but , i think you should check the access token in every component file before you do a request because some other app could accidentally delete your localstorage content

Aug
24
1 month ago
Activity icon

Replied to 405 Method Not Allowed With Axios

i can be 100% sure that you have a get route of reply/{reply} change the patch route to anything else this happens in vue SPA all the time , wildcard match will confuse the route file

Activity icon

Replied to Sanctum Personal_access_tokens Table Does Not Exist

using sanctum could really tricky sometimes

first , did you follow the offical document step by step? Do not skip any step , like publish the config file and run php artisan migrate for the api site

second , if you are using a spa , then there is some settings should handled in the config file , auth file and even the ui auth-backend file

better post some code or , show some structure of your site

Aug
22
1 month ago
Activity icon

Replied to This.$route.query Is Empty On First Load

@skeith22

this.$nextTick(() => {
	console.log(this.$route.query)
})

but , normally any query in routes should be passed before data retrieving unless you use beforeEnter.

check your router-link or path in your routes file

Aug
18
2 months ago
Activity icon

Replied to Get Username On Vue.js Ajax Post Request / Auth With The API

login?

axios.post('your/login/endpoint',{
	username: username-in-form,
	password: password-in-form
})

what is the backend auth package you using? i suggest Laravel Sanctum

Activity icon

Replied to ZSH On Mac, Does Not Install PHP Packages Using Composer Since Update To Catalina 10.15.5

@dxladner this could be a network problem , please try a mirror server , you can google composer mirror. dont' worry. there always a solution.

restart your computer , clear dns cache , restart your broadband router to refresh , these methods maybe a magic

good luck

Aug
17
2 months ago
Activity icon

Replied to ZSH On Mac, Does Not Install PHP Packages Using Composer Since Update To Catalina 10.15.5

did you check your zsh profile? ~/.zshrc , not a bash profile or , in zsh shell , type exit to bash

really weired, i did update my system from mojave to catalina before , little buggie , but still work hope you find a solution soon

Activity icon

Replied to Upload Image In Specific Folder With Faker

@browniecoffee seems like you wanna save the file into public folder,

1 you should check your permission

if (!file_exists($path)) {

    	mkdir($path,0777,true);
}

2 use a full path instead of a relative path , put a '/` in front

$storagePath = '/projets/' . $user->username.'/projet_' . $identifier . '/thumbnail/';
Activity icon

Replied to ZSH On Mac, Does Not Install PHP Packages Using Composer Since Update To Catalina 10.15.5

oh , i think you may have to re-install MAMP.

But , i would suggest you to install PHP via Homebrew , it is more reliable and easy to maintain no matter how you upgrade the os. Then you could use valet to manage different sites.

Aug
16
2 months ago
Activity icon

Replied to ZSH On Mac, Does Not Install PHP Packages Using Composer Since Update To Catalina 10.15.5

how did you install composer? Did you follow the offical instruction? what is the version of composer?

Aug
15
2 months ago
Activity icon

Replied to ZSH On Mac, Does Not Install PHP Packages Using Composer Since Update To Catalina 10.15.5

check your php version

php -v

and

which php

in iterm2

Aug
12
2 months ago
Activity icon

Replied to How Do I Put A Default Image If User Did Not Provide An Image

this check should be in view file

<img src="{{ $user->image ? $user->image : 'path/default.jpg' }} >

something like that

Aug
06
2 months ago
Activity icon

Replied to Api Auth

laravel sanctum

Activity icon

Awarded Best Reply on File Upload Fails Using Vue.js Laravel

@pazitron store method should only handle the new save stuff , don't mix a update in $job , little confusing.

the FileReader part is only for generating previews , it has nothing to do with persisting to the database .

there is always an old way to save files in public directory and be alert to the permission setting.

$file = $request->file('image');

		$filename = $file->getClientOriginalName();//or you can give a name

		$path = 'somepath'; // the path in public directory you want to save file, String, full path,

		$file->move(public_path($path),$filename); // move the file from request to directory, public_path method is required!!

		if (!file_exists($path)) {

    		mkdir($path,0777,true);

    	}
Activity icon

Replied to File Upload Fails Using Vue.js Laravel

@pazitron store method should only handle the new save stuff , don't mix a update in $job , little confusing.

the FileReader part is only for generating previews , it has nothing to do with persisting to the database .

there is always an old way to save files in public directory and be alert to the permission setting.

$file = $request->file('image');

		$filename = $file->getClientOriginalName();//or you can give a name

		$path = 'somepath'; // the path in public directory you want to save file, String, full path,

		$file->move(public_path($path),$filename); // move the file from request to directory, public_path method is required!!

		if (!file_exists($path)) {

    		mkdir($path,0777,true);

    	}
Activity icon

Replied to File Upload Fails Using Vue.js Laravel

because in your vue component , you never send images to laravel.

you need to add

let formData = new formData ()
formData.append('company_logo',this.companyLogo)
formData.append('anything_you_need',this.anything)

after that , laravel request will have a file

@sinnbeck it is a dom object you pass , not the file itself.

Aug
05
2 months ago
Aug
04
2 months ago
Aug
01
2 months ago
Activity icon

Replied to Clear The DOM After Delete

something like that

removeitem (m) {

        this.comments.splice(this.comments.indexOf(m),1);

    }
Activity icon

Replied to Laravel Sanctum + Nuxt.js

in normal ajax call using axios

axios.get('/sanctum/csrf-cookie')
	.then(response => {
		axios.post('/login',this.form)
			.then(response => {
				//do something after login
			})
	})

Activity icon

Replied to Props Undefined On Child Component

@tarang19

you did not change the props and data ()

and , if component to component props passing display undefined , i have a solution here

this thread

Activity icon

Replied to Incorrect Rendering Of The Parent Component

@inyansuta

i understand you , component to component prop sending has this bug , php to component does not. i posted a solution 2 days ago , use watch can solve this.

this thread

Activity icon

Replied to Incorrect Rendering Of The Parent Component

you can't pass a vue prototype variable like $root.rootVariable in the template

put it in data or in a computed property

like

computed: {
	rootvariable () {
		return this.$root.rootVariable
	}
}

//template
<child :root-variable-from-parent="rootvariable"></child>

Activity icon

Replied to Props Undefined On Child Component

the props name in child component should be preference and you should change the same name in data section to else. BTW, you don't need to do let self=this

Jul
31
2 months ago
Activity icon

Replied to Query Params In Vuejs

not a good way vue router has a query object

you can grab it using

this.$route.query
Activity icon

Replied to Vue Strange Behavior Of Data And Props

@johnbraun

Yes. undefind.

I found a solution . Use a watch to observe the property sent in , then

watch : {

	PropName: {
		handler () {
			this.anything = this.PropName.anything
		}
		immediate: true // this is the tricky part
	}
}

And , Magic happened haha

Activity icon

Replied to How To Make HTML File To VUEjs Components?

if i understand you right , you want to embed a html file into a vue component ?

then , innerHtml function will do the trick.

Activity icon

Replied to How To Get Vue Router To Go To Another Page

@shiva actually you don't need to provide this component a path , it is a attachment of the main component and only belongs to it.So, i think if you rewrite it , you will find it easier