Skip to content

Unable to use without database connectionΒ #59

@SuperDJ

Description

@SuperDJ

Wayfinder Version

0.1.4

Laravel Version

11.44

PHP Version

8.3

Description

I really like the idea of Wayfinder and can clearly see the advantages compared to other packages. But at the moment at least for me Wayfinder is unusable due to a required database connection. I prefer to not have an active database connection while developing. Also since I'm creating a multi-tenancy app with a database per tenant the connection is dynamic for quite a lot of models.

  1. Would it be possible to use the model metadata that is similar to laravel-ide-helper instead of an actual database? Perhaps by setting a command flag or by using a config file you can switch between the two options;
  2. Would it be possible to fail early when there is no database connection. Now it takes quite a bit of time before an exception is thrown;

For example

/**
 * Default User model
 * @property int $id
 */
class User
/**
 * Passport client
 * @property-read string $id uuid
 */
class Client 
/**
 * Post model
 * @property int $id
 * @property string $title
 * @property string $slug
 */
class Post extends Model
{
  public function getRouteKeyName(): string
 {
    return 'slug';
 }
}

Steps To Reproduce

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions