johnvoncolln

Experience

19,740

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 193 Lessons Completed
  • 0 Favorites

15th July, 2017

johnvoncolln left a reply on Can I Use Route Which Is Stored In Table Laravel 5? • 1 week ago

what is the purpose of storing this in the database?

johnvoncolln left a reply on Conventions For Sharing Data Between Controllers And Views • 1 week ago

You should probably watch the intro to Laravel series here:

https://laracasts.com/series/laravel-from-scratch-2017/

All of this is covered in this series and it's free to watch if you don't have an account...

14th July, 2017

johnvoncolln left a reply on Ideas On How To Structure Product Pricing Groups • 1 week ago

I've been searching and haven't found anything! Do you have any examples or links?

My latest thought was to have a group pricing table associated to the product table, so you could assign a price associated with a group, per product.

johnvoncolln started a new conversation Ideas On How To Structure Product Pricing Groups • 1 week ago

I've got a website that sells products. I have retail customers and wholesale customers that I can assign unique pricing to on a per product basis. I have a pricing scheme table that has fields for each product id with the value being the prices. I associate a pricing to a customer via a pivot table. There's some logic that states if a price for a specific product isn't found for this user's pricing scheme, then use the default pricing scheme. This way I can also only change some products, and leave the rest default.

Is there a better way? It's a bit clunky and right now there's no logic to add fields to the pricing scheme if a new product is added. Looking for a better way.

17th December, 2016

johnvoncolln left a reply on Issues With Depolyment Via Envoyer • 7 months ago

Thanks for the help - I remembered I could tail my apache logs and get an idea of what's going on. It's hard to remember everything when you don't do it everyday!

Anyways, I had some permission issues with my storage directory and remembered from my Magento days that apache likes to own directories it writes to. So I changed ownership to apache and everything is working now!

johnvoncolln left a reply on Issues With Depolyment Via Envoyer • 7 months ago

Thanks for the reply...

  1. This is where I need some suggestions

  2. which lines do you mean? APP_ENV?

  3. nothing 7 related

  4. ok

  5. The server my own through rackspace, running apache. I have many other php sites running just fine.

Like I said, I have envoyer working - the deployment went fine... Just trying to get some ideas on where to look next.

johnvoncolln started a new conversation Issues With Depolyment Via Envoyer • 7 months ago

I'm pretty new to Laravel and Envoyer, but I've managed to get Envoyer setup and have deployed my small project successfully, including getting the env file working with Envoyer. BUT, I'm getting a 500 error. So I'm wondering a few things...

  1. How can I debug for further information?
  2. What steps do I follow to 'change' my app from development to production? Is it as simple as the env file with envoyer? Is there anything else I need to do?

A few notes of disclosure that may or may not be an issue:

  1. My development environment is using Homestead with php 7, while my server is running 5.6.X
  2. I'm not using any database on my app, or the auth scaffolding
  3. All directories are set correctly

14th December, 2016

johnvoncolln started a new conversation AJAX Response On Form Request Validation Failure - What To Do? • 7 months ago

I'm "attempting" to implement Dropzone.js into a form. It's just a basic form with a file attachment portion, so when you click "Submit", the form and file are to be sent off. I've got it mostly working.

My issue is I'm using a Form Request to validate the form info and when you submit a form via AJAX in laravel, it sends back a JSON response with the error. This working, but I'm at a loss as to how I'm going to show this to the user as I don't know much about AJAX...

Halp!

26th August, 2016

johnvoncolln left a reply on Set Selected Option In Dynamically Created Drop Down Menu • 11 months ago

So I came into today and started messing with it, logged out and in, did a dd on the controller which showed the correct values. Then I commented out the dd and looked at it again and it's now working... Here's what's in my view:

<select class="form-control" name="state_id">
    <option>Select State</option>
    @foreach ($states as $id=>$state)
        <option value="{{ $id }}"{{ ( $billingAddress->state_id == $id ) ? ' selected' : '' }}>{{ $state }}</option>
    @endforeach
