All Projects → austintoddj → Canvas

austintoddj / Canvas

Licence: mit
A Laravel publishing platform

Programming Languages

PHP
23972 projects - #3 most used programming language
Vue
7211 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
Blade
752 projects

Projects that are alternatives of or similar to Canvas

Laravel Ecommerce
Laravel open source e-commerce system.
Stars: ✭ 163 (-94.26%)
Mutual labels:  platform, laravel
Platform
A @laravel based RAD platform for back-office applications, admin/user panels, and dashboards.
Stars: ✭ 2,623 (-7.58%)
Mutual labels:  platform, laravel
Dotcom Rendering
The Guardian DotCom Rendering Service.
Stars: ✭ 169 (-94.05%)
Mutual labels:  platform, publishing
Neontsunami Laravel
Source for my website and blog
Stars: ✭ 142 (-95%)
Mutual labels:  blog, laravel
Materialize Blog
redesign blog using material design
Stars: ✭ 212 (-92.53%)
Mutual labels:  blog, laravel
Laravel Blog Poetry All
Laravel诗词博客-匠心编程,热爱生活。喜欢就 Star 吧
Stars: ✭ 157 (-94.47%)
Mutual labels:  blog, laravel
Boo
Boo - A beautiful, clean and responsive theme for Ghost.
Stars: ✭ 176 (-93.8%)
Mutual labels:  blog, publishing
Laravel Blog Api
laravel+vue 个人博客,项目预览: http://www.golang365.com
Stars: ✭ 127 (-95.53%)
Mutual labels:  blog, laravel
Blogetc
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.
Stars: ✭ 198 (-93.02%)
Mutual labels:  blog, laravel
Vuedo
Vuedo is a blog platform, built with Laravel and Vue.js.
Stars: ✭ 2,226 (-21.56%)
Mutual labels:  blog, laravel
Blog
趁还能折腾的时候多读书——前端何时是个头
Stars: ✭ 1,730 (-39.04%)
Mutual labels:  blog, canvas
Qards
Qards is a blogging platform focused on performance and on closing the gap between content publishers and developers: https://qards.io
Stars: ✭ 226 (-92.04%)
Mutual labels:  blog, platform
October
Self-hosted CMS platform based on the Laravel PHP Framework.
Stars: ✭ 10,740 (+278.44%)
Mutual labels:  platform, laravel
Base
YASCMF 基础开发版(YASCMF/BASE)
Stars: ✭ 162 (-94.29%)
Mutual labels:  blog, laravel
Oblog
An Auto Rendering 🔽 Blogging System Based on MarkDown & Vue.js | 自动渲染装载 MarkDown 内容的博客系统
Stars: ✭ 133 (-95.31%)
Mutual labels:  blog, platform
Sheets
Store & retrieve your static content in plain text files
Stars: ✭ 175 (-93.83%)
Mutual labels:  blog, laravel
Coreblog
一款优雅的博客系统
Stars: ✭ 119 (-95.81%)
Mutual labels:  blog, laravel
Cell Blog
基于 Laravel 7开发,支持 Markdown 语法的博客
Stars: ✭ 120 (-95.77%)
Mutual labels:  blog, laravel
Lines Engine
Lines is a customizable blog framework for Rails. It aims at making publishing simple and beautiful.
Stars: ✭ 191 (-93.27%)
Mutual labels:  blog, publishing
Wink
A Laravel-based publishing platform
Stars: ✭ 2,598 (-8.46%)
Mutual labels:  publishing, laravel

Canvas homepage

Build Status Total Downloads Latest Stable Version License

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!

Table of Contents

System Requirements

Installation

You may use composer to install Canvas into your Laravel project:

composer require austintoddj/canvas

Publish the assets and primary configuration file using the canvas:install Artisan command:

php artisan canvas:install

Create a symbolic link to ensure file uploads are publicly accessible from the web using the storage:link Artisan command:

php artisan storage:link

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:

/*
|--------------------------------------------------------------------------
| Base Domain
|--------------------------------------------------------------------------
|
| This is the subdomain where Canvas will be accessible from. If the
| domain is set to null, Canvas will reside under the defined base
| path below. Otherwise, this will be used as the subdomain.
|
*/

'domain' => env('CANVAS_DOMAIN', null),

/*
|--------------------------------------------------------------------------
| Base Path
|--------------------------------------------------------------------------
|
| This is the URI where Canvas will be accessible from. If the path
| is set to null, Canvas will reside under the same path name as
| the application. Otherwise, this is used as the base path.
|
*/

