Our Black Friday sale is now live! All individual subscriptions are 50% OFF. This week only!

bobbybouwmann

bobbybouwmann

Developer at Enrise

Member Since 6 Years Ago

Apeldoorn, The Netherlands

Experience Points
1,999,065
Total
Experience

0 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
1770
Lessons
Completed
Best Reply Awards
2625
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 50
1,999,065 XP
Nov
23
2 days ago
Activity icon

Replied to Laravel Nova: Delete Images From Disk When Content Is Modified And Image Is Removed

@frazecolder I don't think you can do that, because the event is triggered on the model itself.

If you need something like that, you should probably fire your own event in Nova and use that event to handle those extra cases.

Activity icon

Awarded Best Reply on Travel And Expense Management Database Schema

I would probably add the fields in the first place to the same table and make them nullable. Only if you start the additional fields for multiple declaration types you should consider refactoring it.

If you decide to do it right away, I would probably create a polymorphic relationship to create the different kinds of expenses that you can store.

In most cases, start with the simplest approach ;) Keeping it simple will benefit you in most cases in the long run.

Nov
21
4 days ago
Activity icon

Awarded Best Reply on Laravel Nova: Delete Images From Disk When Content Is Modified And Image Is Removed

You can use the saving model event to modify the data before it's stored in the database. By using that in your observer or using the boot method of you're model, it should work for you ;)

https://laravel.com/docs/8.x/eloquent#events

Activity icon

Replied to Laravel Nova: Delete Images From Disk When Content Is Modified And Image Is Removed

You can use the saving model event to modify the data before it's stored in the database. By using that in your observer or using the boot method of you're model, it should work for you ;)

https://laravel.com/docs/8.x/eloquent#events

Activity icon

Replied to Travel And Expense Management Database Schema

I would probably add the fields in the first place to the same table and make them nullable. Only if you start the additional fields for multiple declaration types you should consider refactoring it.

If you decide to do it right away, I would probably create a polymorphic relationship to create the different kinds of expenses that you can store.

In most cases, start with the simplest approach ;) Keeping it simple will benefit you in most cases in the long run.

Nov
16
1 week ago
Activity icon

Replied to Message: "CSRF Token Mismatch." Laravel

You specify a CSRF token twice here, first in the headers, and then also in the _data key. It could be that one of the tokens is incorrect and therefore it fails. Start with trying one of the approaches instead of both.

Nov
15
1 week ago
Activity icon

Replied to Laravel Sanctum Returns 500 When Trying To Access Sanctum Protected API

Yeah, Laravel automatically assumes you use a bigInteger for the id column of the users table. You can use something else like a UUID, but you would need to override a lot of things in Laravel.

Instead, I would recommend you to keep the bigInteger for the id column in your users table and use an additional uuid column that you can use in the rest of your application.

In this case, you're working too much against the framework defaults that it takes a lot more time to rebuild all those tables and refactor parts of the packages that it's better to use a normal ID.

Note that Sanctum is a way to get started easily, this is really an edge case situation in which the package doesn't provide.

Nov
12
1 week ago
Activity icon

Replied to Composer Wont Extract Files

Well, if you look at the path you can see that the path is incorrect for a windows machine.

You can try to clear your composer cache first by running composer clearcache and then composer install again. You can also try to remove your vendor directory completely and run composer install again.

Nov
11
2 weeks ago
Activity icon

Replied to Composer Package Issue

Mmh, it seems it can't find some file on packagist, the place where all packages are hosted.

This first thing I would try is running composer clear-cache. It could be that something has changed on one of the repos which are pointing to a different URL now

If that doesn't work you can remove your vendor directory and compoer.lock file and run composer install again and see what happens.

Oct
31
3 weeks ago
Activity icon

Awarded Best Reply on User Registration Using Vue

@premisoft Please show your controller. You probably still have something in there that doesn't belong htere.

Activity icon

Replied to Laravel Nova Action Progress Indication

This is a pretty big question because Laravel Nova itself doesn't support this. The actions itself always return only one response, so you can't handle it using that approach.

An alternative solution is redirecting the user to a page in Nova where you can show the processing part. You then also need to set up a queue that will handle all the invoices. Based on the data in the database you can decide how many of the invoices have been generated and display it on that page. You can create your own Nova tool that will handle the ajax requests for you, so you can poll it every x seconds or use web sockets to keep track of the count.

