bobbybouwmann

Developer at Enrise

Experience

862,955

1035 Best Reply Awards

  • Member Since 2 Years Ago
  • 972 Lessons Completed
  • 12 Favorites

25th June, 2017

bobbybouwmann left a reply on Laravel Mix Not Processing Scss • 9 hours ago

I believe you need to use sass instead of scss

bobbybouwmann left a reply on I Need A Little Help In Making A UML Class Diagram. • 9 hours ago

You need to go for the second option which means connecting only the model that is used within the controller with the controller.

If you would connect your base model with your base controller you still don't know anything about the connection between the classes.

If it makes your diagrams clearer you can also choose to not connect every controller with every base controller and just use text next to it describe that feature ;) From my experience that works just fine. Or you can even have two diagrams of course!

22nd June, 2017

bobbybouwmann left a reply on Flashing A Notification 2 Days Before A Certain Deadline • 3 days ago

The functionality you are describing are called cronjobs. That basically means you can schedule a certain task to be run at a certain time or date.

Documentation: https://laravel.com/docs/5.4/scheduling

Read the full page from above. If you have more questions you know where to find me ;)

bobbybouwmann left a reply on User Account With Child Users. • 3 days ago

@oluwajubelo Can you create a separate thread for you question and also provide what more information?

18th June, 2017

bobbybouwmann left a reply on Blade Auth()->user() Trying To Get Property Of Non-object • 1 week ago

Are you sure the user is logged in? auth()->user() returns null when you are not logged in!

You can do an extra check like so

auth()->check() // returns true when logged in, false when logged out

Your code might fail on below code since you don't have a check here if you are logged in or not!

{{ auth()->user()->name }} <span class="caret"></span>

bobbybouwmann left a reply on Invalid Datetime Format: 1292 Incorrect Date Value: '2017-June-30' • 1 week ago

Like I said, it's not a valid database format for PHP or Carbon. I tried it myself, but it's not possible. You either need to parse the date by hand or post a different date like I mentioned with the altFormat option in jQuery

bobbybouwmann left a reply on Foreign Key Constraint Is Incorrectly Formed" • 1 week ago

It says it's trying to create the #sql-2788_24c table in the fjobs database which seems to be odd.

bobbybouwmann left a reply on Invalid Datetime Format: 1292 Incorrect Date Value: '2017-June-30' • 1 week ago

What is not correct? Did you check the value you get in the method?

Also if you want to set a model attribute you need the following structure

public function set{Field}Attribute($value) 
{
    $this->attributes['field'] => $value;
}

So in your case that should be setCloseDateAttribute($value)

bobbybouwmann left a reply on Foreign Key Constraint Is Incorrectly Formed" • 1 week ago

Did you read the error message? It's talking about the table fjobs! It looks like you have a typo somewhere? Can you search your project for fjobs and check if that is your problem?

bobbybouwmann left a reply on Invalid Datetime Format: 1292 Incorrect Date Value: '2017-June-30' • 1 week ago

2017-Juni-30 is not a valid date format.

You have two options here. Either let your backend parse the posted format and convert it to the correct format (Carbon for example). Another solution would be using the altFormat option in the datepicker and send that value to the server.

See: https://api.jqueryui.com/datepicker/#option-altFormat

bobbybouwmann left a reply on Create Session In Listener For Authenticated • 1 week ago

You send the variable $status back to the view this way. How do you access the current $status variable?

bobbybouwmann left a reply on User Account With Child Users. • 1 week ago

I would probably create two entities here. Something like a Company and a User. So a user can invite other users, but a user is always connected to the same "Company". So when you login you always see the same data, since everything is connected to that company.

You then create different roles for what a user can do. This role can also be based on who created the company or whatever.

If you need more help let me know ;)

bobbybouwmann left a reply on Laravel Console Auto Confirm After Sometimes • 1 week ago

@joshmanders Definitely an anti pattern!

@kocoten1992 This feature would be useful, but not secure! I would be a no go in my opinion!

bobbybouwmann left a reply on A Facade Root Has Not Been Set. • 1 week ago

You need to specify the table first before you call select as far as I know

$users = DB::table('users')->get();

Documentation: https://laravel.com/docs/5.4/queries

16th June, 2017

bobbybouwmann left a reply on Form Validation Combination Of Fields Must Be Unique • 1 week ago

@roerjo Yes the Rule class would be a great example for this. However when this question was asked, this functionality didn't existed!

bobbybouwmann left a reply on My Web.php Routes Are Broken After Uninstalling A Plugin • 1 week ago

Snapey might have a point there! Try this on the command line

composer dump-autoload

14th June, 2017

