Software Engineer at Employed



3 Best Reply Awards

  • Member Since 3 Years Ago
  • 661 Lessons Completed
  • 30 Favorites

9th June, 2017

J5Dev left a reply on Required Only If A Checkbox Is Not Checked • 2 weeks ago

Yes, going for checking for a 1 would remove the ned for having a hidden field, but it also removes the ability to switch the requirement, thats why I mentioned a presumption of having a mechanism which set the hidden field according to some other event/status.

Having some more information would allow me to suggest something that may be better... It could be that neither approach is required, based on how the form is being put together... I noticed the checkboxes are added via js, so, it may better to only add them SHOULD they be needed, then simply set the to sometimes within the Laravel validation.

J5Dev left a reply on It Is Ok To Use LetsEncrypt Free SSL? • 2 weeks ago

Seconded, if security is your only concern (it should be), then LetsEncrypt is more than adequate.

8th June, 2017

J5Dev left a reply on @foreach Error • 2 weeks ago

Sorry, I'm now confused... Your original question was about a Bladeloop, which i based my answer on.

If you are wanting to get the data using Angular (noticed the ng-model), then you will have to use that to pull the data via a call, and have it update the dom accordingly.

J5Dev left a reply on It Is Ok To Use LetsEncrypt Free SSL? • 2 weeks ago

And sadly, that's the end result of good commercial strategies by those who sell the certificates... (and a handful of others involved in the web.. cough Google cough)

Teach the public that only the big nice ones are secure, then companies will have to buy them instead of creating them ;)

Actually had this with a client a few years back, who was insisting on a £1400 Verisign (now Symantec), for his simple internal doc system, as it was definitely going to be more secure than the self-signed one we created!

We argued, showed him the facts, gave up and charged him way over the odds to install it, as it was 'big and complicated' lol, cant teach some people.

J5Dev left a reply on Vue Instance Inside Vue Instance Do Or Do Not? • 2 weeks ago

I see your point, and yes, if just thrown in, it would get a bit messy.

But then, that's where I would start utilising components.

Basically, have the components hold the logic for getting, handling and displaying the data, and functionality.

That way, a page is only ever doing what it needs, nothing more. And from a visual point of view, having the components out inn separate files makes for a nicer coding experience ;)

Maybe worth checking out one of the @laracast series' covering either Vue itself, or the latest TDD forum example, which covers porting an app over to use Vue... all will give great examples of how to organise things a bit better :)

J5Dev left a reply on Route Parameters Causing Wrong URLs For Static Images And AJAX Requests (L 5.4) • 2 weeks ago

Glad you got it sorted :)

J5Dev left a reply on View Composer For All Views Except A Single View • 2 weeks ago

Yes that will work, but this would be a bit cleaner :)

