bobbybouwmann

bobbybouwmann

Developer at Enrise

Member Since 5 Years Ago

Apeldoorn, The Netherlands

Experience Points
1,883,755
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
1710
Lessons
Completed
Best Reply Awards
2489
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,883,755 XP
Aug
09
22 hours ago
Activity icon

Replied to How To Assess Coding Skills Specific To PHP And Laravel?

@laracastsluvr Well, yeah we fire them and start over. However, we always discuss the code with the person itself, so if they cheated we will notice it right away. They won't be able to explain what the code is doing or how to implement a different solution. We also put some trust in people. You can't know anything.

If you did the challenge in 20minutes, you probably didn't write many tests. I would be very curious to see your implementation ;)

Activity icon

Replied to SImple Dusk Test From Manual Fails

Well, if you only run the migrations there won't be any data. You need to use a seeder class or the factory to create a new user that you can use to login with. So DatabaseMigrations is correct for your tests, but you also need to add data so you can work with it

Activity icon

Replied to Is This The Correct Way To Display Unread Notification?

The notifications itself only have a user_id stored. Instead, you need to fetch the user using the relationship

@foreach($notifications as $notification)
    {{ $notification->notifiable->name }}
@endforeach
Activity icon

Awarded Best Reply on Horizon Doesn't Read Jobs From Redis

Yeah, Horizon only works for Laravel project and installed on the same project. Also running horizon and queue:work together is not a good option. You need to use one of them ;)

Activity icon

Awarded Best Reply on Modify User In Controller - Integrity Constraint Violation: 4025

Did you make the connection_discord and connection_github columns nullable? These values are not set right now and could cause issues because of that.

Also, are these columns of the type JSON in your migration?

Activity icon

Awarded Best Reply on User Roles Are Fetching In Create User Form But Not Adding User Role In Database

You didn't give your input a name and therefore it's never posted. Try this

<label>
    <input type="checkbox" value="{{$role->id}}" name="roles[]">
    {{ $role->display_name }}
</label>
Activity icon

Replied to Modify User In Controller - Integrity Constraint Violation: 4025

Did you make the connection_discord and connection_github columns nullable? These values are not set right now and could cause issues because of that.

Also, are these columns of the type JSON in your migration?

Activity icon

Replied to Horizon Doesn't Read Jobs From Redis

Yeah, Horizon only works for Laravel project and installed on the same project. Also running horizon and queue:work together is not a good option. You need to use one of them ;)

Activity icon

Replied to Polymorphic Trait?

I'm not sure what you mean, that you need to use the store method here. You already have this working with the follow method of the trait, right?

You can always do this

$anotherUser()->follow(); // The current logged in user is now following anotherUser

So your store method should simply be using the follow method o the model you have.

public function store($model, $id)
{
    $model->follow();

    return back();
}
Activity icon

Replied to Error Install Tailwindcss In Laravel

You have to run each line in any terminal. As long as you're in the correct path. The root of your project.

Activity icon

Replied to User Roles Are Fetching In Create User Form But Not Adding User Role In Database

You didn't give your input a name and therefore it's never posted. Try this

<label>
    <input type="checkbox" value="{{$role->id}}" name="roles[]">
    {{ $role->display_name }}
</label>
Activity icon

Replied to Display Modal For Specific User

I'm not sure what you're asking here. You only want to select one class and do all the logic based on that? Well, it depends on your structure if this is possible.

You can, for example, do this instead (if I understand you correctly)

displayUserBanModal: function(){
    var banModalBtn = $('.showUserBanModal');

    var banModal = banModalBtn.closest('.modal--ban');

    banModalBtn.on('click', function(e){
        e.preventDefault();
        banModal.toggleClass('is-active');
    });
}

This might be a bit more future proof because it doesn't matter what HTML is around it. You still need to be specific about the model classes though

Activity icon

Replied to Livewire Id

You should probably create an issue on the GitHub page because this sounds like an issue inside Livewire itself.

Aug
08
1 day ago
Activity icon

Replied to Is This The Correct Way To Display Unread Notification?

You only need to use the auth() part inside your controller or view composer (if you use that). No need to fetch the data twice here. Right now, you fetch it twice, because auth()->user()->unReadNotifications will perform a query and Auth::user()->unReadNotifications will perform the same query.

Where are you displaying these notifications? Only on the profile or also in a sidebar for example?

Activity icon

Replied to Error Install Tailwindcss In Laravel

Have you tried doing a full reset?

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
Activity icon

Replied to Cpu Spiked On Digital Ocean Ubuntu 5$

Well, this can be a lot of things. It depends on how much data your parse and if you then do stuff with the collection for example. So we need to know more about the code you're performing to help you out here.

Activity icon

Replied to Polymorphic Trait?

Where do you call this store method? On what class do you call this?

Aug
07
2 days ago
Activity icon

Replied to Horizon Doesn't Read Jobs From Redis