bobbybouwmann left a reply on My Web.php Routes Are Broken After Uninstalling A Plugin • 1 week ago

You need to remove the service provider from the app.php file!

13th June, 2017

bobbybouwmann left a reply on My Web.php Routes Are Broken After Uninstalling A Plugin • 1 week ago

What does your error log say?

storage/logs/laravel.log

11th June, 2017

bobbybouwmann left a reply on How To Make A API-interact-able Vue Component • 2 weeks ago

Not sure what you mean, your then method can no send an API request right? You can just pass it a clojure and let that handle an API request?

bobbybouwmann left a reply on My Web.php Routes Are Broken After Uninstalling A Plugin • 2 weeks ago

You can change your web.php file right? How does it look right now?

bobbybouwmann left a reply on Add And Remove Two Fields Dynamically On Button Click And How To Retrieve It • 2 weeks ago

answer is an array so you can simply loop over it in your controller

foreach($request->answer as $answer) {
    dump($answer);
}
dd('Done');

bobbybouwmann left a reply on How To Integrate Bootstrap With Laravel • 2 weeks ago

Have you looked into npm?

bobbybouwmann left a reply on Column Not Found: 1054 Unknown Column 'user_user_id' In 'field List' • 2 weeks ago

It looks like you are posting the wrong data. You don't check for the user_id column in your validation, so it might be possible that you are posting a value with user_user_id. Can you make sure the posted data is validated?

bobbybouwmann left a reply on Laravel Console Auto Confirm After Sometimes • 2 weeks ago

I have bad news for you, that is not possible. The confirm method will wait for a confirmation from the prompt and not from the Laravel application. So it will wait on use interaction, but you can't fake that from a PHP application as far as I know.

bobbybouwmann left a reply on PROBLEM TO PRINT A VARIABLE • 2 weeks ago

@Snapey I don't think he is storing JSON in the database, but Laravel is converting the array output to JSON when it's trying to print it.

In this case only one result is returned, but it's still an array. As said in other comments above you either need to limit the results by one or loop over them.

bobbybouwmann left a reply on How To Make Settings Class Just For Learning • 2 weeks ago

I think this is exactly what you are looking for:

Managing Mass User Settings Managing Mass User Settings: Part 2

bobbybouwmann left a reply on Convert Query To Laravel Query Builder • 2 weeks ago

What have you tried so far? This query isn't that hard to convert to Eloquent!

A quick tip, most mysql keywords are methods on the Query Builder ;)

Check the documentation here: https://laravel.com/docs/5.4/queries

bobbybouwmann left a reply on How To Best Merge Different Css And Js Files Together Using Mix? • 2 weeks ago

You can do that all in the scripts function, I believe this should do it.

mix.js('resources/assets/js/frontend.js', 'public/js')
    .sass('resources/assets/sass/frontend.scss', 'public/css')
    .extract([
        'jquery',
        'bootstrap'
    ])
    .scripts([
            'resources/assets/vendor/constellation.min.js',
        'public/js/frontend.js
    ], 'public/js/all.js')
    .styles([
        'resources/assets/vendor/swiper/css/swiper.min.css',
        'resources/assets/css/styles.css',
        'public/css/frontend.css
    ], 'public/css/all.css');

bobbybouwmann left a reply on Laravel With Drupal • 2 weeks ago

Well as I said, its not really a good idea. You will have different views and different functionalities in two different systems to serve one website. All red alerts are going off in my head right now.

10th June, 2017

bobbybouwmann left a reply on Laravel With Drupal • 2 weeks ago

That would be a bad practice in my opinion. You would let two frameworks serve your application on different ways. That also means you have to keep two application up to date for each change!!

Anyway, a solution for you would be returning the correct html from your API. You can call $view->render() and return that as an API response. Wouldn't be my first choice, but it would fit your case

bobbybouwmann left a reply on Any Good Ways To Initialize An Object With A Large Number Of Parameters And Default Values? • 2 weeks ago

A good practice would be using objects. That means passing objects to the constructor. So let's say you are creating a user with login credentials, payment details and address info.

class User
{
    public function __construct(Address $address, Payments $payment)
    {
        $this->address = $address;
        $this->payment = $payment;
    }

    public function getStreet()
    {
        return $this->address->street;
    }
}

You can then do something like this

$address = new Address('street', 23, 'city', 'country');
$payment = new Payment('42424242424242', 234);

new User($address, $payment);

bobbybouwmann left a reply on Laravel With Drupal • 2 weeks ago

My first thought would be to use a Laravel as an API, just like your solution. This way your Laravel part can be reused if you want to switch out Drupal in a later stage.

