Call to undefined method Illuminate\Database\Query\Builder::withTrashed()

Your Eloquent model should use the Illuminate\Database\Eloquent\SoftDeletes trait to make use of the withTrashed() method.

Like::class

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Like extends Model
{
    use SoftDeletes;
}