There is no a few lines of code solution for you here. You have to remember that Nova works for 80% of the cases and this is not one of them.

Activity icon

Replied to REST API Design For HasMany POST/PUT

I would put the foreign key in the body of your request. So something like this

POST /api/vX/workouts

{
    "name": "",
    "exercise_ids": [ 14, 454, 78, 1 ]
}

With a simple array, you only need to send the IDs. That should be good enough in your case ;)

Activity icon

Replied to Performance Of WhereHas Laravel

You can replace it using a join instead. If you use a join, you can replace the with and whereHas as well. However, you will get a different structure object than you might want to have.

Looking at your controller code, I would recommend limiting the number of results you return. Use ajax requests on the page itself to retrieve the related data or use pagination. This way the query will be a lot faster as well ;)

Oct
30
3 weeks ago
Activity icon

Replied to Spatie Media-Library - Resize Main Image While Adding It To Media

The media library package doesn't support this functionality.

The reason being is that the original image is needed to perform certain actions in the package. You can of course delete the original image yourself after you're done with upload but I wouldn't recommend that ;)

Oct
28
4 weeks ago
Activity icon

Awarded Best Reply on How To Organize Multiple Projects Into A Single Project ?

You could make separated directories per service in your app/Http/Controllers directory. That should already be enough.

But as I understand it, you already have 4 projects. You can also combine them using an API and simply call the API on the homepage to get the service working. Otherwise, copy-pasting the controllers and models should already be enough ;)

Oct
24
1 month ago
Activity icon

Replied to The Token Could Not Be Parsed From The Request

It seems you're not providing the correct authentication token here. You have two options for that. Either as a header or part of the URL

For the header option, add this header

Authorization: Bearer {{ YOUR_TOKEN }}

Or using the URL

https://example.com/some-url?token={{ YOUR_TOKEN }}

Here are some people with the same issue: https://stackoverflow.com/questions/39218757/laravel-jwt-auth-the-token-could-not-be-parsed-from-the-request

Oct
21
1 month ago
Activity icon

Awarded Best Reply on Scraping Kijiji And FB Marketplace Data

Well, it depends on what you want to scrape from the specific websites. Those requirements determine what kind of package or API you need to use.

This is a good package for most use cases: https://github.com/spatie/crawler

Activity icon

Replied to Github Actions Push To Deploy

It looks like you configured the SSH key incorrectly. Did you add a secret for your SSH key? And did you copy in the correct value in there?

You can find some pointers here: https://github.com/appleboy/ssh-action/issues/6

Oct
20
1 month ago
Activity icon

Awarded Best Reply on Best Practice: Testing Nova Resources.

Yeah, Nova resources are a bit hard to test in the regular PHPUnit way.

The easiest way to write proper tests for this is by using Laravel Dusk. That is also how Laravel Nova itself is tested. You can assert certain things in the view and assert if actions do the correct thing. You can then verify in the database if everything was correct.

Another solution for example is doing a get request to the API call that is being called underwater for Nova itself and assert the response in there. However, Laravel Nova fires multiple API requests for once view, so you need to be aware of this.

Activity icon

Awarded Best Reply on Create L8 API - Not An SPA, No Passport Needed, Plain Old API

In older versions (5.8 for example) I could simply create an api_token field on the user's table and get cracking.

This approach should still work out of the box, as long as you set your auth guard to api. You can see the token implementation from Laravel here: https://github.com/laravel/framework/blob/8.x/src/Illuminate/Auth/TokenGuard.php

Make sure you send the correct headers in Postman.

Accept: application/json
Content-Type: application/json
Activity icon

Replied to Create L8 API - Not An SPA, No Passport Needed, Plain Old API

In older versions (5.8 for example) I could simply create an api_token field on the user's table and get cracking.

This approach should still work out of the box, as long as you set your auth guard to api. You can see the token implementation from Laravel here: https://github.com/laravel/framework/blob/8.x/src/Illuminate/Auth/TokenGuard.php

Make sure you send the correct headers in Postman.

Accept: application/json
Content-Type: application/json
Activity icon

Replied to Scraping Kijiji And FB Marketplace Data

