Download the PHP package cnvs/canvas without Composer
On this page you can find all versions of the php package cnvs/canvas. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package canvas
Short Description A Laravel publishing platform
License MIT
Homepage https://cnvs.io
Informations about the package canvas
Introduction
Canvas is a fully open source package to extend your existing Laravel 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!
System Requirements
- PHP >= 7.3
- Laravel >= 6.0
- One of the five supported databases by Laravel
Installation
You may use composer to install Canvas into your Laravel project:
Publish the assets and primary configuration file using the canvas:install
Artisan command:
Create a symbolic link to ensure file uploads are publicly accessible from the web using the storage:link
Artisan command:
Configuration
After 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.
Canvas exposes its UI at /canvas
by default. This can be changed by updating either the path
or domain
option:
Sometimes, you may want to apply custom roles or permissions when accessing Canvas. You can create and attach any additional middleware here:
Canvas uses the storage disk for media uploads. You may configure the different filesystem options here:
Roles & Permissions
Canvas comes with 3 pre-defined roles out-of-the-box:
- Contributor (A user who can write and manage their own posts but cannot publish them)
- Editor (A user who can publish and manage posts including the posts of other users)
- Admin (A user who can do everything and see everything)
When 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.
Canvas UI
Want a beautiful, Medium.com-inspired frontend? Use the canvas:ui
Artisan command to install the scaffolding:
After generating the frontend scaffolding, your package.json
file will include the necessary dependencies to install and compile:
That's it! You can navigate to /canvas-ui
and check it out for yourself. You're free to modify any aspect of it
that you'd like.
Unsplash Integration
Want access to the entire Unsplash library? Set up a new application at https://unsplash.com/oauth/applications, grab your access key, and update config/canvas.php
:
E-mail Notifications
Want a weekly summary? Canvas allows users to receive a weekly digest of their authored content. Once your application is configured for sending mail, update config/canvas.php
:
Since this feature runs on Laravel's Scheduler, you'll need to add the following cron entry to your server:
API
Installing 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.
Using the published
scope will allow you to only retrieve posts that have a published date in the past:
You can also retrieve the inverse with a draft
scope:
To return a single post, you'll likely want to find it by a given slug, as well as include related entities such as:
Important: In the same method that returns a post, make sure you fire the
PostViewed
event, or else a view/visit will not be recorded.
You can find a tag by a given slug:
And a similar query can be used for a topic:
Users can be retrieved by their id
, username
, or email
:
Additionally, you can return the users' published posts with their associated topic:
Updates
Canvas follows Semantic Versioning and increments versions as MAJOR.MINOR.PATCH
numbers.
- Major versions will contain breaking changes, so follow the upgrade guide for a step-by-step breakdown
- Minor and patch versions should never contain breaking changes, so you can safely update the package by following the steps below:
You may update your Canvas installation using composer:
Run any new migrations using the canvas:migrate
Artisan command:
Re-publish the assets using the canvas:publish
Artisan command:
To 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:
Contributing
Thank you for considering contributing to Canvas! The contribution guide can be found here.
Testing
Run the tests with:
Troubleshooting
If you're running into problems, feel free to open a new issue or check the Discussions forum to see if anyone else has run into something similar.
License
Canvas is open-sourced software licensed under the MIT license.
Credits
All versions of canvas with dependencies
ext-json Version *
doctrine/dbal Version ^2.10
laravel/framework Version ^6.0|^7.0