You need to run php artisan horizon to start Horizon. The queue:work command is a completely different way of clearing the jobs from the queue ;)

Horizon itself will start a process on the background that keeps everything running and applies the number of processes and queues, while queue:work is a simpler approach of running jobs.

Activity icon

Replied to Convert Two State Input Field To Drop-down Component

Not sure what your question is?

Do you want us to help you convert the input to a select field? If so, we need to know a bit more about your current setup. What JS do you use? What have you tried so far?

Activity icon

Replied to Polymorphic Trait?

Like @s4muel suggested, you can use get_class to get the current namespace of the class. So something like this

public function follow()
{
      $attributes = ['model' => get_class($this), 'user_id' => auth()->id()];
}
Activity icon

Replied to Override Nova Resource

Your question is a bit vague but I think you want to reuse the same model for multiple resources in Nova, right?

So in that case, you can create a new resource, point to the same model, but update the indexQuery to fetch the correct results

class HolyMeal extends Resource
{
    public static $model = \App\Food::class;

    public static function indexQuery(NovaRequest $request, $query): Builder
    {
        $query = $query->where('type', 'holy_meal');

        return parent::indexQuery($request, $query);
    }
}

Another solution is creating multiple models and using a global query scope to determine the correct type. You can create multiple models that look at the same table.

Activity icon

Replied to Polymorphic Trait?

If you only add the trait to models this should work correctly, right? You can always use $this because that points to the current model that has this trait.

I'm not sure what else you're trying to achieve here.

Activity icon

Awarded Best Reply on The Video In My Carousel Doesn't Change, Even When I Click The Button

Did you include the javascript on that specific page?

You can find the documentation here: https://getbootstrap.com/docs/4.0/components/carousel/#usage

Activity icon

Replied to Http Client - Attach A File From S3 Doesn't Work...

So my best guess here is that the stream isn't completely fetched yet and therefore you can't send it. This happens with streams, because you only fetch parts. Just like a lazy collection for example. You only load what you need.

You probably need to fetch the file first and store it locally. Then you can send it through the request like.a normal file

Activity icon

Replied to The Video In My Carousel Doesn't Change, Even When I Click The Button

Did you include the javascript on that specific page?

You can find the documentation here: https://getbootstrap.com/docs/4.0/components/carousel/#usage

Activity icon

Replied to Modal

This could happen because you click next to the modal or because some other javascript code is closing it for you. I can't help you without seeing any of your current code

Aug
06
3 days ago
Activity icon

Awarded Best Reply on Laravel Redis And Centos

You can find the answers to set the password here: https://stackoverflow.com/questions/7537905/redis-set-a-password-for-redis

You can decide not to set the password. However, you need to make sure the outside world can't connect on the port of Redis. Otherwise, everyone can access your Redis instance. If you have Redis running on a different server the password is required.

Activity icon

Replied to How To Use @guest In The Vuejs Component

Can you show your current code?

Activity icon

Replied to How To Use Scope For Intermediatble Table In Many To Many Relationships

Well, the scope only works on the query builder object. However your selectedBatch method returns a Batch model. So you should remove the firstOrFail so you can keep chaining on the query.

Activity icon

Awarded Best Reply on Eloquent Relationships That Deal With 3 Tables

You can solve this using a join. Eloquent really can't help you here, because it's not a natural relationship.

Documentation: https://laravel.com/docs/7.x/queries#joins

Activity icon

Replied to Running In Console Micro Optimizations

It is unnecessary to do this. There is no code that actually runs this, except for the framework when booting. For example, the config file is something you always want available, not just when using the command line.

These micro-optimizations are overkill ;)

Activity icon

Replied to Is It Possible To Broadcast To Guests?

If you just use a regular pusher channel, it should be available for everyone. Only the private channels require some kind of authentication as far as I know.

Are you sure the pusher code is being loaded correctly if you're not logged in? Also, make sure that your broadcast routes don't have any extra middlewares that require authentication. You can run php artisan route:list to see the broadcast routes and what middleware they have.

Activity icon

Replied to Eloquent Relationships That Deal With 3 Tables

You can solve this using a join. Eloquent really can't help you here, because it's not a natural relationship.

Documentation: https://laravel.com/docs/7.x/queries#joins

Activity icon

Replied to How To Assess Coding Skills Specific To PHP And Laravel?

Hee hee,

In general, it's hard to hire the correct people right away. It's impossible to always hire the best or the right person. So you have to accept that you might make a mistake with this at some point. But that is good. You learn from those experiences ;)

I would personally not like a code assessment call where my interviewer would be watching me code. In general, when a developer is working they do it on their own. There might be some pairing from time to time or some discussion about how to solve something but in the end, the code is written on their own.

