Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


fastsol last won the day on July 26 2015

fastsol had the most liked content!

Community Reputation

39 Good

About fastsol

  • Rank
    Prolific Member
  • Birthday 10/17/1978

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location

Recent Profile Visitors

204,506 profile views
  1. Found it, on the hosting server the Master is listed as 500M but the Local version says 32M. Thank you, I will track down where that is being set.
  2. My local setup is WAMP and I don't know of anything specific that I changed on that setup to allow more than 32M of memory. My local setting is 128M in the ini file.
  3. Any ideas as to where on a system running WHM that I could find such a setting? I already called my host and the only thing they looked at was the ini setting.
  4. Yes I know. This is the blade file code: @extends('layouts.admin') @section('content') @include('layouts.partials.form-errors') <div class="row"> <div class="col-lg-2"> <a href="{{ route('admin.quotes.appointments.phone.create') }}" class="mr-4">Add Install Time</a> </div> <div class="col-lg-2"> <a href="{{ route('admin.quotes.appointments.off') }}" class="mr-4">Take Days Off</a> </div> <div class="col-lg-5"> <form action="{{ route('admin
  5. So I have a page that is loading a good amount of models and then looping those in the blade file. The issue I am trying to fix is on my hosting server I keep getting this error Symfony\Component\Debug\Exception\FatalErrorExceptionGET /admin/quotes/appointments Allowed memory size of 33554432 bytes exhausted (tried to allocate 53248 bytes This only happens on my hosting server which is a dedicated server with 8GB of meomry and the php.ini file is set to 500M already. BUT on my local laptop where I only have 128M set in the ini file and run the exact same data on the page it lo
  6. round was the one thing I didn't try, Thank you! This gives the correct result. $price = '278.53'; $cents = $price * 100; $end_result = (int)round($cents); // Gives me 27853 as expected. also works for 278.59 I knew the issue was a precision thing, I just couldn't find the right combination of functions to make it work. In the end it was so simple (as I figured it would be).
  7. So I am trying to take a string value of dollars (posted from a form) and times it by 100 to get the cents Integer value of the dollars. For some reason if I do this with something like 278.53 I end up with 27852. Same concept for 278.59 ends up as 27858. I don't understand why or how to make it work. I've tried many things and nothing has made it work. $price = '278.53'; // posted from the form $cents = $price * 100; // converting to cents. end_result = (int)$cents // This will end up being 27852 not 27853.
  8. This is the piece of information that made it work how I want in all environments. I now understand that in the boot() it was just adding the scope to the list but not actually running it at that moment. By putting the admin/* in the apply() of the scope itself the request()->path() had been populated and worked as expected in testing also. Thank you so very much, I've been beating my head for a while on this as I kept coming back to it when I'd make a new test that it was affecting. This is what I ended up with: class IsActiveScope implements Scope { /** * @param Builder $bu
  9. It appears that I can set a static method within the unit test itself that does transfer over when doing $this->get(route(''blah));. So I should be able to do the middleware method as you suggested, but then manually set the $enabled to false within the test before using $this-get(). This is a workaround I guess, but it still feels icky since I having to go around the actual code that runs the site normally to make it work just for the test. Maybe it's a compromise I'll have to live with. I had previously tried your last suggestion with the env settings and that made it work in reve
  10. Ok so I was wrong, my session method was not working either. I'm starting to see the issue here though. When I run the site normally the middleware is triggered BEFORE the route model binding, but when unit testing the middleware is triggered AFTER the route model binding. I have confirmed this by die dumping in multiple places in the chain to see which gets triggered first. The results are as I stated above, unit testing the model binding is first in the chain which is why no matter what I do here it will likely fail cause I am not able to set any variable/class/anything beforehand to tel
  11. I've been testing the last 30 minutes by making 2 middleware that uses session() to set the decision to add the scope. Session seems to be the only way to retain the decision throughout the application due to varying class scopes (not the model scope) and such. So far it's working in production and the quick unit tests I ran. I have to do some more testing to ensure it's working as I need, but so far it looks good. Thank you very much, I just needed an idea of how else to set the decision besides the request() and you helped me there.
  12. The way I have it now works great in production, although I do understand it being weird to manage it the way I have. The ONLY time it doesn't work is during unit testing. I like your way of applying it but I don't think it will solve the original issue I posted about. Reason being (primarily) is that when using route model binding, this would still fail to set I believe cause route mode binding appears to apply it's scopes at the route service provider level which is before the middleware level and hence would be too late to NOT apply the scope. Hopefully that made sense. Any other sug
  13. I am having a hard time figuring out a way to set the pathInfo within the request when testing. Here is the scenario: I am adding a global scope to a model in the boot() of that model that is conditional based on the route that given. This works great under normal usage but testing it fails the condition because the pathInfo within the request is only "/". What I don't understand is that AFTER the response is returned from the $this->get() in the test, the request has all the correct data, but it is NOT populated beforehand at the route model binding level. It is populated by the time
  14. Thank you for the explanation. It's certainly something I've not encountered. This was supposed to be a simple sales tax couple functions that someone found that under certain sets of numbers it was off by 1 cent cause it wasn't rounding up for those instances. I messed around a bit more and got this to work so far and seems to product the correct amounts for a few different values. The functions are identical to what I was running before except I changed the 2nd param of the round() to a 3 instead of 2. Unless you feel this will cause other major issues, I'll probably run with this until
  15. I'm fighting with a very simple round() that isn't giving me the correct output. In the example below the first var_dump shows the value of the calculation performed. The calculation is correct. Next it runs through the round() native function and comes out incorrect. Then I run a round() again but set another var to the same value as the first calculation but by simply setting the number rather than letting php do the math. Then run it through the round() and it comes out to what I expect it should be. So why is the first one not coming out right? $num = 583.00; $rate = 1.055
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.