# Attempting to use Laravel Herd and DBngin for local Development with Radicle

**URL:** https://discourse.roots.io/t/attempting-to-use-laravel-herd-and-dbngin-for-local-development-with-radicle/26266
**Category:** radicle
**Created:** 2023-11-14T18:48:59Z
**Posts:** 26
**Showing post:** 10 of 26

## Post 10 by @csorrentino — 2023-11-14T20:34:54Z

> [@csorrentino](#):
>
> if it’s already installed

If you want to switch to using Valet instead of Herd, I _think_ you have to install valet separately. [Laravel Valet - Laravel 10.x - The PHP Framework For Web Artisans](https://laravel.com/docs/10.x/valet#installation)

One last thing you can try with Herd is to add a local radicle driver to the project. I have valet installed so this may or may not work for you, but here’s what you can try:

Add a `LocalRadicleDriver.php` file to the root of your project `/radicle-main` and add the following to that file:

```
<?php
use Valet\Drivers\LaravelValetDriver;

class LocalRadicleDriver extends LaravelValetDriver
{
    /**
     * Determine if the driver serves the request.
     *
     * @param string $sitePath
     * @param string $siteName
     * @param string $uri
     * @return bool
     */
    public function serves(string $sitePath, string $siteName, string $uri): bool
    {
        return file_exists($sitePath . '/public/content/mu-plugins/bedrock-autoloader.php') &&
               file_exists($sitePath . '/public/wp-config.php') &&
               file_exists($sitePath . '/bedrock/application.php');
    }

    /**
     * Determine if the incoming request is for a static file.
     *
     * @param string $sitePath
     * @param string $siteName
     * @param string $uri
     * @return string|false
     */
    public function isStaticFile(string $sitePath, string $siteName, string $uri)/*: string|false */
    {
        $staticFilePath = $sitePath . '/public' . $uri;
        if ($this->isActualFile($staticFilePath)) {
            return $staticFilePath;
        }
        return false;
    }

    /**
     * Get the fully resolved path to the application's front controller.
     *
     * @param string $sitePath
     * @param string $siteName
     * @param string $uri
     * @return string
     */
    public function frontControllerPath(string $sitePath, string $siteName, string $uri): string
    {
        $_SERVER['PHP_SELF'] = $uri;
        if (strpos($uri, '/wp/') === 0) {
            return is_dir($sitePath . '/public' . $uri)
                            ? $sitePath . '/public' . $this->forceTrailingSlash($uri) . '/index.php'
                            : $sitePath . '/public' . $uri;
        }
        return $sitePath . '/public/index.php';
    }

    /**
     * Redirect to uri with trailing slash.
     *
     * @param string $uri
     * @return string
     */
    private function forceTrailingSlash(string $uri)
    {
        if (substr($uri, -1 * strlen('/wp/wp-admin')) == '/wp/wp-admin') {
            header('Location: ' . $uri . '/');
            die;
        }
        return $uri;
    }
}
```

---

_[View the full topic](https://discourse.roots.io/t/attempting-to-use-laravel-herd-and-dbngin-for-local-development-with-radicle/26266)._