For the implementation I would make the Laravel API session less. So you can only authenticate with a jwt token. This is a better practice for an API.

bobbybouwmann left a reply on How To Test Emails? • 2 weeks ago

You can use this package for email testing in Laravel 5.4: https://github.com/spatie/laravel-mailable-test

bobbybouwmann left a reply on Variable Declaration In SQL With Length • 2 weeks ago

What is your exact use case?

bobbybouwmann left a reply on When To Use Vue Components And When To Use Laravel Components ? • 2 weeks ago

The simple answer is it depends.

Most of the time you can use a combination of the both in the form of a front-end component with an API in Laravel.

It also depends on what you are building. Let's say you have a website and you want to create a form with vuejs, in that case you only need an API endpoint to post to and you can build all the front-end stuff in the component. If you want to have SPA (Single Page Application) you will need to create a router in vuejs and create multiple page components which might use an API endpoint.

Do you have a specific use case you want to build?

bobbybouwmann left a reply on Variable Declaration In SQL With Length • 2 weeks ago

Can you be a bit more specific?

30th May, 2017

bobbybouwmann left a reply on Broadcast PresenceChannel Between Two People • 3 weeks ago

I haven't worked much with Laravel Echo yet so I can't help you right away. It's on my list to dive into it.

Did you already solve your problem? If you are still stuck I would suggest to first get it to work with a public channel and then later on switch it to a different channel type.

bobbybouwmann left a reply on Custom Validation Attributes Does Nothing... • 3 weeks ago

Hi @vincej,

It's currently not possible to do this in a simple way. You have two options here:

Option 1 is adding the validation messages by yourself to the message bag of errors. I believe this question on SO can help you with that: https://stackoverflow.com/questions/37925592/laravel-custom-messages-for-array-validation

Option 2 is using a more generic error message. You can for example do something like this

'custom' => [
    'notes.*' => [
        'unique' => 'Each person must have a unique note',
    ]
],

Hope this helps a bit

8th May, 2017

bobbybouwmann left a reply on Internal Error: Failed To Retrieve The Default Value • 1 month ago

This is your problem I guess

Route::get('/post/manage', [email protected]')->name('managepost');
Route::get('/post/manage', [email protected]')->name('deletepost');

You declared the same route twice

bobbybouwmann left a reply on Custom Error Page (er.500) • 1 month ago

@laurence Yeah, it's awesome! It also comes with a better design ;)

bobbybouwmann left a reply on Braintree Integration • 1 month ago

@vcgnetwork Braintree offers more pay providers, which is nice ;)

bobbybouwmann left a reply on Tests\Browser\ExampleTest::testBasicExample Facebook\WebDriver\Exception\TimeOutException: Waited 5 Seconds For Selector [.chat-composer]. • 1 month ago

The error message is clear right? It can't find the .chat-composer element on the page!

2nd May, 2017

bobbybouwmann left a reply on Laravel Storage Folder Permission • 1 month ago

@lifesound 777 means that it's writable for all users and groups on the server. You can also use other permissions, but that means more configuration on your server.

27th April, 2017

bobbybouwmann left a reply on Tests\Browser\ExampleTest::testBasicExample Facebook\WebDriver\Exception\TimeOutException: Waited 5 Seconds For Selector [.chat-composer]. • 1 month ago

It looks like it can't find that element. Are you sure it's on the page?

21st April, 2017

bobbybouwmann left a reply on Blackist Mime • 2 months ago

Create a custom validation rule for it ;)

bobbybouwmann left a reply on Blackist Mime • 2 months ago

Just specify the mimes in your validation you want to allow in your upload process. In my opinion you can better be more explicit then blacklist some stuff. You might forget a few you also don't want!

20th April, 2017

bobbybouwmann left a reply on Distinct Or Empty Values On Array Validation • 2 months ago

@Serringer sometimes will only perform the rest of the rules when the key is available ;)

bobbybouwmann left a reply on Not Returning Array Scout • 2 months ago

What does it return?

19th April, 2017

bobbybouwmann left a reply on Sending Email After Specific Date • 2 months ago

The later method only works when you use a real queue I believe, for example redis.

There were some problems with this in Laravel 5.2 and 5.3. This should be completely fixed in Laravel 5.4: https://laravel.com/docs/5.4/mail#queueing-mail.

Issue: https://github.com/laravel/framework/issues/15358

bobbybouwmann left a reply on Understanding The 'this' Keyword Inside Vue Instance • 2 months ago

I think you can compare data variable in vuejs with public properties of a class in PHP. This will then refer to that class and so the property is available.

You can see the props and data as constructor items that are set on a class when created I guess.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.