bobbybouwmann

bobbybouwmann

Member Since 4 Years Ago

Apeldoorn, The Netherlands

Developer at Enrise

Experience Points 1,301,935
Experience Level 50

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 1463
Lessons
Completed
Best Reply Awards 1587
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.

26 Apr
10 hours ago

bobbybouwmann left a reply on How Many People Are Maintaining Nova?

Nova is created by Taylor Otwell (creator of Laravel) and David Hemphill. They are currently maintaining Nova.

There seem to be a large number of issues, but most of the issues are also feature requests.

Anyfor for some context: https://github.com/laravel/nova-issues/issues/964

25 Apr
1 day ago

bobbybouwmann left a reply on Minify Dependencies On App.js Without Jquery

If you run npm run production it will minify the content of that file for you.

bobbybouwmann left a reply on Advanced Relationship In Laravel

Mmh, this sounds like a pretty good solution! I hope it's good enough for you in daily usage in your development environment! Let me know how that works out for you :D

bobbybouwmann left a reply on Minify Dependencies On App.js Without Jquery

You need to take two steps here.

First you need to remove the following lines from the bootstrap.js file: https://github.com/laravel/laravel/blob/master/resources/js/bootstrap.js#L9-L14

Next you need to adjust your package.json file so you don't install it anymore when you run npm install: https://github.com/laravel/laravel/blob/master/package.json#L16

Note that you can also remove popper.js here.

That should be it!

bobbybouwmann left a reply on Displaying Embed Images Using Rendered Mailables In Browser

Embed only works in emails it self as far as I know. So I guess you have to use a normal path instead of the embed here.

bobbybouwmann left a reply on Rapid Controller (CRUD) Development For Laravel?

@bobmulder There is no standard for that. Every controller has different models, different fields, different validation and even different side effects.

If you want as less code as possible you should use a click and play software pack ;)

bobbybouwmann left a reply on Issue Installing Mailgun\Bogardo Package With Composer In Laravel

You have to use the SDK or some package that uses the SDK for this feature ;)

bobbybouwmann left a reply on Sending Mail Blade Template With Variables Through Mailgun Php SDK.

@gabotronix Just a foreach loop would be good enough I guess.

If you use the Mailgun SDK they probably have a separate endpoint for that? Not sure, but can probably find that in their documentation ;)

bobbybouwmann left a reply on Sending Mail Blade Template With Variables Through Mailgun Php SDK.

As @mvd said, this is basic functionality that is already available. The only reason to use Mailgun directory if you want to use more features than Laravel is offering. if it's just sending html emails, the Laravel default should be good enough for you ;)

bobbybouwmann left a reply on Sending Mail Blade Template With Variables Through Mailgun Php SDK.

You can just render a view and send that along

$html = view('emails.discount-mail.blade.php, $mailData)->render();

$mg->messages()->send('YOUR_DOMAIN_NAME', [
    'from' => 'Excited User <[email protected]_DOMAIN_NAME>',
    'to' => 'Baz <[email protected]_DOMAIN_NAME>',
    'subject' => $mailData['subject'],
    'html' => $html,
]);

bobbybouwmann left a reply on AssertSoftDeleted In Lumen

Diving in the source code the check is basically done with a simple count query

return $this->database->table($table)
    ->where($this->data)->whereNotNull('deleted_at')->count() > 0;

You can make your own helper method if you wish for a check like this.

bobbybouwmann left a reply on Rapid Controller (CRUD) Development For Laravel?

Mmh, I don't know such a package. However I would advise against such package. It only gives you more magic than you need!

Do make sure you don't have duplicated calls for data you can use repositories and reuse those in your controllers.

bobbybouwmann left a reply on Issue Installing Mailgun\Bogardo Package With Composer In Laravel

Well you're not the only one with this problem: https://github.com/Bogardo/Mailgun/issues/148

Laravel either needs Carbon 1.21 or higher or 2.0. I think 2.x is now installed, which is causing this issue.

So a work around for this is adding the following line to your composer.json

"nesbot/carbon": "^1.36",

I believe that this should fix most problems you have right now!

bobbybouwmann left a reply on Compare Two Datetime With Current Date

@leafman equalTo only works if they dates and times are exactly the same! If there is one minute difference it won't work. It depends on what you want to check or if it's in a cronjob that runs every minute that equalTo is fine, but if that is not the case it will almost never result in true.

bobbybouwmann left a reply on Should I Use Voyager With This Project?

@michalis In that case I would everything yourself! You can always throw away your own admin panel and move to voyage in a later stage ;)

