matiascx

matiascx

Member Since 4 Years Ago

Experience Points 49,750
Experience Level 10

250 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 864
Lessons
Completed
Best Reply Awards 0
Best Reply
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.

08 Feb
2 years ago

matiascx left a reply on [L5] How To Get Url Parameters At Middleware

$request->route()->parameters() will return all the parameters you can take

01 Feb
2 years ago

matiascx left a reply on Create A Custom Relationship Method

a nice idea is to override and custom your own relationship method

21 Oct
2 years ago

matiascx left a reply on Paginate Eloquent Collection

@bobbybouwmann ,thanks, you helped me out also!

03 Jun
2 years ago

matiascx left a reply on Approach To Implement A Reusable Vuejs Spinner Directive?

Update myself: vuejs member proposed me following: " Well, the answer is that you should not implement it as a directive, but rather as a component. Also, it's better to turn the things around, and let the ajax component import and use the spinner component instead of wrapping spinner component around ajax component. " It is a great proposal, and i implement that way, spinner works great now!

02 Jun
2 years ago

matiascx started a new conversation Approach To Implement A Reusable Vuejs Spinner Directive?

Hi, guys, I am considering approach to implement a vuejs spinner directive which wrap spin.js and can be reused anywhere if needed. I'd like to use it this way:

<div v-spin>
     <ajax-component></ajax-component>
</div>

The scenario is : when ajax-component execute ajax operation, the spin should be triggered and show, when ajax finished, the spinner should disappear. How do you think I should implement this functionality? Any proposal is aprreciated!

15 May
3 years ago

matiascx left a reply on How To Pass Url Parameter(used To Retrieve Data Before Component Compiled Into Live) To Async Component?

I have figured out myself. The solution is: pass the resp object into a returning function which will return the component defination object. A little confuse about the javascript closure. It works. It makes sense when we abstract component reuse for async fed data pattern.

