Vicente123

Vicente123

Member Since 11 Months Ago

Experience Points 530
Experience
Level
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
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.

18 Apr
8 months ago

Vicente123 started a new conversation Removing Objects From An Array.

Hi, Im trying to make a chained select, the functionality is pretty basic. When a user selects a Country I remove from an array of cities objects, the ones that don't match with my selected country. So, I'm actually trying to remove those elements from the Object Array, but i can't. I tried using lodash, common JS, and Jquery. The thing is that the array sustains the same structure as before removing the elements, so it gets rendered at the select.

My code: HTML

<select name="country_selector" id="country_selector" class="form-control" @change="showCities">
                        <option :value="0" disabled placeholder="selected">Selected a Country...</option>
                        <option v-for="country in countries" :value="country.id" :key="country.id">{{ country.name }}</option>
                    </select>

                    <br>

                    <label for="city_selector">City</label>
                    <select name="city_selector" id="city_selector" class="form-control" @change="showSites">
                        <option :value="0" disabled>Selected a City...</option>
                        <option v-for="city in cities" :value="city.id" :key="city.id">{{ city.name }}</option>
                    </select>

Vue code:

data() {
            return {
                mode: 'Loading',
                selected_site: undefined,
                locations: [],
                countries: [],
                cities: [],
                sites: [],
                arrAux: []
            };
        },

etc...

methods: {

showCities(){

               let country_id = $('#country_selector').val();

                this.cities = _.remove(this.cities, function (el) {
                    return el.country_id !== country_id;
                });
            }
}

16 Apr
9 months ago

Vicente123 left a reply on Axios.put Retriving "500 (Internal Server Error)"

@ejdelmonico mmm... that doesn't seems to fix the problem, any other idea?

Vicente123 started a new conversation Axios.put Retriving "500 (Internal Server Error)"

Hi, I'm trying to update data using axios.put method. It WAS WORKING till I moved the route into some routes group with prefix and middlewares. I'm pretty sure that I'm missing tokens. Code:

´´´ axios.put(self.postUrl.replace('%%ID%%', id), { id: id, title: $('#prov_program_name').val(), description: $('#prov_program_description').val(), session: $('#prov_program_session').val()

            })

´´´

´´´

Route::group(['prefix' => 'rest', 'middleware' => 'auth.basic'], function () { Route::put('/rest/program-instances/update', '[email protected]')->name('rest.program_instances.update');

});

´´´

My form does not have a single token declared. But as i said, it was working before moving this route.

10 Apr
9 months ago

Vicente123 started a new conversation Multiple Events For One Listener

Hi, I'm trying to trigger a listener with 2 different Events. (I know that I could use the same event. but that's not the point). So, how do I approach this? I'm using Laravel 5.2, declaring events and listeners at my EventServiceProvider

my EventServiceProvider: ´´´

'App\Events\SecurityDepositPaymentAdded' => [
        'App\Listeners\UpdateSecurityDepositBalance'
    ],

    'App\Events\SecurityDepositChargeAdded' => [
        'App\Listeners\UpdateSecurityDepositBalance'
    ]

´´´

how should my handle look like?

23 Mar
9 months ago

Vicente123 left a reply on Reading JS SessionStorage From Vue Doesn't Works.

My bad at writing it. I will try those options then

Vicente123 started a new conversation Reading JS SessionStorage From Vue Doesn't Works.

Hi, I'm trying to make some basic stuff, basically, I want to declare a SessionStorage variable in a page with a form. Then. The user travels to a page with my Vue component where I need to extract that session storage variable. This is how I get the first value in my JS.

var fieldOperator = document.getElementById("operatorForRefundAmount");

fieldOperator.addEventListener("change", function() {
            sessionStorage.setItem("autosaveOperator", fieldOperator.value);
        }); 