bobbybouwmann left a reply on Ipay88 Payment Gateway Integration

Looking at the package it doesn't seem that hard to integrate it: https://github.com/karyamedia/ipay88

What are looking for in the package? You say like paypal, but what does that mean?

You can call the classes from the package and everything should work fine. You might even want to create your own wrapper class around this so you can reuse it throughout your code.

bobbybouwmann left a reply on Should I Use Voyager With This Project?

It depends, it always depends.

Do you expect to build a bigger application in the long run? How much admin functionality are you going to use? If you can answer these questions you can decide if you need something like voyager or if you're going to build an admin panel on your own.

In general I think voyager can help you setup an admin panel pretty quickly. However you also need to build a frontend for the regular users to see their projects.

bobbybouwmann left a reply on Can I Mix Laravel With Vue-storefront If Yes Then How ?

Mmh, the documentation is pretty clear on how everything should work. Also there is a magento implementation, which is PHP as well. So you can look at those examples if you wish.

bobbybouwmann left a reply on Compare Two Datetime With Current Date

You're comparing two dates here that are never going to be the same

'2019-04-24 16:05:58' == '2019-04-24 16:24:00'

This is never going to equal. Instead you need to compare in a different way.

You can compare two dates like so

$newStartDate = Carbon::now();
if (Carbon::now()->isSameDay($newStartDate)) {
    // Do your thing
}

Documentation: https://carbon.nesbot.com/docs/#api-comparison

bobbybouwmann left a reply on Laravel Passport Without Connecting To "User" Models.

Well Passport makes everything really easy for you if your building a secure api.

Another alternative would be using the TokenGuard with uses a api_token column in the database that needs to match.

Source: https://medium.com/@danielalvidrez/how-to-use-laravels-built-in-token-auth-6b6f6c26d059

So if you want to keep it simple, go for the TokenGuard. If you want to extend your API later on and also make it available for other developers, passport would be saver choice!

24 Apr
2 days ago

bobbybouwmann left a reply on How Do You Handle A User When Their Session Timesout In Laravel 5

For not losing any data you can use this package: https://github.com/GeneaLabs/laravel-caffeine

In general I either set a higher session timeout or don't do anything at all.

bobbybouwmann left a reply on Passing The Api_token In Header When The User Log In

So you have two options here.

If you want to use the api routing and api_token you can set the token in the frontend once when you login. Saving it in local storage for example is a good solution. The frontender can then use this token to build up the requests and always send that header to your backend. Whenever you logout you clear the local storage.

Another solution is not using the api, but having routes that return json response for your api. This way you can keep using the logged in sessie you already have setup and up and running.

bobbybouwmann left a reply on Snappy Package And Bootstrap 4

Yeah you can use this package: https://github.com/spatie/browsershot

So basically you generate a view using Laravel Blade and then browsershot will put this view in a headless chrome browser and generate a PDF from there. This was you can use all CSS that is supported by Chrome and even use JS if you wish.

bobbybouwmann left a reply on Advanced Relationship In Laravel

So basically the only polymorphic relationship you need is taggable right?

A channel can have many Tags A document can have many Tags An email can have many Tags

From there you can combine all the data. Maybe you can even make a second polymorphic relationship for channelable, but a simple one-to-many would be fine as well I guess.

Does that make any sense?

bobbybouwmann left a reply on Moving The User Model File

@jay_singulara_tech Did everything work out for you?

bobbybouwmann left a reply on Vue.js Some Items In Checkout Card Are Not Reactivity

I don't see a v-for loop here, so I think that it's the problem.

Also you don't have to set localCard, you can use this.card everywhere instead of this.localCard as far as I know

bobbybouwmann left a reply on Laravel Passport Without Connecting To "User" Models.

You can use the repository that is provided by passport to do this. So something like this

use Laravel\Passport\ClientRepository;

public function create(ClientRepository $clientRepository)
{
    $clientRepository->create(null, $name, '');
}

You can find all methods here: https://github.com/laravel/passport/blob/7.0/src/ClientRepository.php#L101

For a client in particular you can look how the console is doing it: https://github.com/laravel/passport/blob/7.0/src/Console/ClientCommand.php#L94

Let me know if this is what you're looking for!

bobbybouwmann left a reply on Moving The User Model File

