Get support for calebporzio/bear-sync

If you're new to LTH, please see our FAQ for more information on what it is we do.

Support Options

Unfortunately, there are currently no active helpers for this repository on the platform. Until they become available, we reccomend the following actions:

View Open Issues

Take a look to see if anyone else has experienced the same issue as you and if they managed to solve it.

Open an Issue

Make sure to read any relevant guidelines for opening issues on this repo before posting a new issue.

Sponsor directly

Check out the page and see if there are any options to sponsor this project or it's developers directly.

calebporzio/bear-sync

Bear-Sync

This package provides an Eloquent model called BearNote that can access your local Bear notes without any configuration at all.

Install

composer require calebporzio/bear-sync

Use

Basic Usage

$note = BearSync\BearNote::whereTitle('Some Note Title')->first();

App\Post::create([
    'title' => $note->title,
    'content' => $note->content,
])

Full API

// Search all your Bear notes.
$notes = BearSync\BearNote::searchByTitle('Some Note Title');

// Find a specific note.
$note = BearSync\BearNote::whereTitle('Some Note Title')->first();

// Get tags by note
$tags = $note->tags

// Find a Bear tag named "blog"
$tag = BearSync\BearTag::whereTitle('blog')->first();

// Get Bear notes by tag
$notes = $tag->notes;

// Access the note's contents.
$note->id; // Bear's note id.
$note->title;
$note->content;
$note->checksum; // A checksum of the note's content, so you can detect updates.

// Fetch it's content and replace/store images.
$note->getContentAndStoreImages(function ($originalPath, $newFileName) {
    $publicFileName = "/images/{$newFileName}";

    // Copy the image and store it locally (presumably in a public directory).
    \File::copy($originalPath, public_path($publicFileName));

    // Return the file path to be referenced in the Bear note's markdown.
    // ![]($publicFileName)
    return $publicFileName;
});
Our Mission

We want to make open source more sustainable. The entire platform was born from this and everything we do is in aid of this.

Interesting Articles

Thank you for checking out LiveTechHelper |
2025 © lth-dev incorporated

p-e622a1a2