dump sql without question (?) mark laravel

dump sql without question (?) mark laravel

Apr 15, 2022 4:00 PM (5 days ago)

Link Preview

dump sql without question (?) mark laravel

In In AppServiceProvider.php

Builder::macro('ddb', function () {
      $bindings = array_map(
          fn ($value) => is_numeric($value) ? $value : "'{$value}'",
          $this->getBindings()
      );

      return Str::replaceArray('?', $bindings, $this->toSql());
  });
My Newsletter

I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up!

No spam, only goldden nuggets 💎

Comments

Ahmed Nagi - Powerd By Vuepress . Hosted with GitHub and Netlify .