- Upgrading to 6.0.0 from 5.4
- Upgrading to 5.4.0 from 5.3
- Upgrading to 5.3.0 from 5.2
- Upgrading to 5.2.0 from 5.1
- Upgrading to 5.1.0 from 5.0
Important: With the release of Laravel 8 and the introduction of the legacy-factories package, Canvas no longer supports PHP <= 7.2. It does however continue to support Laravel 6/7/8 and PHP >= 7.3
The canvas_user_meta table has been removed in v6.0.0, and a new table: canvas_users will take its place. Canvas
will no longer rely on the default users table, or allow you to specify your own user model. This shift mimics the
underlying structure of WordPress and similar apps.
Note: The process for migrating data will be unique based on your choice of IDE and database.
The first step is to export all data in Canvas-related tables to a SQL dump. The important part of this step is to make sure your export does not include the table structure. You only want INSERT statements in the actual export . If you do include CREATE TABLE statements, it'll modify the new tables when importing later.
For instance, I use Sequel Pro. When I exported my data, I made sure to un-check the Structure and DROP TABLE syntax elements in the export selection screen.
The following tables need to be included in the export:
canvas_postscanvas_posts_tagscanvas_posts_topicscanvas_tagscanvas_topicscanvas_viewscanvas_visits
Once completed, you can drop those tables from your database.
Optional: If you want to keep the
migrationstable as minimal as possible, you may delete all references to_canvasrecords.
Update your austintoddj/canvas dependency to ^6.0 in your composer.json file. Upgrade the package to the latest
version:
composer updateRun the new migrations using the canvas:migrate Artisan command:
php artisan canvas:migrateYou may now import the SQL dump that you created above into your database. Remember, your database and IDE will determine if you should run into any errors while performing this action.
Once the import is complete, the user_id column in the following tables will need to be addressed:
canvas_postscanvas_tagscanvas_topics
Since those values reflect the user ID from the default users table, you'll need to make sure you manually update
those to the correct user IDs when you have them established in canvas_users.
Since we don't rely on the default users table anymore, you'll need create your first user for Canvas. It's really
simple, just run the following Artisan command:
php artisan canvas:user admin --email {email} That's it! You should jump in right away and update your credentials. Now that you've given yourself Admin access
, you can create new users from the UI. However, the canvas:user Artisan command is a handy little tool for
creating users on the fly. You can specify more options like this:
// Somebody who can write and manage their own posts but cannot publish them
php artisan canvas:user contributor --email {email}
// Somebody who can publish and manage posts including the posts of other users
php artisan canvas:user editor --email {email}
// Somebody who can do everything and see everything
php artisan canvas:user admin --email {email}The base path variable name in config/canvas.php changed to be consistent with the newly-added domain variable.
You'll need to make sure your .env file is up to date with the correct variable: CANVAS_PATH.
Remove the auth line from the middleware block in config/canvas.php.
Remove the entire user block from config/canvas.php.
Re-publish the assets using the canvas:publish Artisan command:
php artisan canvas:publishClear any cached views using the view:clear Artisan command:
php artisan view:clearImportant: The package name has changed from
cnvs/canvastoaustintoddj/canvas
Update the new austintoddj/canvas dependency to ^5.4 in your composer.json file. Upgrade the package to the
latest version:
composer updateRun the new migrations using the migrate Artisan command:
php artisan migrateRe-publish the assets using the canvas:publish Artisan command:
php artisan canvas:publishClear any cached views using the view:clear Artisan command:
php artisan view:clearNote: The
5.3.0minor update contains does not contain breaking changes.
Update your cnvs/canvas dependency to ^5.3 in your composer.json file. Upgrade the package to the latest version:
composer updateRe-publish the assets using the canvas:publish Artisan command:
php artisan canvas:publishClear any cached views using the view:clear Artisan command:
php artisan view:clearImportant: The
Canvas\Http\Middleware\ViewThrottlemiddleware was renamed toCanvas\Http\Middleware \Session. Update any usages of this class.
Important: The
metafield for posts will now only support a title, description, and canonical link. Theog_*andtwitter_*tags were unnecessarily specific, so they were deprecated. If you use those tags in your frontend templates, simply update them with the new title and description fields.
Update your cnvs/canvas dependency to ^5.2 in your composer.json file. Upgrade the package to the latest version:
composer updateRun the new migrations using the migrate Artisan command:
php artisan migrateRe-publish the assets using the canvas:publish Artisan command:
php artisan canvas:publishClear any cached views using the view:clear Artisan command:
php artisan view:clearUpdate your cnvs/canvas dependency to ^5.1 in your composer.json file. Upgrade the package to the latest version:
composer updateAdd the following line to the Storage block in your config/canvas.php file:
'upload_filesize' => env('CANVAS_UPLOAD_FILESIZE', 3145728),Rename the Weekly Digest configuration variable:
Note: Make sure that you update your
.envfile as well to reflect this variable change
'mail' => [
'enabled' => env('CANVAS_MAIL_ENABLED', false),
],Update the boot() method in your app/Providers/CanvasServiceProvider.php file:
$this->app->booted(function () {
$schedule = resolve(Schedule::class);
$schedule->command('canvas:digest')
->weekly()
->mondays()
->timezone(config('app.timezone'))
->at('08:00')
->when(function () {
return config('canvas.mail.enabled');
});
});Run the new migrations using the migrate Artisan command:
php artisan migrateRe-publish the assets using the canvas:publish Artisan command:
php artisan canvas:publishClear any cached views using the view:clear Artisan command:
php artisan view:clear