mopo922 / canvas-importer
Command line tool to import another blog's posts into Laravel Canvas.
Requires
- php: >=7.0
- cnvs/easel: 3.3.*
- guzzlehttp/guzzle: ~6.0
- league/html-to-markdown: ^4.4
Requires (Dev)
- laravel/framework: >=5.0
This package is not auto-updated.
Last update: 2024-12-22 03:46:23 UTC
README
Command line tool to import another blog's posts into Laravel Canvas.
Installation
Canvas
Add this to your project's composer.json
file:
// ... "require": { // ... "mopo922/canvas-importer": "dev-master", // ... }, // ...
Add this to the providers
array in config/app.php
:
'providers' => [ // ... CanvasImporter\CanvasImporterServiceProvider::class, ]
Run composer update
.
After the import is complete, you can remove these lines and run composer update
again if you don't plan on using the importer any more.
Finally, you'll want to make sure config('app.url')
is defined properly in config/app.php
,
otherwise post images won't download or display properly.
WordPress
When importing a WordPress blog, you'll need to install this Basic Authentication plugin to allow the importer to talk to the WordPress API using your admin username & password:
https://github.com/WP-API/Basic-Auth
- Download the basic-auth.php file.
- "Zip" it.
- Upload it using the Add Plugin UI in your WordPress back-end.
- Activate the plugin.
IMPORTANT: You should deactivate this plugin as soon as the import is complete, as it is not recommended for production environments.
Usage
From your project's root directory, run php artisan canvas:import
. The importer
will take care of the rest, prompting you for the information it needs to complete
the task. Have the URL of your old blog handy, along with the admin username & password.
Pro Tip: If you're using a VM, like Vagrant or Laravel Homestead, make sure you're
on the server, not on the host machine, when running canvas:import
.