michaelvolst

michaelvolst

Member Since 5 Years Ago

Huizen, the Netherlands

Experience Points 124,275
Experience Level 25

725 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 1249
Lessons
Completed
Best Reply Awards 2
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.

28 Mar
1 year ago

michaelvolst started a new conversation Transpose Data From Database

Hello,

I would like to tranpose my data to a html table and there for I have to change the rows to columns. I couldn't get this to work and I have found this post on the blog from adam wathan. link

I hope someone can help me with this and if you need more information, just let me know.

I have two tables called days and logs. The table days has many dayslogs.

This is the array how my days looks like

0 => array:13 [▼
    "id" => 99
    "status" => 1
    "location_id" => 1
    "user_open_id" => 31
    "user_close_id" => 13
    "opmerking" => ""
    "sluitings_tijd" => "2017-02-16 14:09:28"
    "day_number" => 3
    "created_at" => "2017-02-15 16:02:21"
    "updated_at" => "2017-02-16 14:09:28"
  ]

And this is how my array of the dayslogs looks like

logs

array:5 [▼
  0 => array:86 [▼
    0 => array:17 [▼
      "id" => 7404
      "task_id" => 40
      "dag_id" => 99
      "department_id" => 18
      "user_id" => 31
      "klaar" => 1
      "status" => 0
      "url_foto" => null
      "opmerkingen" => null
      "created_at" => "2017-02-15 16:02:21"
      "updated_at" => "2017-02-15 21:45:34"
      "meer_info" => 1
      "naam" => "Entree checken op vuil"
      "omschrijving" => ""
      "afbeelding_verplicht" => "0"
      "afbeelding" => ""
      "order" => 37
    ]
    1 => array:17 [▼
      "id" => 7405
      "task_id" => 41
      "dag_id" => 99
      "department_id" => 18
      "user_id" => 31
      "klaar" => 1
      "status" => 0
      "url_foto" => null
      "opmerkingen" => null
      "created_at" => "2017-02-15 16:02:21"
      "updated_at" => "2017-02-15 16:02:27"
      "meer_info" => 1
      "naam" => "Alarm er af halen"
      "omschrijving" => ""
      "afbeelding_verplicht" => "0"
      "afbeelding" => ""
      "order" => 0
    ]

And this is how my code looks like right now when I am tranposing the array


    $logs = [];

    foreach($draaidagen as $draaidag) {
      $logArray = $draaidag->draaidaglog->toArray();
      $logs[] =  collect($logArray)->transpose()->map(function($data) {
        return $data;
      });
    }

    dd($logs);


How the table should like

log | day1 | day2 | day3 | day4 | day5 ------------ | ------------- Log | √ | √ | x | √ | x Log | x | √ | √ | x | √

23 Mar
1 year ago

michaelvolst started a new conversation Help With Refactor My Code

I think this code can be written a lot better. But I'm not sure how. I would love to get some help with it.

   $tasks = $location->tasks;
     
    $table = [];
    $counter = 0;

    foreach($tasks->sortBy('name') as $task) {
      $table[] = [
          'task_id' => $task->id,
          'taak_name' => $task->name,
      ];
      $counter++;
    }
    // temporarily
    $startday = Carbon::parse('2017-03-19');

    $days = $location
                   ->days
                   ->where('created_at', '<=', $startday->toDateString())
                   ->where('created_at', '>=', $startday->subDays('7')->toDateString());  

    foreach($days as $day) {
      $logs = Log::where('day_id', $day->id)->get();

      foreach($logs as $log) {
        for ($i=0; $i < $teller; $i++) {
          $overzicht[$i]['day_number'] = $day->day_number;
          $overzicht[$i][$day->day_number]['finished'] = $log->finished;
          $overzicht[$i][$day->day_number]['status'] = $log->status; 
        }
      }
    }
04 Jan
2 years ago

michaelvolst started a new conversation How To Handle A Large Form With Vue.js

First off I have been searching on Google and on Laracast for some answers, but wasn't satisfied with any of those.

I don't have any code build for it yet, because I don't know how to handle this.

The form has more then 50 input fields and I can't do it in multiple steps, it all has to be on one page.

I was thinking of building one big array and just use json_encode for vue. Then I could loop over the input fields and display it.

If someone has better idea let me know!

09 Aug
2 years ago

michaelvolst left a reply on Parent/Child Component

Hey sorry for my late reaction. The department component is a child of the dashboard component and from there I used a v-for. So I didn't have to use a v-for in the departments component itself.

Thanks for your help !

dashboard.vue

<departments
        :department="department"
        v-for="department in departments">
      </departments>

departments.vue

<template>
    <div class="list" :class="{'finished': !isListDone.length }">
      <img class="person" :src="'/uploads/users/' + department.user.avatar" alt="{{ department.user.name}}"/>
      <h2>{{ department.name }}</h2>
      <div class="ondertitel">
        <span class="location">
          <i class="fa fa-user" aria-hidden="true"></i>
          {{ department.user.name }}
        </span>
      </div>
      <tasks :tasks="department.tasks"></tasks>
    </div>
</template>

<script>
  import _ from 'lodash';
  import Tasks from './Tasks.vue';
  export default {
    name: "Departments",

    props: ['department'],

    components: { Tasks },

    computed: {
      isListDone(){
        return _.filter(this.department.tasks, (task) => {
          return !task.done
        })
      }
    }

  }
</script>

<style>
  .finished ul > li{
    opacity: .5;
  }
</style>
08 Aug
2 years ago

michaelvolst left a reply on Parent/Child Component

It worked thanks, I just needed to think a little bit different!

michaelvolst left a reply on Parent/Child Component

Hey thanks for your answer. you have brought me on a idea. I will test it out and let you know if it worked

07 Aug
2 years ago

michaelvolst started a new conversation Parent/Child Component

Heey,

I know have a department component which hold all the departments with the tasks associated with it.

Currently I am filtering with a computed property on the Tasks component when they are done, but now I would like to put a class on the parent component (department) on the div.list an extra class for when every task is done.

I would like to know how I can achieve this, currently I have used v-ref and v-el, but none of them worked for me.

Maybe one of you can help me out with this problem.

department.vue

{{ department.name }}

{{ department.user.name }} import Tasks from './Tasks.vue'; export default { name: "Departments",
props: ['departments'],

components: { Tasks }

}

tasks.vue

import _ from 'lodash'; import Task from './Task.vue';

export default { name: 'Tasks',

props: ['tasks'],

components: { Task },

computed: { isListDone(){ return _.filter(this.tasks, (task) => { return !task.done }) } }

}

.finished > li{ opacity: .5 }
11 Jun
2 years ago

michaelvolst left a reply on Api Saving Data

No problem, sorry I that I didn't responded a little bit quicker. But great that you managed to find the solution!

michaelvolst left a reply on Api Saving Data

Sorry for my late reaction, but is your app already working ?

09 Jun
2 years ago

michaelvolst left a reply on Api Saving Data

What you can do is prepare it with formdata api and then send it to your controller/route? But it is odd that this doesn't work right out of the box.

I'm also currently not sitting behind a computer, but maybe I can reproduce what you have so far and I can debug it with you together

michaelvolst left a reply on Api Saving Data

Are you using v-model on your inputs?

09 May
2 years ago
04 May
2 years ago

michaelvolst left a reply on CORS And VueJS.

@lstables he is using the api from his ip camera, not laravel

michaelvolst left a reply on CORS And VueJS.

I have found this video on YouTube https://youtu.be/wFwRnZESNi0

Maybe you can use it for your own camera

michaelvolst left a reply on CORS And VueJS.

Can you maybe show me some code from vue?

And is it also possible that your using something else from the api? Just grab the image for in example and then get every second a new image?

03 May
2 years ago

michaelvolst left a reply on CORS And VueJS.

I was wonderen what url do you request for? Is it the ip adress of your camera?

Can you tell me the Url?

29 Apr
2 years ago

michaelvolst left a reply on From Database To JS To Vue

Currently I am creating components created with Vue and passing the data with props

michaelvolst left a reply on Hierarchical Tables With Vue

Vuejs has an example of a tree structure

http://vuejs.org/examples/tree-view.html

michaelvolst left a reply on Vue Components + Pusher.js

I personally haven't dealt with pusher yet, but maybe you could make all the components that uses pusher extend a global pusher component just like Jeffrey way did in his chart series, this way you don't have to setup pusher every time.

https://laracasts.com/series/charting-and-you

27 Apr
2 years ago

michaelvolst left a reply on Vue-resource: Cannot Read Property '$http' Of Undefined

Why don't you save it to your package.json file with npm?

Npm install --save vue-resource

import vueResource from 'vue-resource';

Vue.use(vueResource);

23 Mar
2 years ago
18 Mar
3 years ago

michaelvolst left a reply on Vuejs Multilanguage App

haha It did yeah! And I also looked at your profile

17 Mar
3 years ago

michaelvolst left a reply on Vuejs Multilanguage App

Sorry for my late reaction!

Thanks love it! I'd really appreciate it!

I also see you're from the netherlands too!

15 Mar
3 years ago

michaelvolst left a reply on Vuejs Multilanguage App

This is pretty cool you did there! But I was thinking when the page loads I should detect what language the browser is using and load the correct language in to the vuex store, so components can load it in

michaelvolst started a new conversation Vuejs Multilanguage App

Hey!

I would like to build a spa with vuejs, I already have done this on admin pages and love vuejs! But now I have to build something bigger and more complex and it also has multiple languages, I was wondering how I would structure this in vuejs with vuex as the store. I already have some examples and plugins as well but it wasn't what I was looking for, maybe someone can help me with an example on this subject. Still I haven't build anything yet, so I don't have any examples for you.

12 Mar
3 years ago
09 Feb
3 years ago

michaelvolst left a reply on Adding Newly Inserted Record To List

http://vuejs.org/api/#vm-set

This is the Api, you also could look at vue resource where they show you a little example how to use it

https://github.com/vuejs/vue-resource

michaelvolst left a reply on Adding Newly Inserted Record To List

Why don't you use $set again or let vue refetch your items again?

michaelvolst left a reply on [Vue] Is There Something Equivalent To $update?

What I would do is using the $set method again and let it use the new post, so you would create a new array or if you would relocate back to the other component with $router.go you can fetch it again on the server.

I am not sure if this is what you're after. Let me know!

05 Feb
3 years ago

michaelvolst left a reply on Real Time Update Between 2 Components?

What you could do is syncing the component between each other.

This is also explained here http://vuejs.org/guide/components.html#Props and here http://vuejs.org/guide/components.html#Prop_Binding_Types

And off course you should import the component you want to be synced

michaelvolst started a new conversation Gmail Connection Could Not Be Established With Host Smtp.gmail.com

Heey there,

Recently I had trouble setting up gmail on my forge server on digitalocean, because I didn't need something like mandrill or mailgun. Just something simple. Everytime I wanted to send an email to my own account and used the server I had this error, but not on my local machine. I searched everywhere, but couldn't find a decent answer that solved the problem, so I ended up with digitalocean using their support ticket system.

The guy that helped said that I sent my mail over ipv6 rather than ipv4.

He told me that I had to edit this file /etc/gai.conf on the server.

So you should do sudo nano/vim /etc/gai.conf

And you should uncomment this line "precedence ::ffff:0:0/96 100"

This should force the server to connect with ipv4 over ipv6

And restart your server in the forge control panel or do it manualy

I thought this would help you guys/girls out and off course the credits goes to digitalocean and their support team

michaelvolst left a reply on Vue Unknown Custom Component

I recently created an application using vue and used this approach as well, what I ended up doing was:

import pages from './partials/pagination.vue' import category from './partials/Category.vue' import expendable from './partials/Expendable.vue' export default {
    data() {},

    created() {},

    computed: { },

    methods: {  },

    components:{
        pages, 
    category, 
   expendable
    }
}

Evan you the creator created a clone of hackernews and used this approach as well

Here is a link to the repo https://github.com/vuejs/vue-hackernews

10 Nov
3 years ago

michaelvolst left a reply on AWS S3 And Filesystem

http://laravelcoding.com/blog/laravel-5-beauty-upload-manager

This a step by step guide, it helped me! I hope it helps you too!

12 Sep
3 years ago

michaelvolst left a reply on Error Trying To Upload A File On Amazon S3

In your composer.json your requiring the V2 package but you will be needing the v3 package.

Amazon S3: league/flysystem-aws-s3-v3 ~1.0

21 Aug
3 years ago

michaelvolst left a reply on Vue.JS, Chunk Array

You also could take a look at the ng-repeat from angular, because they look similar

And maybe you could extract this logic into a filter or something

http://stackoverflow.com/questions/21644493/how-to-split-the-ng-repeat-data-with-three-columns-using-bootstrap

http://stackoverflow.com/questions/27211799/angular-ng-repeat-add-bootstrap-row-every-3-or-4-cols

18 Aug
3 years ago

michaelvolst left a reply on Error On S3 Uploading - Laravel 5

In the documention it says that you should require the v3 package

Amazon S3: league/flysystem-aws-s3-v3 ~1.0

Maybe this will help you

09 Jun
3 years ago

michaelvolst left a reply on Dropdown Menu Laravel 5

I found the answer, It wasn't loading my js files

michaelvolst left a reply on Dropdown Menu Laravel 5

It doesn't work for me.

the problem is I'm going to the url http://some.app/categories/ the multi level dropdown is working, but if I'm going to http://some.app/categories/portrait for example the multi level dropdown isn't working anymore. Also if I'm going to for example about, the url is going to be http://some.app/categories/about

michaelvolst left a reply on Dropdown Menu Laravel 5

@lstables Thanks for your quick reply but im not using this within a form.

I'm using it like this:

Right Nav Section -->
  • Home
  •   <!-- //showing the portfolios -->
    
      <li class="has-dropdown">
        <a href="{{ route('portfolio.index') }}">Portfolio</a>
        <ul class="dropdown">
      @if ($portfolios)
        
        @foreach($portfolios as $portfolio)
    
          {!! renderPortfolioMenu($portfolio) !!}
            
        @endforeach
        
      @endif
        </ul>
      </li>
    
    
    
     <!--  //showing the menus -->
    
      @if ($menus)
        @foreach($menus as $menu)
    
          {!! renderSubMenu($menu)!!}
            
        @endforeach
      @endif
      <li><a href="{{ route('blog.index') }}">Blog</a></li>
      <li><a href="{{ route('contact') }}">Contact</a></li>
    </ul>
    

function renderPortfolioMenu($node){

if( $node->isLeaf() ) { return "

  • <a href='" . route('portfolio.show', $node->slug) . "'>{$node->name}
  • "; } else {

    $html = "<li class='has-dropdown'><a href='" . route('portfolio.show', $node->slug) . "'>{$node->name}</a>";
    
    $html .= '<ul class="dropdown">';
    
    foreach($node->children as $child)
      $html .= renderPortfolioMenu($child);
    
    $html .= '</ul>';
    
    $html .= '</li>';
    

    }

    return $html;

    }

    michaelvolst started a new conversation Dropdown Menu Laravel 5

    Heey there,

    I am currently using foundation for my dropdown menu and I want to show all of the categories inside of the dropdown

    And it does work when the url is like demo.app/categorie but if im going to demo.app/categories/portrait the dropdown doesn't work anymore

    I'm also using the Baum package to handle nested categories.

    this is the CategoryController: public function show($slug){ $categories = Category::where('slug', $slug)->firstOrFail();

    return view('category.show', compact('categories'));
    

    }

    Routes.php: Route::get('categorie/{slug}', [ 'as' => 'category.show', 'uses' => 'CategoryController@show' ]);

    I'm not sure what I'm doing wrong, maybe you guys could help me out with this problem.

    04 May
    3 years ago

    michaelvolst left a reply on Structure Database Multilanguage Cms

    Everyone thanks for your help!

    I think I will go with the solution provided by @taijuten

    03 May
    3 years ago

    michaelvolst left a reply on Structure Database Multilanguage Cms

    @taijuten I would like to create something like this http://www.qdel.nl/webshop/interlayer-active/dutchled/_381_w_16__GB where you can switch between languages and create differents categories where the links are also translated.

    @bashy im not sure how I would structure that. Can you maybe help me writing this out?

    michaelvolst left a reply on Structure Database Multilanguage Cms

    Thanks for your reaction @taijuten !

    I know this is a very broad question, I've been looking on forums how I could would structure the database.

    I already have something like this and I would like to use the column approach, because I know I won't be adding more languages.

    Schema::create('pages', function(Blueprint $table)
        {
            $table->increments('id');
            $table->tinyInteger('visible');
            $table->integer('position');
            //title
            $table->string('title_nl');
            $table->string('title_en');
            $table->string('title_es');
            $table->string('title_de');
            //content
            $table->text('content_nl');
            $table->text('content_en');
            $table->text('content_es');
            $table->text('content_de');
            $table->timestamps();
        });
    

    I'm also going to add a assortment page which will contain categories and the categories will be contain the articles , but how should I structure/connect this? Should I be using pivottables here? Or

    michaelvolst started a new conversation Structure Database Multilanguage Cms

    Heey!

    I'm currently creating a cms that supports multiple languages, but I was wondering how should I structure the database.

    I know there are a lot of cms out there but I would like to create my own from scratch.

    I hope someone can help me out.

    Michael