wingly

wingly

Member Since 2 Years Ago

Experience Points
92,210
Total
Experience

2,790 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
515
Lessons
Completed
Best Reply Awards
62
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 19
92,210 XP
May
26
1 week ago
Activity icon

Replied to I'm Getting This, PARSE ERROR Syntax Error, Unexpected 'use' (T_USE), Expecting '{' ,on Line 3

Your namespace is wrong

namespace App\Http\Controllers\ImageController;

should be

namespace App\Http\Controllers;
Activity icon

Replied to I'm Getting This, PARSE ERROR Syntax Error, Unexpected 'use' (T_USE), Expecting '{' ,on Line 3

Show us the contents of the App\Traits\ImageUpload probably it's again a namespace issue

May
24
1 week ago
Activity icon

Replied to Migrations Clean Up

I think Taylor is preparing something for v8 that might help https://github.com/laravel/framework/pull/32275 but yeah i am interested in this too :)

May
21
1 week ago
Activity icon

Replied to Acessing Relationship - Undefined Property, Trying To Get Property 'title' Of Non-object

If a post can have or not have a category then

{{ optional($post->category)->title }}

May
19
2 weeks ago
Activity icon

Replied to Vue Custom Component

Yes sorry i misread true i don't see anything in the docs for object type props support but in the demo there are some examples maybe those can help you https://github.com/karol-f/vue-custom-element/blob/master/demo/components/DemoBinding-docs.vue

Activity icon

Replied to Vue Custom Component

If you use json_encode ?

Activity icon

Replied to Speed Up The User Experience Just With Laravel (PHP)

I agree with @tray2 your focus should be to limit the results either by an autocomplete and search on type or by city and then filter based on the city. I still think that all this can be avoided by using an algolia places autocomplete and get those stuff in the background but if it doesn't fit your case then it doesn't...

Activity icon

Replied to Multiple Vue Apps In One View?

Hmm not sure that i follow but if you want to merge new stuff into the root instance you can use mixins and extend the root instance https://vuejs.org/v2/guide/mixins.html#

Activity icon

Replied to Vue Custom Component

Why don't you use the Vue frontend scaffolding that ships with laravel/ui ? After installing it should be trivial to add your custom components and use them anywhere you want. It even contains an example component to get you started

Activity icon

Replied to Multiple Vue Apps In One View?

But here you are creating a new instance in every view. Is there a reason behind this? Why you don't just create an instance in your main app.js file and then by creating components use them in your individual views?

Activity icon

Replied to Multiple Vue Apps In One View?

Can you post an example what are you trying to do?

Activity icon

Replied to Call To A Member Function Update() On Null

From the docs: When issuing a mass update via Eloquent, the saving, saved, updating, and updated model events will not be fired for the updated models. This is because the models are never actually retrieved when issuing a mass update. That being said if you want the event to be fired you gonna have to retrieve the model and handle the update conditionally something like:

if ($motor = Motor::firstWhere('manufacture_pn', $pn)) {
	$motor->retail_price = $retail_price;
	$motor->save(); // will fire the model event
}
Activity icon

Awarded Best Reply on Call To A Member Function Update() On Null

Don't use first this should do it

        Motor::where('manufacture_pn', $pn)->update(['retail_price' => $retail_price]);
Activity icon

Replied to Call To A Member Function Update() On Null

Don't use first this should do it

        Motor::where('manufacture_pn', $pn)->update(['retail_price' => $retail_price]);
May
18
2 weeks ago
Activity icon

Awarded Best Reply on Flag-icon-css Package Installation And Use In Laravel

@nadeem2020 probably you installed it but you don't import it. Never used the package but try adding import 'flag-icon-css/css/flag-icon.css' in your app.js and then recompile your assets

Activity icon

Replied to Filter Data When A Select Changes

Yes should be even simpler with inertia take a look here https://github.com/inertiajs/pingcrm/blob/master/resources/js/Pages/Users/Index.vue the part of filtering

  watch: {
    form: {
      handler: throttle(function() {
        let query = pickBy(this.form)
        this.$inertia.replace(this.route('users', Object.keys(query).length ? query : { remember: 'forget' }))
      }, 150),
      deep: true,
    },
  },

pretty sure you can adjust it to your use case

Activity icon

Replied to Undefined Index: Url

@nicwek then update your code to reflect the change so we can help you with the rest of the remaining bugs

Activity icon

Replied to Filter Data When A Select Changes

Can you post here how are you loading the data ? in short yes this is how you do it you have a form with method GET pointing to your endpoint on submit the value of country get's into the query params like ?country=Paris and then you retrieve it in your controller and adjust your query to do the filtering based on country. @msslgomez does it makes sense ?

Activity icon

Replied to Undefined Index: Url

$colorUrl is undefined

Activity icon

Replied to How Can I Install The Material-UI Pickers Package In Laravel 6?

If you just need a nice date picker i recommend this one https://flatpickr.js.org/themes/ check the themes you have some material options

Activity icon

Awarded Best Reply on ResetFields Element-ui Checkbox

Never used element-ui but from a glimpse at the docs try wrapping your checkboxes with el-form-item like that

      <el-form-item prop="prayer_ck">
        <el-checkbox v-model="surveyForm.prayer_ck"/>
            <span style="padding-left: 0.5em; width: 90%; overflow-wrap: break-word;">
                ORACION 
            </span>
	</el-form-item>
Activity icon

Replied to ResetFields Element-ui Checkbox

Never used element-ui but from a glimpse at the docs try wrapping your checkboxes with el-form-item like that

      <el-form-item prop="prayer_ck">
        <el-checkbox v-model="surveyForm.prayer_ck"/>
            <span style="padding-left: 0.5em; width: 90%; overflow-wrap: break-word;">
                ORACION 
            </span>
	</el-form-item>
Activity icon

Replied to VUE And Axios Not Retrieving Data

async read(){
            const { data } = await axios.get('/api/cruds')
},

Note the async/await keywords

Activity icon

Awarded Best Reply on JAVASCRIPT : How To Explode An Array Of Strings ?

Try this ["a","b","0","4","XXXX","j","t"].map(el => el.split('')).flat(Infinity) or a bit more fancy ["a","b","0","4","XXXX","j","t"].map(el => [...el]).flat(Infinity) or even shorter ["a","b","0","4","XXXX","j","t"].flatMap(s => [...s])

Activity icon

Awarded Best Reply on Change Box Width And Color

@meracle the semicolon in this case is perfectly fine (depends on your preference but fine) ;) @davy_yg as i already posted you original code is fine you just had a semicolon inside your computed myStyle

computed: {
	myStyle: function(){
		return {
			backgroundColor: this.color,
			width: this.width + 'px'; // here semicolon is not a valid syntax please remove me!!!!!
		};
	}
}
Activity icon

Replied to Change Box Width And Color

@meracle the semicolon in this case is perfectly fine (depends on your preference but fine) ;) @davy_yg as i already posted you original code is fine you just had a semicolon inside your computed myStyle

