如何在子查询中使用“With”laravel雄辩的条件?

I am trying to add new functionality to my project to be able to add tweet anonymously so I need to check if the public field = 0 , return the tweets without user or null user object !

How I can use "with" with OrWhere or something like that?

I have done that by merging the collections but I need more efficient query to do that when I try OrWhere()->with() that return user data for all collection I need the data in with() comes only with condition ? how to do that ? Thanks

$tweets = Tweet::where(function ($query) {
                    $query->where('public',1);
                    $query->where('hashtag_id', request('hashtag_id'));
                })->with([
                    'user' => function ($query) {
                        $query->select('id', 'name', 'username', 'photo', 'verified')->withTrashed();
                    },
                    'hashtag' => function ($query) {
                        $query->withTrashed();
                    },
                  ])->  where(function ($query) {
                        $query->whereRaw('DATE_ADD(created_at,INTERVAL expiration_time SECOND) >= "' . Carbon::now()->toDateTimeString() . '" or expiration_time = 0');})
                        ->withCount(['replies'])->orderBy('created_at', 'desc')->get();
$tweets2 = Tweet::where(function ($query) {
                    $query->where('public',0);
                    $query->where('hashtag_id', request('hashtag_id'));
                })->with(['hashtag' => function ($query) {
                        $query->withTrashed();
                    },
                    ])-> where(function ($query) {
                        $query->whereRaw('DATE_ADD(created_at,INTERVAL expiration_time SECOND) >= "' . Carbon::now()->toDateTimeString() . '" or expiration_time = 0');})
                        ->withCount(['replies'])->orderBy('created_at', 'desc')->get();

$tweets = $tweets->merge($tweets2);           

I have figured this solution by adding method in the model check this condition and return depends on this condition

    $tweets = Tweet::Where(function ($query) {
        $query->where('hashtag_id', request('hashtag_id'));
    })->with([
        'hashtag' => function ($query) {
            $query->withTrashed();
        },
    ])->where(function ($query) {
        $query->whereRaw('DATE_ADD(created_at,INTERVAL expiration_time SECOND) >= "' . Carbon::now()->toDateTimeString() . '" or expiration_time = 0');})
        ->withCount(['replies'])->orderBy('created_at', 'desc')->get();
    foreach($tweets as $tweet){
        $tweet->user = $tweet->GetPublic();
    }

That is the method in the model

public function GetPublic()
    {
        if($this->public == 1)
        {   $user = $this->user;
            return $user;
        }
        else{
            return null;
        }
    }