diff --git a/README.md b/README.md index 6b92533..f0a3390 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Read your notion pages as Markdown in Laravel applications Example: ```php -use RedberryProducts\MdNotion\Facades\MdNotion; +use Redberry\MdNotion\Facades\MdNotion; $pageId = '263d9316605a806f9e95e1377a46ff3e'; @@ -77,8 +77,8 @@ return [ * Customize these to use your own adapters. */ 'adapters' => [ - 'paragraph' => \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, - 'heading_1' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, + 'heading_1' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, // ... many more block adapters ], ]; @@ -123,7 +123,7 @@ To get your Notion API key: Get the content of a single page as markdown: ```php -use RedberryProducts\MdNotion\Facades\MdNotion; +use Redberry\MdNotion\Facades\MdNotion; $pageId = '263d9316605a806f9e95e1377a46ff3e'; $content = MdNotion::make($pageId)->content()->read(); @@ -230,7 +230,7 @@ The `MdNotion` package provides rich object models for working with Notion pages #### Basic Properties and Methods ```php -use RedberryProducts\MdNotion\Objects\Page; +use Redberry\MdNotion\Objects\Page; // Create from data $page = Page::from([ @@ -279,7 +279,7 @@ $updatedPage = $originalPage->fetch(); #### Basic Properties and Methods ```php -use RedberryProducts\MdNotion\Objects\Database; +use Redberry\MdNotion\Objects\Database; // Create from data $database = Database::from([ @@ -507,7 +507,7 @@ You will need adapter class extending `src\Adapters\BaseBlockAdapter.php` and cu namespace App\Adapters; -use RedberryProducts\MdNotion\Adapters\BaseBlockAdapter; +use Redberry\MdNotion\Adapters\BaseBlockAdapter; class CustomCodeAdapter extends BaseBlockAdapter { @@ -550,8 +550,8 @@ return [ 'adapters' => [ 'callout' => \App\Adapters\CustomCalloutAdapter::class, // Keep existing adapters... - 'paragraph' => \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, - 'heading_1' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, + 'heading_1' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, // ... other adapters ], ]; diff --git a/column-list-fetch-example.php b/column-list-fetch-example.php index 138a425..ec5b39a 100644 --- a/column-list-fetch-example.php +++ b/column-list-fetch-example.php @@ -12,7 +12,7 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Adapters\ColumnListAdapter; +use Redberry\MdNotion\Adapters\ColumnListAdapter; // Set up Laravel container $container = new Container; @@ -56,7 +56,7 @@ // Bind view factory to container $container->instance('view', $factory); View::setFacadeApplication($container); -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\SDK\Notion; // Use actual block ID from Notion $columnListBlock = [ diff --git a/composer.json b/composer.json index faa0ec0..8900425 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "redberry/md-notion", "description": "Read your notion pages as Markdown in Laravel applications.", "keywords": [ - "RedberryProducts", + "Redberry", "laravel", "md-notion" ], @@ -31,12 +31,12 @@ }, "autoload": { "psr-4": { - "RedberryProducts\\MdNotion\\": "src/" + "Redberry\\MdNotion\\": "src/" } }, "autoload-dev": { "psr-4": { - "RedberryProducts\\MdNotion\\Tests\\": "tests/", + "Redberry\\MdNotion\\Tests\\": "tests/", "Workbench\\App\\": "workbench/app/" } }, @@ -57,10 +57,10 @@ "extra": { "laravel": { "providers": [ - "RedberryProducts\\MdNotion\\MdNotionServiceProvider" + "Redberry\\MdNotion\\MdNotionServiceProvider" ], "aliases": { - "MdNotion": "RedberryProducts\\MdNotion\\Facades\\MdNotion" + "MdNotion": "Redberry\\MdNotion\\Facades\\MdNotion" } } }, diff --git a/config/md-notion.php b/config/md-notion.php index be7b9cf..d55e9f4 100644 --- a/config/md-notion.php +++ b/config/md-notion.php @@ -1,6 +1,6 @@ [ - 'paragraph' => \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, - 'heading_1' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, - 'heading_2' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, - 'heading_3' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, - 'bulleted_list_item' => \RedberryProducts\MdNotion\Adapters\BulletedListItemAdapter::class, - 'numbered_list_item' => \RedberryProducts\MdNotion\Adapters\NumberedListItemAdapter::class, - 'to_do' => \RedberryProducts\MdNotion\Adapters\ToDoAdapter::class, - 'toggle' => \RedberryProducts\MdNotion\Adapters\ToggleAdapter::class, - 'code' => \RedberryProducts\MdNotion\Adapters\CodeAdapter::class, - 'quote' => \RedberryProducts\MdNotion\Adapters\QuoteAdapter::class, - 'callout' => \RedberryProducts\MdNotion\Adapters\CalloutAdapter::class, - 'divider' => \RedberryProducts\MdNotion\Adapters\DividerAdapter::class, - 'bookmark' => \RedberryProducts\MdNotion\Adapters\BookmarkAdapter::class, - 'image' => \RedberryProducts\MdNotion\Adapters\ImageAdapter::class, - 'file' => \RedberryProducts\MdNotion\Adapters\FileAdapter::class, - 'video' => \RedberryProducts\MdNotion\Adapters\VideoAdapter::class, - 'column_list' => \RedberryProducts\MdNotion\Adapters\ColumnListAdapter::class, - 'column' => \RedberryProducts\MdNotion\Adapters\ColumnAdapter::class, - 'table' => \RedberryProducts\MdNotion\Adapters\TableAdapter::class, - 'table_row' => \RedberryProducts\MdNotion\Adapters\TableRowAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, + 'heading_1' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, + 'heading_2' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, + 'heading_3' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, + 'bulleted_list_item' => \Redberry\MdNotion\Adapters\BulletedListItemAdapter::class, + 'numbered_list_item' => \Redberry\MdNotion\Adapters\NumberedListItemAdapter::class, + 'to_do' => \Redberry\MdNotion\Adapters\ToDoAdapter::class, + 'toggle' => \Redberry\MdNotion\Adapters\ToggleAdapter::class, + 'code' => \Redberry\MdNotion\Adapters\CodeAdapter::class, + 'quote' => \Redberry\MdNotion\Adapters\QuoteAdapter::class, + 'callout' => \Redberry\MdNotion\Adapters\CalloutAdapter::class, + 'divider' => \Redberry\MdNotion\Adapters\DividerAdapter::class, + 'bookmark' => \Redberry\MdNotion\Adapters\BookmarkAdapter::class, + 'image' => \Redberry\MdNotion\Adapters\ImageAdapter::class, + 'file' => \Redberry\MdNotion\Adapters\FileAdapter::class, + 'video' => \Redberry\MdNotion\Adapters\VideoAdapter::class, + 'column_list' => \Redberry\MdNotion\Adapters\ColumnListAdapter::class, + 'column' => \Redberry\MdNotion\Adapters\ColumnAdapter::class, + 'table' => \Redberry\MdNotion\Adapters\TableAdapter::class, + 'table_row' => \Redberry\MdNotion\Adapters\TableRowAdapter::class, ], ]; diff --git a/examples/mdnotion-facade-full-example.php b/examples/mdnotion-facade-full-example.php index 2687657..4e33e39 100644 --- a/examples/mdnotion-facade-full-example.php +++ b/examples/mdnotion-facade-full-example.php @@ -23,9 +23,9 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Facades\MdNotion; -use RedberryProducts\MdNotion\MdNotionServiceProvider; -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\Facades\MdNotion; +use Redberry\MdNotion\MdNotionServiceProvider; +use Redberry\MdNotion\SDK\Notion; // Set up Laravel container $container = new Container; diff --git a/examples/mdnotion-facade-read-example.php b/examples/mdnotion-facade-read-example.php index 3a3d1cc..3d515c6 100644 --- a/examples/mdnotion-facade-read-example.php +++ b/examples/mdnotion-facade-read-example.php @@ -23,9 +23,9 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Facades\MdNotion; -use RedberryProducts\MdNotion\MdNotionServiceProvider; -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\Facades\MdNotion; +use Redberry\MdNotion\MdNotionServiceProvider; +use Redberry\MdNotion\SDK\Notion; // Set up Laravel container $container = new Container; diff --git a/examples/page-reader-example.php b/examples/page-reader-example.php index e83fcf7..1a8917b 100644 --- a/examples/page-reader-example.php +++ b/examples/page-reader-example.php @@ -12,12 +12,12 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Adapters\BlockAdapterFactory; -use RedberryProducts\MdNotion\SDK\Notion; -use RedberryProducts\MdNotion\Services\BlockRegistry; -use RedberryProducts\MdNotion\Services\DatabaseReader; -use RedberryProducts\MdNotion\Services\DatabaseTable; -use RedberryProducts\MdNotion\Services\PageReader; +use Redberry\MdNotion\Adapters\BlockAdapterFactory; +use Redberry\MdNotion\SDK\Notion; +use Redberry\MdNotion\Services\BlockRegistry; +use Redberry\MdNotion\Services\DatabaseReader; +use Redberry\MdNotion\Services\DatabaseTable; +use Redberry\MdNotion\Services\PageReader; // Set up Laravel container $container = new Container; diff --git a/examples/sdk-example.php b/examples/sdk-example.php index fe4b686..ac9aa90 100644 --- a/examples/sdk-example.php +++ b/examples/sdk-example.php @@ -2,7 +2,7 @@ require_once __DIR__.'/../vendor/autoload.php'; -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\SDK\Notion; $token = include __DIR__.'/../notion-token.php'; $notion = new Notion($token, '2025-09-03'); diff --git a/examples/table-fetch-example.php b/examples/table-fetch-example.php index 596a69d..bf4ef31 100644 --- a/examples/table-fetch-example.php +++ b/examples/table-fetch-example.php @@ -12,7 +12,7 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Adapters\TableAdapter; +use Redberry\MdNotion\Adapters\TableAdapter; // Set up Laravel container $container = new Container; @@ -56,7 +56,7 @@ // Bind view factory to container $container->instance('view', $factory); View::setFacadeApplication($container); -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\SDK\Notion; // Load table JSON $tableJson = file_get_contents(__DIR__.'/../BlockJsonExamples/TableJson.json'); diff --git a/examples/toggle-fetch-example.php b/examples/toggle-fetch-example.php index 13842a3..1dc32c7 100644 --- a/examples/toggle-fetch-example.php +++ b/examples/toggle-fetch-example.php @@ -12,7 +12,7 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Adapters\ToggleAdapter; +use Redberry\MdNotion\Adapters\ToggleAdapter; // Set up Laravel container $container = new Container; @@ -56,7 +56,7 @@ // Bind view factory to container $container->instance('view', $factory); View::setFacadeApplication($container); -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\SDK\Notion; // Load toggle JSON $toggleJson = file_get_contents(__DIR__.'/../BlockJsonExamples/ToggleJson.json'); diff --git a/index.php b/index.php index ab2d3f3..fdafcca 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ require_once __DIR__.'/vendor/autoload.php'; -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\SDK\Notion; $token = include __DIR__.'/notion-token.php'; $notion = new Notion($token, '2025-09-03'); diff --git a/mdnotion_prd.md b/mdnotion_prd.md index a6b3f9b..2e39e5f 100644 --- a/mdnotion_prd.md +++ b/mdnotion_prd.md @@ -25,7 +25,7 @@ The mission of MdNotion is to provide Laravel developers with an easy, reliable, ## Usage goal ```php -use RedberryProducts\Facades\MdNotion; +use Redberry\Facades\MdNotion; $pageId = '263d9316605a806f9e95e1377a46ff3e'; $MdNotion = MdNotion::make($pageId); diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d39c995..48d0829 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -16,7 +16,7 @@ backupStaticProperties="false" > - + tests diff --git a/src/Adapters/BaseBlockAdapter.php b/src/Adapters/BaseBlockAdapter.php index 3d09774..697c620 100644 --- a/src/Adapters/BaseBlockAdapter.php +++ b/src/Adapters/BaseBlockAdapter.php @@ -1,9 +1,9 @@ setSdk($this->sdk); $contents[] = trim($adapter->toMarkdown($childBlock)); diff --git a/src/Adapters/ColumnListAdapter.php b/src/Adapters/ColumnListAdapter.php index 9c8c213..4150194 100644 --- a/src/Adapters/ColumnListAdapter.php +++ b/src/Adapters/ColumnListAdapter.php @@ -1,8 +1,8 @@ hasChildPages()) { - $pageReader = app(\RedberryProducts\MdNotion\Services\PageReader::class); + $pageReader = app(\Redberry\MdNotion\Services\PageReader::class); $this->setChildPages( $this->getChildPages()->map(function (Page $page) use ($pageReader) { return $pageReader->read($page->getId()); @@ -77,7 +77,7 @@ public function hasTableContent(): bool */ public function fetch(): static { - $databaseReader = app(\RedberryProducts\MdNotion\Services\DatabaseReader::class); + $databaseReader = app(\Redberry\MdNotion\Services\DatabaseReader::class); $fetchedDatabase = $databaseReader->read($this->getId()); // Copy all data from the fetched database to this instance diff --git a/src/Objects/Page.php b/src/Objects/Page.php index 3372a3a..c1fbe57 100644 --- a/src/Objects/Page.php +++ b/src/Objects/Page.php @@ -1,6 +1,6 @@ hasChildPages()) { - $pageReader = app(\RedberryProducts\MdNotion\Services\PageReader::class); + $pageReader = app(\Redberry\MdNotion\Services\PageReader::class); $this->setChildPages( $this->getChildPages()->map(function (Page $page) use ($pageReader) { return $pageReader->read($page->getId()); @@ -124,7 +124,7 @@ public function readChildPagesContent(): static public function readChildDatabasesContent(): static { if ($this->hasChildDatabases()) { - $databaseReader = app(\RedberryProducts\MdNotion\Services\DatabaseReader::class); + $databaseReader = app(\Redberry\MdNotion\Services\DatabaseReader::class); $this->setChildDatabases( $this->getChildDatabases()->map(function (Database $database) use ($databaseReader) { return $databaseReader->read($database->getId()); @@ -161,7 +161,7 @@ public function readAllPagesContent(): static */ public function fetch(): static { - $pageReader = app(\RedberryProducts\MdNotion\Services\PageReader::class); + $pageReader = app(\Redberry\MdNotion\Services\PageReader::class); $fetchedPage = $pageReader->read($this->getId()); // Copy all data from the fetched page to this instance diff --git a/src/SDK/Notion.php b/src/SDK/Notion.php index b2b311e..c75282b 100644 --- a/src/SDK/Notion.php +++ b/src/SDK/Notion.php @@ -1,8 +1,8 @@ toMarkdown($block); expect($markdown)->toBe('- [ ] To do 1'); @@ -70,7 +70,7 @@ ], ]; - $adapter = new TodoAdapter; + $adapter = new ToDoAdapter; $markdown = $adapter->toMarkdown($block); expect($markdown)->toBe('- [x] Completed task'); @@ -124,7 +124,7 @@ ], ]; - $adapter = new TodoAdapter; + $adapter = new ToDoAdapter; $markdown = $adapter->toMarkdown($block); expect($markdown)->toBe('- [x] **Formatted** _todo item_'); diff --git a/tests/Adapters/ToggleAdapterTest.php b/tests/Adapters/ToggleAdapterTest.php index 052ebe6..fd427b2 100644 --- a/tests/Adapters/ToggleAdapterTest.php +++ b/tests/Adapters/ToggleAdapterTest.php @@ -1,9 +1,9 @@ mockPageReader = Mockery::mock(PageReader::class); @@ -41,5 +41,5 @@ $mdNotion = MdNotion::make($pageId); - expect($mdNotion)->toBeInstanceOf(\RedberryProducts\MdNotion\MdNotion::class); + expect($mdNotion)->toBeInstanceOf(\Redberry\MdNotion\MdNotion::class); }); diff --git a/tests/MdNotionTest.php b/tests/MdNotionTest.php index 173f5c9..670a508 100644 --- a/tests/MdNotionTest.php +++ b/tests/MdNotionTest.php @@ -1,10 +1,10 @@ mockDatabaseReader = Mockery::mock(DatabaseReader::class); diff --git a/tests/Objects/IconTest.php b/tests/Objects/IconTest.php index c8229b2..0a4cb28 100644 --- a/tests/Objects/IconTest.php +++ b/tests/Objects/IconTest.php @@ -1,7 +1,7 @@ mockPageReader = Mockery::mock(PageReader::class); diff --git a/tests/Objects/RenderTitleTest.php b/tests/Objects/RenderTitleTest.php index d887e9c..d6a4c17 100644 --- a/tests/Objects/RenderTitleTest.php +++ b/tests/Objects/RenderTitleTest.php @@ -1,7 +1,7 @@ in(__DIR__); diff --git a/tests/SDK/Requests/AddCommentToPageRequestTest.php b/tests/SDK/Requests/AddCommentToPageRequestTest.php index 01d11db..c05228b 100644 --- a/tests/SDK/Requests/AddCommentToPageRequestTest.php +++ b/tests/SDK/Requests/AddCommentToPageRequestTest.php @@ -1,7 +1,7 @@ \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, ]; $factory = new BlockAdapterFactory($notion, $adapterMap); @@ -15,14 +15,14 @@ $adapter = $registry->resolve('paragraph'); - expect($adapter)->toBeInstanceOf(\RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class); + expect($adapter)->toBeInstanceOf(\Redberry\MdNotion\Adapters\ParagraphAdapter::class); }); test('block registry returns registered block types', function () { $notion = new Notion('test-key', '2022-06-28'); $adapterMap = [ - 'paragraph' => \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, - 'heading_1' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, + 'heading_1' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, ]; $factory = new BlockAdapterFactory($notion, $adapterMap); diff --git a/tests/Services/DatabaseReaderTest.php b/tests/Services/DatabaseReaderTest.php index 98e84fa..55f2620 100644 --- a/tests/Services/DatabaseReaderTest.php +++ b/tests/Services/DatabaseReaderTest.php @@ -1,9 +1,9 @@ 'test-page-id']); diff --git a/tests/Services/PageReaderTest.php b/tests/Services/PageReaderTest.php index 322d263..c99f5a7 100644 --- a/tests/Services/PageReaderTest.php +++ b/tests/Services/PageReaderTest.php @@ -1,9 +1,9 @@ \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, ]; $factory = new BlockAdapterFactory($notion, $adapterMap); $registry = new BlockRegistry($factory); diff --git a/tests/TestCase.php b/tests/TestCase.php index c8e6c36..6582465 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,10 +1,10 @@ 'RedberryProducts\\MdNotion\\Database\\Factories\\'.class_basename($modelName).'Factory' + fn (string $modelName) => 'Redberry\\MdNotion\\Database\\Factories\\'.class_basename($modelName).'Factory' ); }