That works just fine. The problem is when i try to get that session's value in my vue component. For this, I'm using the vue-sessionstorage package ( https://www.npmjs.com/package/vue-sessionstorage )

Vue code:

etc

mounted() {
            var self = this;
            this.showSession();

            axios.get(this.peUrl)
                .then(function (response) {
                    self.program_experiences = response.data;
                });
        },

..
etc
..

methods:{
            showSession(){
                  let s = this.$session.get("autosaveAmount");
               console.log(s);;
            }
        }

This shows me undefined as if the session didn't exist.

07 Mar
10 months ago

Vicente123 left a reply on Trying To Send Form When Select Changes.

Thx, i finally did it.

Vicente123 left a reply on Trying To Send Form When Select Changes.

I'm getting this error: _vm.$refs.form.submit is not a function

Looks like it's waiting for a function. Should i submit the form trough a method?

Vicente123 started a new conversation Trying To Send Form When Select Changes.

I'm trying to send the form's value to a controller. I've read and implemented the following code. The error im getting every time i change the select's value is : "Cannot read property 'form' of null "

<span class="pull-right">
                                            <form method="POST" v-on:submit="update_status(log.id)">

                                                <strong>Change To:</strong>
                                                <select name = "task_status" v-on:change = "self.form.submit()" style="border-radius: 2px; border-color: #0a0a0a;" v-model="log.status">
                                                    <option value="new" >New</option>
                                                    <option value="in-progress">In Progress</option>
                                                    <option value="under-review">Under Review</option>
                                                    <option value="completed">Completed</option>
                                                    <option value="cancelled">Cancelled</option>
                                                </select>
                                            </form>
                                        </span>


---ETC---


        methods: {
             update_status(task_id){
                console.log("damn son");
                this.statusUpdate.replace('%%ID%%',task_id);
            }
        }
05 Mar
10 months ago

Vicente123 left a reply on Can't Refere Prop Inside Foreach.

That worked. Thx so much!

Vicente123 left a reply on Can't Refere Prop Inside Foreach.

@m-rk thx, that works. But for some reason, the component doesn't render information as if I hardcoded the wished ID instead of using media_id. Weird...

Vicente123 started a new conversation Can't Refere Prop Inside Foreach.

So, i'm trying to check the a variable from a foreach with a prop variable. Everything is cool until I try to get the prop's value inside the foreach function. The error im getting: Cannot read property 'media_id' of undefined

Code goes like this:

props: ['resource-url', 'media_id'],

data() {
            return {
                errors: [],
                mode: 'loading',
                selected: undefined,
                mediaFiles:[
                    {
                        'id' : '',
                        'url' : '',
                        'filename' : ''
                    }
                ]
            };
        }

 --- ETC ---

methods: {

            selectMedia() {
                let self = this;
           
                self.mediaFiles.forEach(function (value)  {
                    if(value.id === this.media_id)
                    {
                        self.selected = value.url;
                    }
                });

            }
        }

---ETC --

07 Feb
11 months ago

Vicente123 left a reply on Query Builder "addGroupBy()" Function Doesnt Works.

The thing is that i wasn't renaming the columns so it never returned me the 3 values...thx

Vicente123 left a reply on Query Builder "addGroupBy()" Function Doesnt Works.

@vladshoob The thing is that i want to get 3 columns at my collection, and that returns only 2. I dont even know if it's posible xD

Vicente123 started a new conversation Query Builder "addGroupBy()" Function Doesnt Works.

Hi, I'm trying to use 2 groupBy in a query, found this "addGrpupBy" in the QueryBuilder.php file, so i thought it might work, but it doesn't. Here is the query.

$sessions = Session::select(array('sessions.display_name', 'sites.name', 'programs.name')) ->join('programs', 'programs.session_id', '=', 'sessions.id') ->join('sites', 'programs.site_id', '=', 'sites.id') ->join('applications', 'applications.program_id', '=', 'programs.id') ->groupBy('sites.name') ->addGroupBy('programs.name') ->get();

The error that i get: Call to undefined method Illuminate\Database\Query\Builder::addGroupBy()