The company where I work also has a coding challenge. However, we let the person do this at home in their own time. We tell them to take around 2 to 3 hours to work on it. After that, they send us what they have and we look at that. The coding challenge itself has some challenges with an API. We leave the user free to set up a nice frontend and write tests for it. Based on those decisions we can already see what kind of coder this is. We review the code and then discuss it with the candidate. Maybe give some feedback or ask about how things can be solved differently if there was more time. They didn't complete the challenge but added tests for the most important parts, well that is way better than a person who spends two hours on some CSS to make it look good

You can find our code challenge below and you can use it for your own purposes ;) Let me know if you have any questions.

Laravel Coding Challenge

To do a small Laravel check-up we have thought out the following challenge for you. In general, this challenge should be completable in around 2 hours. It’s not a big issue if you take longer or don’t finish on time. The goal is to get a clear view of how you think and work.

The challenge

The challenge will contain a few core features most applications have. That includes connecting to an API, basic MVC, exposing an API, and finally tests.

The API we want you to connect to is https://kanye.rest/

The application should have the following features

  • A web page that shows 5 random Kayne West quotes (must)
  • There should be a button to refresh the quotes (must)
  • Authentication for this page should be done with a password (must)
  • An API route should be available to fetch 5 random Kayne West quotes (must)
  • The API route is secured with a token (nice to have)
  • Above features are tested with Feature tests (must)
  • Above features are tested with Unit tests (nice to have)
  • Provide a README on we can set up and test the application (must)

Notes

  • HTML/CSS/JS styling is not part of this, it doesn’t matter how it looks like.
Activity icon

Replied to From Blade To Vue

If it's really urgent you should hire someone who can do it for you ;)

Anyway, you have some data available in your controller right now and you want to use that data in Vue. You have two options here. Either pass the data from blade to your component or use an ajax request to fetch the data.

Here is a good example that will put you in the right direction: https://www.codechief.org/article/laravel-vue-js-axios-get-request-example#gsc.tab=0

Activity icon

Replied to View [attendances.style] Not Found.

Well, the error is pretty clear, right? You're trying to use a view that doesn't exist.

Can you show your view where you get this error?

Activity icon

Replied to Laravel Redis And Centos

You can find the answers to set the password here: https://stackoverflow.com/questions/7537905/redis-set-a-password-for-redis

You can decide not to set the password. However, you need to make sure the outside world can't connect on the port of Redis. Otherwise, everyone can access your Redis instance. If you have Redis running on a different server the password is required.

Activity icon

Replied to How To Use @guest In The Vuejs Component

You can pass in the value of auth()->check() or auth()->guest() to your component. This way you can determine inside your component what you want to display based on that value.

Activity icon

Awarded Best Reply on Migration For Creating Database

You can't do that with migrations, because it performs all queries against the configured database in your .env. If you want something like this, you need to perform this in a different place. Maybe a separate command that generates the database is better.

Activity icon

Replied to Method Illuminate\Database\Eloquent\Collection::links Does Not Exist. (View: C:\xampp\htdocs\mylearnwork\codehacking\resources\views\themes\blog\blog_front.blade.php)

Mmhm, this actually does look correct.

Can you do a dd in your controller on the $blogs variable to make sure it's actually a class with the type LengthAwarePaginator? If this is the case, this should work.

Activity icon

Replied to Required Confirm Password Before Delete Record

Laravel actually offers this functionality out of the box using a middleware for a certain route: https://laravel.com/docs/7.x/authentication#password-confirmation

This is just a basic integration. If you want to build something for yourself, you can redirect someone to a password field and set some data in the session so you know what other actions you need to perform. Another solution is using a popup that checks the password and only if the password is correct it submits the form itself.

Activity icon

Replied to Integrate Virtual Class Room In Laravel Application

Twillio offers this for you. I didn't get many requirements from you, so this is the best I can do.

Here is a tutorial for Laravel with Twillio: https://www.twilio.com/blog/2017/09/laravel-and-twilio-group-video-chat.html

Activity icon

Replied to Scheduled Job Constructor Not Called On Subsequent Calls In Containerized Environment

Your command never ends, and therefore the output is never written to the output. So your this->line in your command will never be written to the output.

Instead, it's better to fire a job and inside the job queue the same job again with a delay of 60 seconds. This way the job is always finished, a new job is queued and you can easily handle errors and so on.

Activity icon

Replied to How To Use Scope For Intermediatble Table In Many To Many Relationships

I'm not sure what you mean here, because your selectedBatch method doesn't use the points scope here.

If you mean to use the scope in the withPivot method then I can already tell that this won't work.

Activity icon

Replied to Unable To Resolve NULL Driver For [Illuminate\Mail\TransportManager]

@thomasvdw That error only happens if your mail config is configured incorrectly. So there is still something going wrong there.

Activity icon

Replied to Laravel Queues With SQS

@aem99 No problem ;)

Activity icon

Replied to Migration For Creating Database

You can't do that with migrations, because it performs all queries against the configured database in your .env. If you want something like this, you need to perform this in a different place. Maybe a separate command that generates the database is better.