Well, it depends on what you want to scrape from the specific websites. Those requirements determine what kind of package or API you need to use.

This is a good package for most use cases: https://github.com/spatie/crawler

Activity icon

Replied to Github Actions Push To Deploy

Yes and yes. What exactly is your question?

Oct
19
1 month ago
Activity icon

Replied to Using Yajra Datatables - Running Out Of Memory

The only way to make a large data set work is by using pagination. Even if your application (after throwing more memory at it) can handle it, your browser at some point can't take it anymore.

I would rather advise you to add some kind of search and filter options so you can limit the results you display ;)

Oct
18
1 month ago
Activity icon

Replied to Run Migrations Through .ebextensions File?

Are you sure you have the .env set up correctly and there is an actual working database connection? It could be that php artisan migrate just fails because it can't connect to the database.

You should be able to see some logs in storage/logs/laravel.log.

Activity icon

Awarded Best Reply on Composer Command

The command regenerates the list of all classes that need to be included in the project (autoload_classmap.php).

In Laravel the autoload_classmap.php also includes the providers in config/app.php. So when run this command your providers are being registered again.

Oct
17
1 month ago
Activity icon

Replied to Creating Db

Yes you can. You can use the config helper to switch database connections, by setting a new database setting. You can also run the artisans command programmatically. You can use the filesystem class or file_put_contents and create new migrations files and run the migrate command. That should all work ;)

Do note that if you generate migrations files on the fly, you won't have them in your code and probably also not in your version control. This could be dangerous.

Oct
15
1 month ago
Activity icon

Replied to Vue Js Flash Component Not Working When Npm Production Works Npm Run Dev

@andiliang Aah great you found the solution. I didn't know you showed it based on a generated class ;)

Oct
14
1 month ago
Activity icon

Replied to How To Validate Grading System In Model And Controller

Well, the only way to do this here correctly is using a custom rule class. In this class, you can create your own query based on the given values to check if a Gradesystem model already exist

Documentation: https://laravel.com/docs/5.8/validation#custom-validation-rules

Activity icon

Replied to How Can You Get One Random Result From A "morphedByMany" Relationship?

@chrislentz Aah yeah, this is correct. This is because the morph queries use a join. So I don't think there is a way to make this work with just one result then...

You're probably better of with a raw query here, but then you need a way to also include the poster relationship. Eloquent works for 95% of the cases, but sometimes it's a pain in the as.

Activity icon

Replied to Find Item That Has Different Names But Refer To The Same Item

Well, you have a few options here. The basic idea is the same though. You need to have a central place where you can map the name to a generic name. This can be a database or a config file as an example. Once you have a lookup structure like that, you can write one method that always gives back to the correct string for you, no matter what you feed it.

Here is a database example

$courseName = CourseNames::where('name', 'Ingl├ęs I')->first();
$courseName = CourseName::find(($courseName->parent_id);

$course = Course::where('name', $courseName->name)->where('num', $num)->first();

Another solution is using a one-to-many relationship. between course and coursename. This way, you can make it even simpler

As you can see, lot's of options here.

Activity icon

Replied to Leaderboard Rewards

@jeffreyway THE SOCKS!! DON'T FORGET THE LARACASTS SOCKS! I NEED IT!!

Activity icon

Replied to Leaderboard Rewards

Hee @jeffreyway

Thanks for reaching out! It's great that your working on a different reward system, other than experience points. I personally backed down a little bit the last few months, to give other people a chance to answer questions and step up in the community. I still love doing it, and I will keep doing it for sure ;)

I definitely think a month or quarterly reward system would give newcomers to the community a kickstart for sure. The leaderboard itself is very cool, so it would be nice if we probably can keep both. Where you have the "old" people and the "new" people who put in an effort for a few months.

Regarding the rewards. A new set of unique badges would be cool. Since the introduction of badges, there is some kind of gamification in Laracasts. I personally have all badges, so it would be cool to see some new ones. Could even be a badge like "Monthly top contributor", "Guest speaker" or even "Watcher of 99% of the content". I think there are a ton of badges you can still come up with.

Finally, I want to thank @jeffreyway for all the opportunities Laracats brought me. I got the chance to help others get their dream job, make them better developers, and build a name in the community. Since I started contributing to Laracasts I have spoken at conferences and meetups, I found a full-time job as Laravel Evangelist, I'm part of multiple startups and have been consulting on Laravel. Even released my own video here on Laracasts. How awesome is that?

Activity icon

Awarded Best Reply on Laravel Passport Access Tokens Timezone

That depends on what you put in the token of course. You can create time-based tokens in theory.

My first thought would be to double-check the time on the server itself. Are they up to date at all? If not, you should fix that first ;)