</select>

So.... Maybe the session had something to do with it. Updated the state and logged back out and back in and it stayed selected on the correct selection.

I may implement the cache solution just for fun, but this app is more of a learning exercise for me and will only be used by a few people, so an extra db call won't really matter. I was kind of doing it to see if I could do it anyways.

Thank you guys for the help! I love this site!

25th August, 2016

johnvoncolln left a reply on Set Selected Option In Dynamically Created Drop Down Menu • 11 months ago

@zachleigh HTML looks like it should and has the selected attribute

@dawiyo Probably not but I'd be using this list in probably 3 other locations so it would be worthwhile to not have to repeat it. Putting it into a helper function or something I suppose would be better but it begs the question if the behavior will be the same...

johnvoncolln left a reply on Set Selected Option In Dynamically Created Drop Down Menu • 11 months ago

@zachleigh

I was hoping you were right, but still the same behavior... Good eye though!

johnvoncolln started a new conversation Set Selected Option In Dynamically Created Drop Down Menu • 11 months ago

I've created a billing address form that will post or patch depending on if it exists on the database (if user has filled it out already). If they HAVE filled it out, then I populate it and change the submit button to 'Update', then if needed, the user can change whatever and update it.

The problem I'm having is I am creating the State select menu dynamically from the database and it won't recognize my 'selected' option attribute. I'm wondering if it's a loading issue where maybe the browser isn't recognizing the 'selected' bit quick enough? I dunno, I got a raw spot from scratching my head...

                        <select class="form-control" name="state_id">
                            <option>Select State</option>
                            @foreach ($states as $id=>$state)
                                <option value="{{ $id }}"{{ ( $billingAddress->state_id == $id ) ? 'selected' : '' }}>{{ $state }}</option>
                            @endforeach
                        </select>

20th August, 2016

johnvoncolln left a reply on Install Imagick On Homestead For Spatie\PdfToImage • 11 months ago

I got it to work - I believe it was by restarting php...

18th August, 2016

johnvoncolln started a new conversation Install Imagick On Homestead For Spatie\PdfToImage • 11 months ago

Trying to use Spatie\PdfToImage and it needs imagick I can run php -m and I see it listed, but when I try and run:

$pdf = new Pdf('mypdf.pdf');

it's giving me an error:

Class 'Imagick' not found

Any ideas?

johnvoncolln left a reply on PSR-4 Autoloading Vs. Service Providers • 11 months ago

Got it - so in your example this gives you the ability of easily changing the class that is used, but the functionality will remain the same so you don't have to change anything else...

johnvoncolln left a reply on PSR-4 Autoloading Vs. Service Providers • 11 months ago

@TheNodi

You lost me there - I've JUST finally wrapped my head around service providers. I may have to go back to the beginning to grasp interfaces. Most of this stuff I've found that I assume it's more complicated than it really is...

johnvoncolln left a reply on PSR-4 Autoloading Vs. Service Providers • 11 months ago

Ok, so if I've got a bunch of dependencies, then I'd want to use a service provider... That makes sense. I watched the service provider and IoC videos last night and woke up with this question LOL

johnvoncolln started a new conversation PSR-4 Autoloading Vs. Service Providers • 11 months ago

So if everything is loading within the app directory with PSR-4, then what's the benefit of creating a service provide instead?

8th July, 2016

johnvoncolln left a reply on Error PDOException In Connector.php Line 55: SQLSTATE[HY000] [2054] • 1 year ago

I'm on a mac and used mac ports to install php and other things and I was having this same issue - I realized I didn't have sqlite driver installed, so I ran:

sudo port install php55-sqlite

and then stopped and restarted artisan serve

johnvoncolln left a reply on Issue Creating Laravel App • 1 year ago

I had the same issue and finally realized that I was using .bash_profile - when I moved my entries from .bash_profile to .profile everything was working

Edit Your Profile
Update

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