michaelvolst

michaelvolst

Member Since 6 Years Ago

Huizen, the Netherlands

Experience Points
132,875
Total
Experience

2,125 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
1336
Lessons
Completed
Best Reply Awards
2
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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 27
132,875 XP
Mar
28
2 years ago
Activity icon

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 x

Log x √ x x √

Mar
23
2 years ago
Activity icon

Started a new conversation Help 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 < $counter; $i++) {
          $table[$i]['day_number'] = $day->day_number;
          $table[$i][$day->day_number]['finished'] = $log->finished;
          $table[$i][$day->day_number]['status'] = $log->status; 
        }
      }
    }
Jan
04
2 years ago
Activity icon

Started a new conversation How To Handle A Large Form

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 a better idea let me know!

Aug
09
3 years ago
Activity icon

Replied to Parent/Child Component

Hey sorry for my late reaction. The department component is a child of the dashboard component and from there I used v-for. So I didn't have to use 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>
Aug
08
3 years ago
Activity icon

Replied to Parent/Child Component

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

Activity icon

Replied to 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

Aug
07
3 years ago
Activity icon

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.

@JeffreyWay @jvv

department.vue

<template>
  <div class="content">
    <div class="list" v-for="department in departments">
      <img class="person" :src="'/uploads/users/' + department.user.avatar" alt="{{ department.user.name}}"/>
      <h2>{{ department.name }}</h2>
      <div class="subtitle">
        <span class="location">
          <i class="fa fa-user" aria-hidden="true"></i>
          {{ department.user.name }}
        </span>
      </div>
      <tasks :tasks="department.tasks"></tasks>
    </div>
  </div>
</template>

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

    props: ['departments'],

    components: { Tasks }

  }
</script>

tasks.vue

<template>
  <ul :class="{ 'finished': !isListDone.length}">
    <li v-for="task in tasks">
      <task :task="task"></task>
    </li>
  </ul>
</template>

<script>
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
      })
    }
  }

}
</script>

<style scoped>
  .finished > li{
    opacity: .5
  }
</style>
Jun
11
3 years ago
Activity icon

Replied to 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!

Activity icon

Replied to Api Saving Data

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

Jun
09
3 years ago
Activity icon

Replied to 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

Activity icon

Replied to Api Saving Data

Are you using v-model on your inputs?

Can you maybe show us some code of your form?

May
09
3 years ago
May
04
3 years ago
Activity icon

Replied to CORS And VueJS.

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

Maybe you can use it for your own camera

Activity icon

Replied to 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?

May
03
3 years ago
Activity icon

Replied to 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?

Apr
29
3 years ago
Activity icon

Replied to From Database To JS To Vue

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

Activity icon

Replied to Hierarchical Tables With Vue

Vuejs has an example of a tree structure

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

Activity icon

Replied to 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

Apr
27
3 years ago
Activity icon

Replied to 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);

And if you are using laravel for your backend you might need to set up your x-csrf-token in the headers

https://laravel.com/docs/5.2/routing#csrf-x-csrf-token

Mar
23
3 years ago
Mar
18
3 years ago
Activity icon

Replied to Vuejs Multilanguage App

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

Mar
17
3 years ago
Activity icon

Replied to Vuejs Multilanguage App

Sorry for my late reaction! @jvv

Thanks love it! I'd really appreciate it!

I also see you're from the netherlands too!

Mar
15
3 years ago
Activity icon

Replied to 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

Activity icon

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.

Mar
12
3 years ago
Activity icon

Replied to Localization Series

+1

Feb
09
3 years ago
Activity icon

Replied to 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

Activity icon

Replied to Adding Newly Inserted Record To List

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

Activity icon

Replied to [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!

Feb
05
3 years ago
Activity icon

Replied to 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

Activity icon

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. 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 me 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

Activity icon

Replied to 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

Nov
10
3 years ago
Activity icon

Replied to 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!

Sep
12
4 years ago
Activity icon

Replied to 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

Aug
21
4 years ago
Activity icon

Replied to 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

Aug
18
4 years ago
Activity icon

Replied to 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

Jun
09
4 years ago
Activity icon

Replied to Dropdown Menu Laravel 5

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

Activity icon

Replied to 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

Activity icon

Replied to 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>
    
Activity icon

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.

May
04
4 years ago
Activity icon

Replied to Structure Database Multilanguage Cms

Everyone thanks for your help!

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

May
03
4 years ago
Activity icon

Replied to 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?

Activity icon

Replied to 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 contain the articles , but how should I structure/connect this? Should I be using pivottables here?

I hope that I have explained it well enough.

Activity icon

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