If that is not the issue, can you tell us more about your setup?

Activity icon

Replied to Laravel Passport Access Tokens Timezone

@neilstee Awesome! Could you mark the answer then ;) Might be useful for others as well

Oct
11
1 month ago
Activity icon

Replied to How Can You Get One Random Result From A "morphedByMany" Relationship?

I would expect that the second example would work here... If you have the laravel debugbar package or laravel telescope installed you can see what exact queries are performed. Laravel doesn't make a join query here, but instead it uses multiple queries to fetch each relationship.

Activity icon

Awarded Best Reply on Laravel Auth - Maser Password

So you are on the correct path. However, Laravel uses $fillable for all the fields you can edit in your User model. By default, it whitelists the fields you can insert/update. However, permission_level is probably not part of this list

Here is where you need to look for: https://github.com/laravel/laravel/blob/master/app/Models/User.php#L19

Oct
10
1 month ago
Activity icon

Replied to Get The Ftp Upload Percentages With Laravel FileSystem

You can do a check if the files exist, right? Just doing an ajax call to the backend should fix that

Activity icon

Replied to Security For SPA

I'm personally a big fan of splitting the backend from the frontend. You can still use the cookie-based authentication layer, as long as you run both websites on the same base domain. So you can run your API on api.example.com en run your frontend on example.com. That way the cookie should work just fine ;)

I do see a challenge when you start using a mobile app. I think it's harder to keep a cookie in there for the authentication. If you decide to connect multiple systems to your backend I would highly recommend Laravel Passport instead of Sanctum since it's more flexible for different ways of authentication.

Activity icon

Replied to Trying To Get Property 'ProjName' Of Non-object

Well, you can' do this

@foreach($project as $project)	

@endforeach

You assign the same variable here. I would expect the $projects variable here instead

@foreach ($projects as $project)

@endforeach

Can you show your controller that returns this variable?

Activity icon

Replied to Vue Js Flash Component Not Working When Npm Production Works Npm Run Dev

Mmh, that is very odd. npm run production is doing the same thing as npm run dev, but instead it just minifies everything.

Are you sure this.flash is correct here? I see that you assign window.flash, should you call window.flash in your component instead?

Activity icon

Replied to Get The Ftp Upload Percentages With Laravel FileSystem

You need some kind of library for this to make this work. This is not something Javascript supports out of the box. Here is a useful tutorial: http://www.onlinecode.org/php-laravel-file-upload-with-progress-bar-example/

Activity icon

Replied to Laravel Auth - Maser Password

So you are on the correct path. However, Laravel uses $fillable for all the fields you can edit in your User model. By default, it whitelists the fields you can insert/update. However, permission_level is probably not part of this list

Here is where you need to look for: https://github.com/laravel/laravel/blob/master/app/Models/User.php#L19

Oct
08
1 month ago
Activity icon

Replied to Best Practice: Testing Nova Resources.

Yeah, Nova resources are a bit hard to test in the regular PHPUnit way.

The easiest way to write proper tests for this is by using Laravel Dusk. That is also how Laravel Nova itself is tested. You can assert certain things in the view and assert if actions do the correct thing. You can then verify in the database if everything was correct.

Another solution for example is doing a get request to the API call that is being called underwater for Nova itself and assert the response in there. However, Laravel Nova fires multiple API requests for once view, so you need to be aware of this.

Activity icon

Awarded Best Reply on Help Calling Key From Folder Config File Services.php

Did you clear your config? It could be that your .env is cached. Try running php artisan config:clear

If that doesn't work you can try to debug it by doing dd(config('services')) to see what kind of data that whole array hokds.

Activity icon

Replied to Memory Error Trying To Use Socialite/passport

Above method doesn't work for windows. Try this

set COMPOSER_MEMORY_LIMIT=99999999999 && php -d memory_limit=-1 composer.phar update

Replace composer.phar with the correct path