src/Resources/Comment.php
/**
     * Build a "relatable" query for the given resource.
     *
     * This query determines which instances of the model may be attached to other resources.
     */
Build a "relatable" query for the given resource.
This query determines which instances of the model may be attached to other resources.
Build a " relatable " query for the given resource . This query determines which instances of the model may be attached to other resources .
public static function relatableComments(NovaRequest $request, $query): Builder
    {
        try {
            $resource = $request->findResourceOrFail();
            return $query->where('post_id', $resource->post_id)
                ->where('id', '!=', $resource->id);
        } catch (\Throwable $e) {
            return $query;
        }
    }
public static function relatableComments ( NovaRequest $ request , $ query ) : Builder { try { $ resource = $ request -> findResourceOrFail ( ) ; return $ query -> where ( 'post_id' , $ resource -> post_id ) -> where ( 'id' , '!=' , $ resource -> id ) ; } catch ( \ Throwable $ e ) { return $ query ; } }
Build a "relatable" query for the given resource.
Build a " relatable " query for the given resource .