If you want all references in your code to App\User and replace them with your new namespace you should be good to go.

One important change is config/auth.php. You need to set the correct path there as well: https://github.com/laravel/laravel/blob/master/config/auth.php#L68

In general this should make everything work for you ;)

bobbybouwmann left a reply on Passing The Api_token In Header When The User Log In

How do you use the api. Is that in the frontend? In that case you can just set the header on every request to your api.

If you want to reuse your api endpoints in your web controllers you should either use repositories and use an api and backend controller for requests.

bobbybouwmann left a reply on Laravel Telescope Blank Page

I have no other clue of what it could be! Everything works on my side just fine

bobbybouwmann left a reply on Nullable Dependency Injection Controller

Awesome! Glad I could help :D

bobbybouwmann left a reply on Laravel Telescope Blank Page

@fantasma Yeah, just reinstall the whole thing.

bobbybouwmann left a reply on BelongsTo Object From Member Of BelongsToMany Relationship?

I would personally put these rates in the pivot table itself. This is the most uncomplicated way there is to make this work!

bobbybouwmann left a reply on Laravel Telescope Blank Page

What about a package reinstall?

bobbybouwmann left a reply on Advanced Relationship In Laravel

@oliverbusk I have the same question as @itellmyselfsecrets

What is the goal of all of this?

bobbybouwmann left a reply on Laravel Telescope Blank Page

Mmh, have you tried reinstalling the package?

bobbybouwmann left a reply on Advanced Relationship In Laravel

Mmh maybe you can use the type_id of the polymorphic table for the types and put that in the tag_descriptions table instead. It feels like a bad idea to use a double polymorphic relation in one table.

bobbybouwmann left a reply on Passing The Api_token In Header When The User Log In

@emfpc You first have to figure out what you want to achieve here. Are you building an API or a web application?

bobbybouwmann left a reply on Laravel Telescope Blank Page

Mmh, that should work then!

Do you have the config set to enabled? https://laravel.com/docs/5.8/telescope#configuration

bobbybouwmann left a reply on SQLSTATE[HY000]: General Error: 1364 Field 'content' Doesn't Have A Default Value

@luknupespa It seems that you're only posting a title to your controller. Or your content field is empty when posting to the controller.

So you can either fix this by making the content field nullable in your migration

$table->text('content')->nullable();

Or you can setup some validation and make sure the content field is filled: https://laravel.com/docs/5.8/validation#form-request-validation

Let me know if this makes any sense

bobbybouwmann left a reply on Nullable Dependency Injection Controller

You need to let the controller method know what the default value is, if they are not available.

public function home(Ordering $ordering = null, Newsletter $newsletter = null)
{
    // Your code
}

Note: I'm assuming you have a route like this Route::get('/{?ordering}/{?newsletter}')->name('home');

Note: This won't work with a different class that would be injected. This only works for models that are type hinted.

bobbybouwmann left a reply on BelongsTo Object From Member Of BelongsToMany Relationship?

I'm just looking for a way to make it less complicated for you ;)

Maybe you can share some more about how you're going to use the data and the relations between the data. That makes it easier to find the correct solution for the database structure.

bobbybouwmann left a reply on Passing The Api_token In Header When The User Log In

Well the api_token is really meant as an API. So you shouldn't return views when using this way of authentication. If you want to use views and also have an authorized user you should use the normal authentication guard. You can perfectly use them side by side.

Another workout would be setting a cookie with the api_token and then extend the TokenGuard to also check on a cookie, but that should be a work around. It's not the way to go by default!

Let me know if I can help you any further!

bobbybouwmann left a reply on Laravel Telescope Blank Page

My best bet is that you're missing the compiled assets in your frontend.

Did you run the php artisan telescope:install command? It should publish all the assets as well. Did you include all those files if any are missing.

bobbybouwmann left a reply on How To Use Eloquent In View?

Well you need to use the full namespace if you want to do this in your view

@foreach(\App\User::all() as $key => $val)
    {{ $val->name}}
@endforeach

However it's highly recommend to send all your data from your controller to your view and then loop over it

// app/Http/Controllers/UsersController
public function index()
{
    $users = User::all();

    return view('users.index', ['users' => $users]);
}

// resources/views/users/index.blade.php
@foreach($users as $user)
    {{ $user->name}}
@endforeach

bobbybouwmann left a reply on Advanced Relationship In Laravel

I think your highly overthinking this. One polymorphic relationship with a type column should be enough right?