Jump to content

requinix

Administrators
  • Content Count

    11,137
  • Joined

  • Last visited

  • Days Won

    211

Everything posted by requinix

  1. What is the code to come up with the original data? Might it be easier to adjust that to not return/include the zero values?
  2. WSDLs are also helpful on the server side for much the same reasons, so it'd be surprising if they didn't have one. It's also fairly standard for SOAP to publish them because they're so helpful. Does http://legit.com/endpoint/givenlocation.asmx?wsdl happen to work?
  3. requinix

    background-image failure

    You're using a relative URL. Don't do that. They're relative. Use an absolute URL.
  4. I know only slightly more about SOAP than a squirrel, but I believe normally these things work by you providing a WSDL for SoapClient to read from.
  5. Your request is missing the namespace. It's not literally the name "username" that the SOAP endpoint wants to see but an element with the local name "username" in the "http://givenNamespace.com" namespace. These would all work: <functionCall xmlns="http://givenNamespace.com"> <username>...</username> </functionCall> <foo:functionCall xmlns:foo="http://givenNamespace.com"> <foo:username>...</foo:username> </foo:functionCall> Or similar versions - as long as an xmlns with the right URI is in the hierarchy.
  6. What happens if you go to http://legit.com/endpoint/givenlocation.asmx manually? Errors? Redirect?
  7. Sounds like a problem with VueCSV. Considered looking for another package that does CSV?
  8. What happens if you do that install command it suggests?
  9. So if you do it one way, one thing is undefined, and if you do it the other way, the other thing is undefined? If you're using app.js to bundle everything then try using it to bundle everything.
  10. ...the one you're including after VueCSV?
  11. If that the app.js you're including after everything else?
  12. Where is Vue being loaded from?
  13. requinix

    How to achieve AddToCart Without quantity?

    How can you have something in a (shopping?) cart without a quantity? Could you just assume a default of 1?
  14. In the Fiddle, VueCSV is defined automatically because the source script is included through a <script>. You don't have that. But you do have something else...
  15. requinix

    Why use json_encode() on a string

    Maybe. And if you don't know all the cases where it might error, all the more reason to check for an error after. Because the string might not be valid for JSON.
  16. requinix

    Issue with PHP

    Sounds like something the query could fix.
  17. requinix

    Issue with PHP

    Set aside that foreach... thing for the moment and just do a json_encode of $data.
  18. requinix

    Secured folder

    Well, your script explicitly disables caching so the solution would be to, you know, not. I imagine that once a file is uploaded it won't change. Maybe deleted or hidden, but not changed. Right? Set your Expires header to a date in the future, and fix Cache-Control to allow caching. And remove Pragma, it doesn't matter anymore.
  19. requinix

    Strange outcomes with $stmt->fetchColumn()

    fetchColumn() returns an array or false. It does not return a number.
  20. Are there other applications writing to the database besides your own? Do you have any control over them?
  21. requinix

    request()->path() incorrect during testing

    Yeah, I got a little confused about when you wanted the scope. It's about the admin routes, not about whether it's doing testing. Having stepped away from the computer for a couple hours, public static function boot(){ parent::boot(); if(!request()->is('admin/*')){ static::addGlobalScope(new IsActiveScope()); } } The model will only be booted once, and it'll probably happen early. Like for the very first request. Which doesn't help with testing - unless you're requesting against the web server, but it doesn't sound like it. The admin/* check would have to be inside IsActiveScope when it's being applied. So basically what I said before, except instead of the middleware and flag (which I still recommend) you're testing the request() path.
  22. requinix

    request()->path() incorrect during testing

    I believe the most Laravel-y answer is to use your .env settings. Have some value set that your scope can read.
  23. You would have to set up handling for all possible headers that may come back from the Access-Control-Request-Headers. Which is silly. Which is why nobody does that. Their API uses an Authorization (apparently Authorization: Bearer) and an X-API-Key. Just do that. If they change the API then you can change your code.
  24. requinix

    request()->path() incorrect during testing

    I think it will. While I'm not sure why detecting admin/* isn't working, that process uses the request URI while mine uses the router. They're different mechanisms, and as long as the test goes through the router (which I can't imagine it would not) then the router should apply the middleware appropriately. Although one point worth mentioning is that the middleware should undo itself after the request, so IsActiveScope::setEnabled(false); try { return $next($request); } finally { IsActiveScope::setEnabled(); } Routing is one of the first things that happens. It's before the controller. Which should therefore be before most models (except maybe your user) are running queries. The scope is always added to the list of global scopes. What varies is whether the scope actually affects the query - like adding its ->where or whatever just before the query is executed - and that's what is controlled by $enabled.
  25. requinix

    request()->path() incorrect during testing

    Managing the scope in your model based on request feels weird. I would have put the admin routes inside a group with middleware like Route::group(["prefix" => "/admin", "middleware" => "with-inactive-models"], function() { Models needing it add the scope, and with-inactive-models can disable it globally - at the simplest, class IsActiveScope { private static $enabled = true; public static function setEnabled($enabled = true) { self::$enabled = $enabled; } } And IsActiveScope checks $enabled before applying itself.
×

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.