Canvas: Integration with current project rather than creating new

Created on 7 Jan 2017  路  24Comments  路  Source: austintoddj/canvas

As per title, is this possible? I cannot seem to find anything regarding this in the documentation.

The documentation only shows the installation guide which starts a project from scratch.

P.S. I do know that this is not the correct place to ask questions, but there isn't a platform for any form of support so far. Sorry!

Most helpful comment

@ruchern We're currently looking into integrating this with existing Laravel applications. It's pretty nearly there, especially with Easel being extracted from Canvas. So stay tuned and keep an eye on the project. Or feel free to offer your own PR's or suggestions on accomplishing this!

All 24 comments

@ruchern We're currently looking into integrating this with existing Laravel applications. It's pretty nearly there, especially with Easel being extracted from Canvas. So stay tuned and keep an eye on the project. Or feel free to offer your own PR's or suggestions on accomplishing this!

@austintoddj Thanks Todd. Got to say that this is by the the cleanest (Google Material Design) and easiest to use CMS for me.

Hi @austintoddj I believe the Easel is the other repo in your account and that will be the one that is being used to integrate into existing Laravel projects? If so, I would love to have a look and contribute in any way possible and to the best of my ability!

Thank you!

That's correct @ruchern, Easel is the core Laravel Package. So if you want to contribute, we'd be doing it on the develop branch of that repo.

@austintoddj Thank you!

+1 for this. Want to integrate the blog into 2 existing projects. Going to take a look now and see if I can help out in any way.

@ruchern any update from you? What issues are you currently having regarding integration? (Just asking before I even dive into it)

@mattvb91 Well, I couldn't get pass composer require cnvs/canvas. There are lots of error related to the theme colours.

Hello @ruchern,

What you actually need to require is cnvs/easel as that is the core of canvas.

e.g.
composer require cnvs/easel

@reliq Will try that. Thanks!

Warning: Ambiguous class resolution, "CreateUsersTable" was found in both "$baseDir . '/database/migrations/2014_10_12_000000_create_users_table.php" and "/Users/ruchern/Sites/ruchern/vendor/cnvs/easel/database/migrations/2014_10_12_000000_create_users_table.php", the first will be used.
Warning: Ambiguous class resolution, "CreatePostsTable" was found in both "$baseDir . '/database/migrations/2016_09_21_171308_create_posts_table.php" and "/Users/ruchern/Sites/ruchern/vendor/cnvs/easel/database/migrations/2015_06_21_174427_create_posts_table.php", the first will be used.
Warning: Ambiguous class resolution, "CreatePasswordResetsTable" was found in both "$baseDir . '/database/migrations/2014_10_12_100000_create_password_resets_table.php" and "/Users/ruchern/Sites/ruchern/vendor/cnvs/easel/database/migrations/2016_09_02_231259_create_password_resets_table.php", the first will be used.

I just got this error. Is there way to choose the version that I would prefer or just have to reinstall Canvas?

@ruchern What version do you have right now?

@austintoddj Those were my existing migrations; albeit all fully custom made from scratch.

My suggestion is that you reinstall Canvas and work from that. What do you think @reliq?

Those are warnings @ruchern. The migrations shouldn;t interfere with each other since Canvas' migrations were made to create tables prefixed with canvas_.

Even though composer reads two classes in each instance with the same name and will give the first one if called upon for the class in question. Artisan should be able to run both migrations in each case.


Have you tried to run the migrations after getting these warnings?

If not, please make a backup of your existing database try running the migrations and let us know the result.

@reliq If I do run the migrations, will the Easel takes precedence over my custom made ones?

@ruchern they should not. Nevertheless, remember to backup your existing database in the case of any adverse effects.

Actually @ruchern, you may run into quite a few more issues depending on your setup. The next few patches will contain some goodies to make the process easier.

Documentation is also underway here. Once these patches have been released you'll be clear to follow this guide.

@reliq Thank you so much for the updates and the help. I've been busy lately, so probably won't be playing with this for the time being!

Just confirming that the codes for Easel are in the vendor directories rather than in the project.

Will a php artisan publish --vendor do anything for now?

@ruchern If I'm understanding what you're asking about, you won't need to publish any vendor files for Canvas to work the way it should out of the box.

If you do however run the command vendor:publish, you'll end up publishing the following:

screen shot 2017-01-24 at 2 01 02 pm

@austintoddj Alright! Thank you. That is what I want to know.

@austintoddj @reliq php artisan vendor:publish -- is there a flag where I could publish only Canvas?

@ruchern this will publish only canvas assets:
php artisan vendor:publish --provider="Canvas\CanvasServiceProvider"
You can further limit the publishing by using the tags: config, public and views.
e.g.
php artisan vendor:publish --provider="Canvas\CanvasServiceProvider" --tag="views"

Further documentation on this issue can be found in the official documentation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hoRacy picture hoRacy  路  5Comments

hide-me picture hide-me  路  5Comments

austintoddj picture austintoddj  路  10Comments

prestontoor picture prestontoor  路  4Comments

floriangaerber picture floriangaerber  路  9Comments