var AsyncComponentWithPromise = function(url,compOptions) {
    return function(resolve) {
        return this.$http.get(url).then(function(resp) {
            resolve(compOptions(resp));
        });
    };
Vue.component('ajax-user-add',AsyncComponentWithPromise('/some/ajax/data/feeding/url/',(function(){
   return function(){
            return {
    template: document.getElementById('ajax-user-addTemplate').innerText,
    props: ['shouldopenme'],
    data: function(){
        return {
          // here we always get the error with :
          // Uncaught (in promise) ReferenceError: resp is not defined-->solved since resp is passed into the function
            data: resp.data 

        };
    }};
}
}()));
13 May
3 years ago

matiascx started a new conversation How To Pass Url Parameter(used To Retrieve Data Before Component Compiled Into Live) To Async Component?

Hi guys,

how to transfer a url parameter(used to retrieve data before component compiled into live) to async component? Say:

Vue.component('async-example', function (resolve, reject) {
this.$http.get('/admin/permissions/data').then(
function(resp) {
resolve({})

above example, i hope the $http.get parameter can be transfered in('/admin/permissions/data)

28 Apr
3 years ago

matiascx left a reply on Laravel 5 Creates A New Session After Each Request

I also experienced this issue for several hours. I change the dd() to var_dump(), everything goes well.

24 Apr
3 years ago

matiascx started a new conversation How Do You Implemented The Dynamical Alert In The Vue App With Alert/alerts Component?

Hi, I have followed jeffery way to create one alert component, what is more, i have also created a alerts component which will function as container for all the alert info. I will use the alerts component as follows:

<alerts :list.sync="alerts"></alerts>

the template file:

<!-- alert component -->
<script type="x/templates" id="alertTemplate">
    <div :class="alertClasses" v-show="show">
        <slot></slot>
        <span class="close" @click="show = false">x</span>
    </div>
</script>
<!-- alerts component -->
<script type="x/templates" id="alertsTemplate">
    <div class="alerts">
        <alert v-for="item in list" :type='item.type'>
        @{{item.type}}
            @{{item.info}}
        </alert>
    </div>
</script>
Vue.component('alert',{
    template: '#alertTemplate',
    props: ['type'],
    data: function() {
        return{
            show: true
        }
    },
    computed: {
        alertClasses: function() {
            var type = this.type;
            return {
                'alert': true,
                'alert--success': type == 'success',
                'alert--error': type == 'error' 
            }
        }
    },
    ready: function() {
        console.log(this);
    }
});
Vue.component('alerts',{
    template: '#alertsTemplate',
    props: ['list'],
    events: {
        'add-alert':function(data) {
            this.list.push(data);
        }
    }
});

In the root vue instance, i have one data object containing the alert information:

new Vue({
    el: '#body',
    data: {
        todoHovered: false,
        showoriginal: true,
        alerts: [ // the alerts array will be used as data feeding for the alerts component
            {type: 'success', info: 'this is sucess info'},
            {type: 'success', info: 'this is xxxx info'},
            {type: 'success', info: 'this is sucess info'},
            {type: 'error', info: 'this is error info'}
        ]
    }

How do you think we should implement following use case: I'd like to implement the alerts and alert component functioning as a generic alert system, when there is something happend in the app, I hope the app will pop up pre-defined format alert info(which implemented by alert component). What is the best solution for this kind of requirement? What i now do to address this requirement is: I add a event listener in the root vue instance, when need to fire an alert, we fire that custom event to push alert data into the alerts array, this will add alert and pop it up. Is my practice good enough or not? As I know, in anugluar case, we should implement a service module which is responsible for managing the alerts data. Any comments are welcome.
When something happens, we should dynamically pushed some alert data to the vue root

matiascx left a reply on Why Dynamically Mounted Vue Components Does Not Appear In Devtool?

@jimmck , in my test case, the dynamically inserted component's template is not part of root vue instance's html. Is that caused dynamically inserted component not children of root vue instance in the dev tool? I am a little not clear about it.

matiascx left a reply on Why Dynamically Mounted Vue Components Does Not Appear In Devtool?

@mehany , I have not posted onto vue forum yet. It is very strange, i have never received the email verification on vuejs.org forum, so i can not post on their forum.

matiascx left a reply on Why Dynamically Mounted Vue Components Does Not Appear In Devtool?

here is the code:

<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<div id="root" >
    <div @click="onclick">this is root</div>
</div>
<script type="x/templates" id="comp">
  this is dynamically mounted component
</script>
<script>
    
    new Vue({
      el: "#root",
      methods: {
        onclick: function(e){
        var subcomp = Vue.extend({
          template: "#comp"
        });
        new subcomp().$mount(e.target);
        }
      }
    });
</script>
</body>
</html>

matiascx started a new conversation Why Dynamically Mounted Vue Components Does Not Appear In Devtool?

Hi, everyone, I am testing following scenario: I have created one component which will be dynamically mounted to a dom with some id; when i click one element(which has a @click handler bound with it, i will initiate that component and mount it into dom. My question is: I have inspected in the devtool, that new inserted vue component can not be seen as a child of root vue instance. What is the problem? Is this the normal case or what i have done wrong with? Please see following code: http://jsbin.com/fikida/edit?html,js,console,output

Thanks~!

14 Apr
3 years ago

matiascx left a reply on Development In Laravel 5, Best Practices

I address this upgrading with following process:

  1. git clone https://github.com/laravel/laravel.git myporject
  2. composer install
  3. git remote remove origin
  4. git remote add myorigin https://github.com/myaccount/myproject
  5. git push myorigin master;
  6. based on that fresh project, i do development job;
  7. say some months passed, i'd like to upgrade laravel to latest stable, i do so: 8.a: git remote add laravel https://github.com/laravel/laravel.git 8.b: git fetch laravel master 8.c: git merge laravel/master 8.d: composer update
  8. git push myorigin master From now on, i will have the latest stable laravel master and my own project file.

But what i found the issue is: Is there a good way to find out the link between laravel/laravel and laravel/framework repo? Some times, laravel/laravel has not been updated, but if you check the laravel/framework repo has been pushed with some bugfixes. What currently do is to composer update every week. But it seems this is not a good solution.

02 Apr
3 years ago

matiascx left a reply on Does Laravel5.2 Response Much Slower Than Laravel5.1?

sorry, laravel5.1 and laravel5.2 has the same result. But both is very slow, laravel responded after 3 seconds to display the welcome page. I have goolged and someone say it is caused by virtualbox sharefolder. But in my development scenario, i use windows host running the phpstorm to develop and php running environment lives in vagrant virtual box. I do not know whether or not i can speed up this responding time.

01 Apr
3 years ago

matiascx left a reply on Does Laravel5.2 Response Much Slower Than Laravel5.1?

@ejdelmonico , sorry, i do not understand what is the domain caching. How to figure it out whether or not it is the reason you mention?

matiascx started a new conversation Does Laravel5.2 Response Much Slower Than Laravel5.1?

I have just installed latest laravel5.2.27, previously i use laravel5.1. For laravel 5.1 the page load time is about 0.5second, laravel5.2 welcome page load time is about 2.3seconds. What is more, during installation, the php artisan optimize execute timeout one time. Anyone meet the same thing? It is very annoying , i am using homestead for benchmark of 5.1 and 5.2, and i am wandering whether or not i should use 5.2 for my production development.

07 Mar
3 years ago

matiascx left a reply on Best Practice To Make Your Product Synchronized With Official Laravel Framework?

@ifpingram , thanks for your creative idea. It seems good for me. The reason why i want to keep application run on top of stable laravel (not quite frequently) is: The application i wrote is evolving with new features requested quickly, also, laravel always roll out great feature i like, so i will try to upgrade to new stable laravel release with additional effort. I will try to understand and do some experiments according to ifpingram's proposal. Thanks~!

06 Mar
3 years ago

matiascx left a reply on What To Do When You Need To Quickly Build A Site With Admin, Gallery, News Etc (CMS Basically)?

In my opinion, wordpress is not same as laravel, they address different requirement.WP is a CMS framework, while laravel is the framework to build WP and all other things. WP is applicable to all marketing people, while laravel is applicable to R&D people. Laravel is great, thanks to taylor and jeffery way and all other guys contributing to laravel.

matiascx left a reply on Best Practice To Make Your Product Synchronized With Official Laravel Framework?

thanks for your opinion. I am a little obsession for upgrading to latest stable version. I want to keep my application run on top of latest stable laravel. I do not know how to make things happen with help of git branching model when upgrading to latest laravel with just as little work as possible and also have changing history logged into my application together with laravel(and its vendor) git repository.

thanks again!

matiascx started a new conversation Best Practice To Make Your Product Synchronized With Official Laravel Framework?

I have used laravel4.1 from beginning, i have implemented some business features and make that deployed. Unfortunately, laravel is a fast-improved framework, and itself upgrade frequently. I must manually "porting" all the code i wrote into the pure clean laravel5.1 , and make everything work again, later on, i push all the code into github. And now, it is the same story of laravel5.2, I want to upgrade again to laravel5.2, and again, i will phaseout the original laravel5.1 repository and "porting" again from a fresh installed laravel5.2. I know , this process will happen again in later when laravel upgrade again. But i do not want these kind of porting job happen again and again. Can you share your best practice on this case: keep our laravel framework updated and do little job on the "porting"? What i can think out is: use Github fork repo to keep synchronized with official laravel github repo, but i do not have clear idea on this.

Thanks for any feedback!

02 Oct
3 years ago

matiascx left a reply on Git Always Complain On Unstaged Change For Phpspec Which I Have No Change On It In Homestead Env

Sorry, git add -A . has no effect. When I run git status, git still says that those three files are in unstaged state.

01 Oct
3 years ago

matiascx left a reply on Git Always Complain On Unstaged Change For Phpspec Which I Have No Change On It In Homestead Env

@ohffs , I am running git in the homestead vagrant box via a ssh console. The host OS is win7. It is really strange and frustrating, i have tried everything i know, the annoying "changes" have made the rebase, merge can not work. Also, it seems i can not add/commit the "change". I do not know whether or not it is something caused by the symlink.

Thanks!

matiascx started a new conversation Git Always Complain On Unstaged Change For Phpspec Which I Have No Change On It In Homestead Env

Dear guys, When i use homestead to dev laravel application, the git has run into a unexpected status: When i run git status, it always say : phpspec/phpunit/psysh is unstaged.(Actually, I have not touched them !). I have tried, git checkout -- . ;git stash && git drop, nothing help. Git always complain about that when I try to git pull. The phpspec/phpunit/psysh seems to be a symbol link to other files. It seems that that is the issue(Windows does not support symbol link??) Can anyone give a clue for this? Have you matched such case?

vagrant@homestead:~/Code/kidsit/vendor$ git status On branch master Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded. (use "git pull" to update your local branch) Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory)

    modified:   bin/phpspec
    modified:   bin/phpunit
    modified:   bin/psysh