computed: {
	myStyle: function(){
		return {
			backgroundColor: this.color,
			width: this.width + 'px'; // here semicolon is not a valid syntax please remove me!!!!!
		};
	}
}
Activity icon

Replied to Change Box Width And Color

You have a typo man

		return {
			backgroundColor: this.color,
			width: this.width + 'px';
		};

should be

		return {
			backgroundColor: this.color,
			width: this.width + 'px'
		};
Activity icon

Replied to How Can I Install The Material-UI Pickers Package In Laravel 6?

Material ui is a react component library if you are not using react or planning to use react in your project then it's not meant for you...

Activity icon

Replied to JAVASCRIPT : How To Explode An Array Of Strings ?

Try this ["a","b","0","4","XXXX","j","t"].map(el => el.split('')).flat(Infinity) or a bit more fancy ["a","b","0","4","XXXX","j","t"].map(el => [...el]).flat(Infinity) or even shorter ["a","b","0","4","XXXX","j","t"].flatMap(s => [...s])

Activity icon

Replied to Flag-icon-css Package Installation And Use In Laravel

@nadeem2020 probably you installed it but you don't import it. Never used the package but try adding import 'flag-icon-css/css/flag-icon.css' in your app.js and then recompile your assets

May
17
2 weeks ago
Activity icon

