laravel / nova-issues

554 stars 35 forks source link

Mongodb: Broken search #1351

Closed simonschaufi closed 5 years ago

simonschaufi commented 5 years ago

Description:

Mongodb doesn't allow table prefixes for search, so in \Laravel\Nova\PerformsQueries::applySearch it needs to be like this:

foreach (static::searchableColumns() as $column) {
    $query->orWhere($column, $likeOperator, '%'.$search.'%');
}

Steps To Reproduce:

  1. Install mongodb php extension
  2. composer req jenssegers/mongodb
  3. Go to /nova/resources/users?users_page=1&users_search=David
davidhemphill commented 5 years ago

MongoDB is not an official Laravel database driver.

simonschaufi commented 5 years ago

Well, I just bought a license because I wanted to use Nova in a MongoDB project and with just 2 broken things everything works quite well. It would be really nice to make it compatible with MongoDB as well. PS: And I'm not the only one who is using Nova with MongoDB ;) @tufankilicaslan

tufankilicaslan commented 5 years ago

I am sure there are more people using Nova with MongoDB. as you said @simonschaufi , nova working great with MongoDB, just 2 issues left. I hope this https://github.com/laravel/nova-issues/issues/1350 would be solved, first . This is more important for me than the search problem. i have to find a way to override or modify core Nova code , if this is not going to be solve.

simonschaufi commented 5 years ago

@tufankilicaslan would you be willing to make a MongoDB fork of Nova with me together? I have the feeling the core team is not willing to make Nova compatible with MongoDB. I don't expect everything to work but at least the basic features should work (display and edit data). Editing is also broken as they use transactions.

dillingham commented 5 years ago

@simonschaufi you can’t publish a version of nova. You’re better off submitting PRs to the main repo. You can grant yourself access in your nova account settings.

tufankilicaslan commented 5 years ago

yes, i agree with @dillingham . since this is not free and public project, can't publish own version.

@simonschaufi for editing and deleting, it's creating records on action_events table. and table not supports non integer fields, you can create a migration file to fix this.

          Schema::table('action_events', function ($table) {

            $table->string('actionable_id',24)->change();
            $table->string('target_id',24)->change();
            $table->string('model_id',24)->change();
}
dillingham commented 5 years ago

You can also turn off action log on the resource

tufankilicaslan commented 5 years ago

@dillingham " turn off action log" supported in 1.3.2. cant' switch version 1.3.2, because of this issue: https://github.com/laravel/nova-issues/issues/1350 . need to edit core nova code to fix the issue.

simonschaufi commented 5 years ago

@dillingham How can I submit MRs if my issues are just ignored with the words: Sorry, we don't care and MongoDB is not an official Laravel database driver? I bought a license to get a product which is broken and now i don't even have a voice to fix that broken parts. :cry:

dillingham commented 5 years ago

@simonschaufi I mean it’s a bit absurd to assume a laravel eloquent admin panel project can support every database. It is equally absurd to suggest you switch to MySQL. Which is what I’m suggesting :)

But if there are small adjustments that serve your specific needs that don’t violate the original intention, I’m sure it would be considered with PR. Not supporting could easily mean, not going to provide fixes for things that aren’t laravel core

WelaurS commented 3 years ago

MongoDB, of course, is not the core of Laravel. But nevertheless a lot of people use it and a lot of people make dirty tricks to make it work with Nova (at least me and 3 other people I know). It would be very cool if you could add the ability to use Nova with laravel-mongodb

davidhemphill commented 3 years ago

Your best course of action is to take it up with https://github.com/laravel/framework. We only plan on supporting Laravel's official database drivers for the foreseeable future. If Mongo makes it into core, we'd be glad to make whatever changes we need to make it work with Nova. 👍