{"id":2016146,"url":"https://austintoddj.github.io/Canvas","last_synced_at":"2025-03-28T19:31:48.244Z","repository":{"id":36980906,"uuid":"52815899","full_name":"austintoddj/canvas","owner":"austintoddj","description":"Publishing on your own terms","archived":false,"fork":false,"pushed_at":"2024-03-12T20:02:50.000Z","size":175594,"stargazers_count":3257,"open_issues_count":29,"forks_count":520,"subscribers_count":91,"default_branch":"master","last_synced_at":"2024-10-29T14:56:15.039Z","etag":null,"topics":["blog","canvas","laravel","platform","publishing"],"latest_commit_sha":null,"homepage":"http://trycanvas.app","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/austintoddj.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"license","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"austintoddj"}},"created_at":"2016-02-29T19:06:11.000Z","updated_at":"2024-10-27T18:46:54.000Z","dependencies_parsed_at":"2023-01-17T11:15:29.595Z","dependency_job_id":"d7faba31-6cb4-4307-8096-10fc68fe9701","html_url":"https://github.com/austintoddj/canvas","commit_stats":{"total_commits":3417,"total_committers":77,"mean_commits":44.37662337662338,"dds":0.1954931226221832,"last_synced_commit":"93858fdb858ef8ce463a03a15c56e94aa938bbc0"},"previous_names":["cnvs/canvas"],"tags_count":183,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintoddj%2Fcanvas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintoddj%2Fcanvas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintoddj%2Fcanvas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintoddj%2Fcanvas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austintoddj","download_url":"https://codeload.github.com/austintoddj/canvas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246088541,"owners_count":20721707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blog","canvas","laravel","platform","publishing"],"created_at":"2024-01-20T21:36:53.257Z","updated_at":"2025-03-28T19:31:47.386Z","avatar_url":"https://github.com/austintoddj.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://trycanvas.app\"\u003e\n        \u003cimg src=\".github/docs/header.png\" alt=\"Homepage for trycanvas.app\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/austintoddj/canvas/actions\"\u003e\u003cimg src=\"https://github.com/austintoddj/canvas/workflows/tests/badge.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/austintoddj/canvas\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/austintoddj/canvas\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/austintoddj/canvas\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/austintoddj/canvas\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/austintoddj/canvas\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/austintoddj/canvas\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Introduction\n\nCanvas is a fully open source package to extend your existing [Laravel](https://laravel.com) application and get you up-and-running with a blog in just a few minutes. In addition to a distraction-free writing experience, you can view monthly trends on your content, get insights into reader traffic and more!\n\n## System Requirements\n\n- PHP \u003e= 7.3\n- Laravel \u003e= 6.0\n- One of the [five supported databases](https://laravel.com/docs/10.x/database#introduction) by Laravel\n\n## Installation\n\nYou may use composer to install Canvas into your Laravel project:\n\n```bash\ncomposer require austintoddj/canvas\n```\n\nPublish the assets and primary configuration file using the `canvas:install` Artisan command:\n\n```bash\nphp artisan canvas:install\n```\n\nCreate a symbolic link to ensure file uploads are publicly accessible from the web using the `storage:link` Artisan command:\n\n```bash\nphp artisan storage:link\n```\n\n## Configuration\n\nAfter publishing Canvas's assets, a primary configuration file will be located at `config/canvas.php`. This file allows you to customize various aspects of how your application uses the package.\n\nCanvas exposes its UI at `/canvas` by default. This can be changed by updating either the `path` or `domain` option:\n\n```php\n/*\n|--------------------------------------------------------------------------\n| Base Domain\n|--------------------------------------------------------------------------\n|\n| This is the subdomain where Canvas will be accessible from. If the\n| domain is set to null, Canvas will reside under the defined base\n| path below. Otherwise, this will be used as the subdomain.\n|\n*/\n\n'domain' =\u003e env('CANVAS_DOMAIN', null),\n\n/*\n|--------------------------------------------------------------------------\n| Base Path\n|--------------------------------------------------------------------------\n|\n| This is the URI where Canvas will be accessible from. If the path\n| is set to null, Canvas will reside under the same path name as\n| the application. Otherwise, this is used as the base path.\n|\n*/\n\n'path' =\u003e env('CANVAS_PATH_NAME', 'canvas'),\n```\n\nSometimes, you may want to apply custom roles or permissions when accessing Canvas. You can create and attach any additional middleware here:\n\n```php\n/*\n|--------------------------------------------------------------------------\n| Route Middleware\n|--------------------------------------------------------------------------\n|\n| These middleware will be attached to every route in Canvas, giving you\n| the chance to add your own middleware to this list or change any of\n| the existing middleware. Or, you can simply stick with the list.\n|\n*/\n\n'middleware' =\u003e [\n    'web',\n],\n```\n\nCanvas uses the storage disk for media uploads. You may configure the different filesystem options here:\n\n```php\n/*\n|--------------------------------------------------------------------------\n| Storage\n|--------------------------------------------------------------------------\n|\n| This is the storage disk Canvas will use to put file uploads. You may\n| use any of the disks defined in the config/filesystems.php file and\n| you may also change the maximum upload size from its 3MB default.\n|\n*/\n\n'storage_disk' =\u003e env('CANVAS_STORAGE_DISK', 'local'),\n\n'storage_path' =\u003e env('CANVAS_STORAGE_PATH', 'public/canvas'),\n\n'upload_filesize' =\u003e env('CANVAS_UPLOAD_FILESIZE', 3145728),\n```\n\n## Roles \u0026 Permissions\n\nCanvas comes with 3 pre-defined roles out-of-the-box:\n\n- **Contributor** (A user who can write and manage their own posts but cannot publish them)\n- **Editor** (A user who can publish and manage posts including the posts of other users)\n- **Admin** (A user who can do everything and see everything)\n\nWhen you install a fresh version of Canvas, you'll have a default admin user set up automatically. From there, you can perform any basic CRUD actions on users, as well as assign their various roles.\n\n## Canvas UI\n\n**Want a beautiful, Medium.com-inspired frontend?** Use the `canvas:ui` Artisan command to install the scaffolding:\n\n```bash\nphp artisan canvas:ui\n```\n\nAfter generating the frontend scaffolding, your `package.json` file will include the necessary dependencies to install and compile:\n\n```bash\n# Using NPM\nnpm install\nnpm run dev\n\n# Using Yarn\nyarn\nyarn dev\n```\n\nThat's it! You can navigate to `/canvas-ui` and check it out for yourself. You're free to modify any aspect of it\nthat you'd like.\n\n## Unsplash Integration\n\n**Want access to the entire [Unsplash](https://unsplash.com) library?** Set up a new application at [https://unsplash.com/oauth/applications](https://unsplash.com/oauth/applications), grab your access key, and update `config/canvas.php`:\n\n```php\n/*\n|--------------------------------------------------------------------------\n| Unsplash Integration\n|--------------------------------------------------------------------------\n|\n| Visit https://unsplash.com/oauth/applications to create a new Unsplash\n| app. Use the confidential Access Key given to you to integrate with\n| the API. Note that demo apps are limited to 50 requests per hour.\n|\n*/\n\n'unsplash' =\u003e [\n    'access_key' =\u003e env('CANVAS_UNSPLASH_ACCESS_KEY'),\n]\n```\n\n## E-mail Notifications\n\n**Want a weekly summary?** Canvas allows users to receive a weekly digest of their authored content. Once your application is [configured for sending mail](https://laravel.com/docs/10.x/mail), update `config/canvas.php`:\n\n```php\n/*\n|--------------------------------------------------------------------------\n| E-Mail Notifications\n|--------------------------------------------------------------------------\n|\n| This option controls e-mail notifications that will be sent via the\n| default application mail driver. A default option is provided to\n| support the notification system as an opt-in feature.\n|\n|\n*/\n\n'mail' =\u003e [\n    'enabled' =\u003e env('CANVAS_MAIL_ENABLED', false),\n]\n```\n\nSince this feature runs on [Laravel's Scheduler](https://laravel.com/docs/10.x/scheduling), you'll need to add the \nfollowing cron entry to your server:\n\n```bash\n* * * * * cd /path-to-your-project \u0026\u0026 php artisan schedule:run \u003e\u003e /dev/null 2\u003e\u00261\n```\n\n## API\n\nInstalling [Canvas UI](#canvas-ui) will be the most efficient way to get up and running with a frontend interface to display your data. However many users will opt for creating this by hand since it gives flexibility to their design aesthetic.\n\nUsing the `published` scope will allow you to only retrieve posts that have a published date in the past:\n\n```php\nCanvas\\Models\\Post::published()-\u003eget()\n```\n\nYou can also retrieve the inverse with a `draft` scope:\n\n```php\nCanvas\\Models\\Post::draft()-\u003eget()\n```\n\nTo return a single post, you'll likely want to find it by a given slug, as well as include related entities such as:\n\n```php\n$post = Canvas\\Models\\Post::with('user', 'tags', 'topic')-\u003efirstWhere('slug', $slug);\n```\n\n\u003e **Important:** In the same method that returns a post, make sure you fire the `PostViewed` event, or else a \n\u003e view/visit will not be recorded.\n\n```php\nevent(new Canvas\\Events\\PostViewed($post));\n```\n\nYou can find a tag by a given slug:\n\n```php\nCanvas\\Models\\Tag::with('posts')-\u003efirstWhere('slug', $slug);\n```\n\nAnd a similar query can be used for a topic:\n\n```php\nCanvas\\Models\\Topic::with('posts')-\u003efirstWhere('slug', $slug);\n```\n\nUsers can be retrieved by their `id`, `username`, or `email`:\n\n```php\n$user = Canvas\\Models\\User::find($id);\n$user = Canvas\\Models\\User::firstWhere('username', $username);\n$user = Canvas\\Models\\User::firstWhere('email', $email);\n```\n\nAdditionally, you can return the users' published posts with their associated topic:\n\n```php\n$user-\u003eposts()-\u003epublished()-\u003ewith('topic')\n```\n\n## Updates\n\nCanvas follows [Semantic Versioning](https://semver.org) and increments versions as `MAJOR.MINOR.PATCH` numbers.\n- Major versions **will** contain breaking changes, so follow the [upgrade guide](.github/UPGRADE.md) for a\n  step-by-step breakdown\n- Minor and patch versions should **never** contain breaking changes, so you can safely update the package by following the steps below:\n\nYou may update your Canvas installation using composer:\n\n```bash\ncomposer update\n```\n\nRun any new migrations using the `canvas:migrate` Artisan command:\n\n```bash\nphp artisan canvas:migrate\n```\n\nRe-publish the assets using the `canvas:publish` Artisan command:\n\n```bash\nphp artisan canvas:publish\n```\n\nTo keep the assets up-to-date and avoid issues in future updates, you may add the `canvas:publish` command to the `post-update-cmd` scripts in your application's `composer.json` file:\n\n```bash\n{\n    \"scripts\": {\n        \"post-update-cmd\": [\n            \"@php artisan canvas:publish --ansi\"\n        ]\n    }\n}\n```\n\n## Contributing\n\nThank you for considering contributing to Canvas! The [contribution guide can be found here](https://github.com/austintoddj/canvas/blob/master/.github/CONTRIBUTING.md).\n\n## Testing\n\nRun the tests with:\n\n```bash\ncomposer test\n```\n\n## Troubleshooting\n\nIf you're running into problems, feel free to [open a new issue](https://github.com/austintoddj/canvas/issues) or check the [Discussions](https://github.com/austintoddj/canvas/discussions) forum to see if anyone else has run into something similar.\n\n## License\n\nCanvas is open-sourced software licensed under the [MIT license](license).\n\n## Credits\n\n- [@austintoddj](https://twitter.com/austintoddj)\n- [@talvbansal](https://twitter.com/talv)\n- [@reliq](https://twitter.com/IAmReliq)\n- [@mithicher](https://twitter.com/mithicher)\n- [@themsaid](https://twitter.com/themsaid)\n- [@NinaLimpi](https://twitter.com/NinaLimpi)\n\n","funding_links":["https://github.com/sponsors/austintoddj"],"categories":["Resources"],"sub_categories":["Applications Built with Laravel"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/austintoddj.github.io%2FCanvas","html_url":"https://awesome.ecosyste.ms/projects/austintoddj.github.io%2FCanvas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/austintoddj.github.io%2FCanvas/lists"}