Replied to Flag-icon-css Package Installation And Use In Laravel

Did you try npm install && npm run dev

Activity icon

Awarded Best Reply on Target Class [myapp\Http\Controllers\HomeController] Does Not Exist

<?php

use Illuminate\Support\Facades\Route;


Route::get('/',[
'uses'=>'[email protected]',
'as'=>'home',

		]);

check the docs https://laravel.com/docs/7.x/controllers#controllers-and-namespaces

Activity icon

Replied to Vuex Module Reuse Best Practices

Basically you are doing what i said state as function is the part that solves your problem check the docs for more info https://vuex.vuejs.org/guide/modules.html#module-reuse glad that you figure it out yourself !!

Activity icon

Awarded Best Reply on Vuex Module Reuse Best Practices

Can't you just make your state a function returning an object instead of a plain old object ?

  state () {
	return {
item: null,
        loading: true,
        show_return_modal: false,
        show_reject_modal: false,
        show_remarks_modal: true,
	}

Activity icon

Replied to Target Class [myapp\Http\Controllers\HomeController] Does Not Exist

<?php

use Illuminate\Support\Facades\Route;


Route::get('/',[
'uses'=>'[email protected]',
'as'=>'home',

		]);

check the docs https://laravel.com/docs/7.x/controllers#controllers-and-namespaces

Activity icon

Replied to Vuex Module Reuse Best Practices

Can't you just make your state a function returning an object instead of a plain old object ?

  state () {
	return {
item: null,
        loading: true,
        show_return_modal: false,
        show_reject_modal: false,
        show_remarks_modal: true,
	}

May
16
2 weeks ago
Activity icon

Awarded Best Reply on Eloquent Model ~ Aggregate N+1, Best Practice

Use the collection instead

	public function getTotalAttribute()
	{
		return $this->items->sum("amount");
	}

and load it in

	protected $with= [
		"items",
	];
May
15
2 weeks ago
Activity icon

Replied to New To Nova

Nova provides "just" an administration panel that you can include in a normal Laravel application you can then configure a Nova resource for each of your models

Activity icon

Replied to Eloquent Model ~ Aggregate N+1, Best Practice

Use the collection instead

	public function getTotalAttribute()
	{
		return $this->items->sum("amount");
	}

and load it in

	protected $with= [
		"items",
	];
Activity icon

Awarded Best Reply on Application Of VueX Module Reuse

Yes Vuex has a pretty steep learning curve. But the are a lot of resources that can help you out to get started take a look here for example https://medium.com/@ariklevliber/vuex-next-steps-namespaces-and-dynamic-modules-92ea23a0ee9a Maybe also research some alternatives like using a simple global event bus https://www.digitalocean.com/community/tutorials/vuejs-global-event-bus using provide/inject https://medium.com/@znck/provide-inject-in-vue-2-2-b6473a7f7816 maybe even jeffrey 's approach https://laracasts.com/series/learn-vue-2-step-by-step/episodes/24

Activity icon

Replied to Application Of VueX Module Reuse

Yes Vuex has a pretty steep learning curve. But the are a lot of resources that can help you out to get started take a look here for example https://medium.com/@ariklevliber/vuex-next-steps-namespaces-and-dynamic-modules-92ea23a0ee9a Maybe also research some alternatives like using a simple global event bus https://www.digitalocean.com/community/tutorials/vuejs-global-event-bus using provide/inject https://medium.com/@znck/provide-inject-in-vue-2-2-b6473a7f7816 maybe even jeffrey 's approach https://laracasts.com/series/learn-vue-2-step-by-step/episodes/24

Activity icon

Awarded Best Reply on How To Update Column Value Using Existing Column Value

Not sure i understand but if you want to add x value to an existing value then you can use https://laravel.com/docs/7.x/queries#increment-and-decrement