View::composer('*', function ($view) {
    if ($view->getName() != 'partials.not-this-view') {
        $view->with('variable', 'Set variable');

J5Dev left a reply on MySQL - Comma Separated List Or Another Table For Many To Many Relations? • 2 weeks ago

You could go down the route of a pivot table, it depends on how often you feel they will be updated.... I'm guessing something like this won't be often, so a column of 'countries' could be fine.

I would however, suggest a json array, rather than a comma separated list, purely as it is easier to pull the countries out as objects, should you need any functionality or additional fields on them.

J5Dev left a reply on It Is Ok To Use LetsEncrypt Free SSL? • 2 weeks ago

The thing to remember with certificates, is that the security comes from the encryption, not whether it was paid for and supplied.

I could have a self generated certificate that is more secure than one costing thousands, purely because when i create it a do so with a 4096 bit encryption, instead of the current base default of 20148.

What buying a certificate does do ((depending on the level you buy), is provide additional benefits, such as @bashy mentioned around a waranty.

You can also go crazy, and spend thousands onn one, where the supplier will check your companies authenticity, credit status, history etc. In return you get a 'better' representation of your security (full green bars anyone, lol).

Even an expired certificate, in theory, is just as secure as an expired one, as it is still encrypting the request.... (Disclaimer, depending onn how expired and the encryption used to generate it).

So to answer your question, yes LetsEncypt certs are fine for security,m but if you want a visible 'status' of your security, be prepared to splash out a few hundred ££

J5Dev left a reply on Vue Instance Inside Vue Instance Do Or Do Not? • 2 weeks ago

I don't know about whether it will/wont work, as I haven't done it myself.

If I'm being honest, it does feel a bit like a code smell, in that, yes, multiple instances per page I can kind of get, but most times, just one per page is fine.

Essentially, why have them inside each other, what is the second one (child) allowing you to do that you couldn't do by just adding the functionality you need to the existing instance...?

J5Dev left a reply on Route Parameters Causing Wrong URLs For Static Images And AJAX Requests (L 5.4) • 2 weeks ago

It would help if we could see how/where you are populating either the variable used for the images src, as well as how you are including it in the template.

J5Dev left a reply on @foreach Error • 2 weeks ago

Given your example of how you are setting the variable (although a bit JS like), I guess that your variable is actually $copayers[]. If so, your loop should be: @foreach ($copayers as $copayer) Backup for Wallet {{copayer}}: @endforeach

J5Dev left a reply on How Do You Handle Routes When Using SPA? • 2 weeks ago

It depends on how you are handling your routing within React, what Tykus said is correct.

Essentially, yes you will maybe still on the home page, but React should have appended the url to identify the resource/page that it is current using... so refreshing, although you are technically reloading your index page, once React kicks in it will load in the page indicated in the url... eg /#posts

J5Dev left a reply on Required Only If A Checkbox Is Not Checked • 2 weeks ago

Firstly, Im presuming you have some mechanism (js?) that allows for the value of the hidden input to be set to 1... otherwise it would always force the inputs to be required, and a simple required would do. That said...

The suggestion by Screenbeetle, whilst good is not correct. Sometimes is used when you need to chain a check to another, for example:

['username' => sometimes|email]

It's like a softer required, in that it doesn't force the key to be in the request, but if it is, it enforces the validation rules against it. Whereas required would fail because its there... essentially, sometimes is an 'its optional' approach.

The better option would be to use one of the required options.... I would say that in this scenario, the most descriptive is either required_without or required_if (one you suggested yourself)... both working the same way.

There are maybe better ways to handle things from both a UI and UX point of view, but would need more info about what is happening around the form :)

24th May, 2017

J5Dev left a reply on Laravel Mix And PhpUnit • 1 month ago

Wow, really nice package @LasseHaslev Short & sweet, exactly how it should be!

Thank you :)

20th April, 2017

J5Dev left a reply on Laravel Relation For Different User Types • 2 months ago

Just as an additional top this, one thing to consider is what if you want to allow users to be both supplier and shop?

What you would be better off doing is actually extracting the concept of a user as a person, away from the concept of what a user can do.

So, for example you may have the following Class'

User (The actual person logging in, and only information related to authentication.) Shopper (Someone purchasing or who can purchase) Supplier (An entity/company that sells things) Order (A base class that holds logic for an order) Purchase extends Order (Holds logic specific to being placed by a Shopper) Sale extends Order (Holds logic specific to being serviced by a Supplier)

Then simply use relationships to manage the application flow, referencing Sale or Purchase respectively.


User would simply house data and logic used for authentication, nothing more. A user could then register but without any constraints on what they can cant do.

Upon making a first purchase, a Shopper record is created, that is associated with a user, but with additional info needed to be able to service their purchase, both by the Supplier and the application. At this point a Purchase (order) is associated with the Shopper.

Lets say that User then wants to sell something, they list an item, at which time a Supplier record is created (and subsequent items etc). If a Shopper then buys their item, the order is created (by the user creating a Purchase), but it is managed as a Sale from the perspective of the Supplier.

Not only does this give a lot more freedom with regards to scaling the application, but it better represents the contextual business language commonly used within eCommerce.

All in all, much better, and all it requires is a couple of relationships, so much simpler!

Hope that helps :)

5th December, 2014

J5Dev left a reply on [L5] Date_default_timezone Error On Clear-compiled • 2 years ago

@winternight Yup, saw it after id posted (always the case!), thanks. Looks like thats all we can do.

J5Dev left a reply on [L5] Date_default_timezone Error On Clear-compiled • 2 years ago

Im having the exact same problem, but only when trying to use a local config, it seems to be overwriting the full config, as opposed to only overwriting the settings that are added.

Edit Your Profile

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