Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query did not execute #26

Open
polaquim83 opened this issue Aug 8, 2024 · 4 comments
Open

query did not execute #26

polaquim83 opened this issue Aug 8, 2024 · 4 comments

Comments

@polaquim83
Copy link

Hello,

I was trying to implement this on my project but the query was not execute and i get all result for related resource.

trait ClienteWithMyPostTrait
{
public static function myPostQuery(NovaRequest $request, $query, $model)
{
return $query->where('id', 1);
}

This part never run, i implemented like

CustomRelationshipField::make('My post', 'myPost', Post::class)

Thanks.

@milewski
Copy link
Member

milewski commented Aug 8, 2024

did you include the trait:

use CustomRelationshipFieldTrait;

?

@polaquim83
Copy link
Author

Hello,

Thanks for your reply,

Yes, i dit it.

use App\Traits\ClienteWithMyPostTrait;
use DigitalCreative\CustomRelationshipField\CustomRelationshipField;

class Cliente extends Resource
{
use HasTabs, HasActionsInTabs;
use CustomRelationshipFieldTrait;
use ClienteWithMyPostTrait;

/**
 * The model the resource corresponds to.
 *
 * @var string
 */
public static $model = \App\Models\Cliente::class;

@zackAJ
Copy link

zackAJ commented Aug 29, 2024

+1

@paulvl
Copy link

paulvl commented Nov 28, 2024

any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants