Jump to content

requinix

Administrators
  • Content Count

    11,132
  • Joined

  • Last visited

  • Days Won

    211

Everything posted by requinix

  1. What happens if you go to http://legit.com/endpoint/givenlocation.asmx manually? Errors? Redirect?
  2. Sounds like a problem with VueCSV. Considered looking for another package that does CSV?
  3. What happens if you do that install command it suggests?
  4. 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.
  5. ...the one you're including after VueCSV?
  6. If that the app.js you're including after everything else?
  7. Where is Vue being loaded from?
  8. 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?
  9. 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...
  10. 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.
  11. requinix

    Issue with PHP

    Sounds like something the query could fix.
  12. requinix

    Issue with PHP

    Set aside that foreach... thing for the moment and just do a json_encode of $data.
  13. 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.
  14. requinix

    Strange outcomes with $stmt->fetchColumn()

    fetchColumn() returns an array or false. It does not return a number.
  15. Are there other applications writing to the database besides your own? Do you have any control over them?
  16. 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.
  17. 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.
  18. 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.
  19. 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.
  20. 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.
  21. requinix

    How to access symmetric key?

    With PHP? No. SSL stuff is all handled by OpenSSL (or whatever you have installed) which tends not to expose information like that. You could allow unsecure connections when a development mode is active, and/or when the connection is local. To troubleshoot locally.
  22. requinix

    Issue with PHP

    a) Use AJAX to fetch the HTML b) Use AJAX to fetch the options as JSON and add them to the <select> with Javascript
  23. requinix

    Help with a foreach loop issue from json source

    So you already have a foreach on the dates, suggesting you understand the foreach and the dates. Sounds like what you want is a secondary foreach on the $arr[games]...
  24. requinix

    Help with a foreach loop issue from json source

    That Pastebin is private.
  25. requinix

    Returning before complete

    Sounds like you picked a good point in the process. Not... really? A Promise is a design pattern for dealing with asynchronous operations. XMLHttpRequest doesn't do that - it's just pure functionality. If I could I would have the socket server (the place you chose) try to determine whether the operation will be long-running or not. Would be nice. Anyways, the server should use one response if the request was completed (eg, 200) and another distinctly different response if it was accepted but is not yet completed (eg, 201). The client recognizes each for what it is and, perhaps, passes that information upstream back to the HTTP portion. Whether the client can then "saveInDB", I don't know, I would imagine that depends on whether "accepted but not yet completed" counts as success. Perhaps not.
×

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.