Skip to content

laravel-shift/canvas

Repository files navigation



Introduction

A Laravel publishing platform. Canvas is a fully open source package to extend your 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!

Installation

Note: Canvas requires you to have user authentication in place prior to installation. You may run the make:auth Artisan command to satisfy this requirement.

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

composer require cnvs/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

If you choose to design your own theme instead of the default, you can publish the views with:

php artisan vendor:publish --provider="Canvas\CanvasServiceProvider" --tag="canvas-views"

If you publish your own views, review the API specifications below to see available data for the public-facing endpoints:

API Specifications
  • GET /blog Returns a paginated index of posts

  • "data": [
        "posts": "Illuminate\Pagination\Paginator"
    ]
  • GET /blog/{slug} Returns a single blog post

  • "data": [
        "author": "App\User",
        "post": "App\Canvas\Post",
        "meta": [
            "og_title": "string"
            "twitter_title": "string"
            "og_description": "string"
            "meta_description": "string"
            "twitter_description": "string"
    	],
        "next": "App\Canvas\Post",
        "random": "App\Canvas\Post"
    ]
  • GET /blog/tag/{slug} Returns a paginated index of posts for a single tag

  • "data": [
        "topic": "Canvas\Tag",
        "posts": "Illuminate\Pagination\Paginator"
    ]

If you want to integrate Unsplash images into your content, set up a new application at https://unsplash.com/oauth/applications. Grab your access key and update config/canvas.php:

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

Updates

You may update your Canvas installation using composer:

composer update

Run any new migrations using the migrate Artisan command:

php artisan migrate

You may also want to run this command to re-publish the assets:

php artisan vendor:publish --tag=canvas-assets --force

Testing

Run the tests with:

composer test

License

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

About

A Laravel publishing platform

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 49.6%
  • Vue 41.5%
  • JavaScript 3.9%
  • SCSS 2.9%
  • Blade 2.1%