'path' => env('CANVAS_PATH_NAME', 'canvas'),

Sometimes, you may want to apply custom roles or permissions when accessing Canvas. You can create and attach any additional middleware here:

/*
|--------------------------------------------------------------------------
| Route Middleware
|--------------------------------------------------------------------------
|
| These middleware will be attached to every route in Canvas, giving you
| the chance to add your own middleware to this list or change any of
| the existing middleware. Or, you can simply stick with the list.
|
*/

'middleware' => [
    'web',
],

Canvas uses the storage disk for media uploads. You may configure the different filesystem options here:

/*
|--------------------------------------------------------------------------
| Storage
|--------------------------------------------------------------------------
|
| This is the storage disk Canvas will use to put file uploads. You may
| use any of the disks defined in the config/filesystems.php file and
| you may also change the maximum upload size from its 3MB default.
|
*/

'storage_disk' => env('CANVAS_STORAGE_DISK', 'local'),

'storage_path' => env('CANVAS_STORAGE_PATH', 'public/canvas'),

'upload_filesize' => env('CANVAS_UPLOAD_FILESIZE', 3145728),

Roles & Permissions

Canvas comes with 3 pre-defined roles out-of-the-box:

  • Contributor (Somebody who can write and manage their own posts but cannot publish them)
  • Editor (Somebody who can publish and manage posts including the posts of other users)
  • Admin (Somebody 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.

Features

Note: The following features are completely optional, you are not required to use them.

Canvas UI

Want a beautiful, Medium.com-inspired frontend? Use the canvas:ui Artisan command to install the scaffolding:

php artisan canvas:ui

After generating the frontend scaffolding, your package.json file will include the necessary dependencies to install and compile:

# Using NPM
npm install
npm run dev

# Using Yarn
yarn
yarn dev

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:

/*
|--------------------------------------------------------------------------
| Unsplash Integration
|--------------------------------------------------------------------------
|
| Visit https://unsplash.com/oauth/applications to create a new Unsplash
| app. Use the confidential Access Key given to you to integrate with
| the API. Note that demo apps are limited to 50 requests per hour.
|
*/

'unsplash' => [
    'access_key' => env('CANVAS_UNSPLASH_ACCESS_KEY'),
]

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:

/*
|--------------------------------------------------------------------------
| E-Mail Notifications
|--------------------------------------------------------------------------
|
| This option controls e-mail notifications that will be sent via the
| default application mail driver. A default option is provided to
| support the notification system as an opt-in feature.
|
|
*/

'mail' => [
    'enabled' => env('CANVAS_MAIL_ENABLED', false),
]

Since this feature runs on Laravel's Scheduler, you'll need to add the following cron entry to your server:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

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:

Canvas\Models\Post::published()->get()

You can also retrieve the inverse with a draft scope:

Canvas\Models\Post::draft()->get()

To return a single post, you'll likely want to find it by a given slug, as well as include related entities such as:

$post = Canvas\Models\Post::with('user', 'tags', 'topic')->firstWhere('slug', $slug);

Important: In the same method that returns a post, make sure you include the PostViewed event, or else a view/visit will not be recorded.

event(new Canvas\Events\PostViewed($post));

You can find a tag by a given slug:

Canvas\Models\Tag::with('posts')->firstWhere('slug', $slug);

And a similar query can be used for a topic:

Canvas\Models\Topic::with('posts')->firstWhere('slug', $slug);

Users can be retrieved by their id, username, or email:

$user = Canvas\Models\User::find($id);
$user = Canvas\Models\User::firstWhere('username', $username);
$user = Canvas\Models\User::firstWhere('email', $email);

Additionally, you can return the users' published posts with their associated topic:

$user->posts()->published()->with('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:

composer update

Run any new migrations using the canvas:migrate Artisan command:

php artisan canvas:migrate

Re-publish the assets using the canvas:publish Artisan command:

php artisan canvas:publish

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:

{
    "scripts": {
        "post-update-cmd": [
            "@php artisan canvas:publish --ansi"
        ]
    }
}

Contributing

Thank you for considering contributing to Canvas!

You can open a completely prebuilt, ready-to-code development environment using Gitpod.

Open in Gitpod

Alternatively, you can use the contribution guide to assist you in manually setting up an environment on your own machine.

One of the ongoing goals for Canvas is to make it as accessible as possible. If you come across any translation mistakes or issues and want to make a contribution, please create a pull request. If you don't see your native language included in the resources/lang directory, feel free to add it.

Testing

Run the tests with:

composer test

License

Canvas is open-sourced software licensed under the MIT license.

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].