Adding Metronic in Existing Laravel App

There is Laravel project of Metronic but I want to know, Is there a plugin or a better way to add it in existing Laravel project. I can add all dependence one by one and move Model, Controllers and view in my project, but its a lengthy and error prone way. So I want to know if there is a better way or any documents which I can follow to add Metronic in my project.

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (10)

Hi Mamta,

At the moment, there is no other way than to move the files manually. At least, you have to move these folders.

  • app/Core/
  • config/demo1/ (depending on your choice of demo)
  • config/global/
  • app/Http/Controllers/PagesController.php
  • app/View/Components/
  • app/helpers.php
  • resources/assets
  • resources/views/
  • composer.json
  • webpack.mix.js (do not need to replace yours, but you can copy the content and move into your existing webpack config file)
  • Thanks

    Hi, Thank you for your reply. What about content from vendor folder? Do I need to copy the plugins vendor folder or I need to install these using composer ?

    the vendor is a generated folder. You can run "composer install" to setup.

    Okay, thank you

    Hi, I moved the files as suggested, but now I get

    In menu.php line 92:
    Call to undefined function theme()

    while running composer. Any suggestion to solve this?

    Hi Mamta,

    The helpers.php file needs to include in the package.json.

    "autoload": {
    "files": [
    "app/helpers.php"
    ],

    Thanks

    My bad, I forget to check the composer.json file.
    Thank you for your reply, now it start working.

    Hi, Now when I visit /register URL, I get local.ERROR: Undefined variable $theme at resources/views/auth/layout.blade.php(13)

    I also see RegisteredUserController create function, but there is no $theme object?

    Do I need to run any command after copy these files to my existing application. I run composer install, it gives Nothing to install, update or remove.

    Hi Mamta,

    Please add the code from this file

    app/Providers/AppServiceProvider.php

    $theme = theme();

    // Share theme adapter class
    View::share('theme', $theme);

    Thanks

    Text formatting options
    Submit
    Here's a how to add some HTML formatting to your comment:
    • <pre></pre> for JS codes block
    • <pre lang="html"></pre> for HTML code block
    • <pre lang="scss"></pre> for SCSS code block
    • <pre lang="php"></pre> for PHP code block
    • <code></code> for single line of code
    • <strong></strong> to make things bold
    • <em></em> to emphasize
    • <ul><li></li></ul>  to make list
    • <ol><li></li></ol>  to make ordered list
    • <h3></h3> to make headings
    • <a></a> for links
    • <img> to paste in an image
    • <blockquote></blockquote> to quote somebody
    • happy  :)
    • shocked  :|
    • sad  :(
    Text formatting options
    Submit
    Here's a how to add some HTML formatting to your comment:
    • <pre></pre> for JS codes block
    • <pre lang="html"></pre> for HTML code block
    • <pre lang="scss"></pre> for SCSS code block
    • <pre lang="php"></pre> for PHP code block
    • <code></code> for single line of code
    • <strong></strong> to make things bold
    • <em></em> to emphasize
    • <ul><li></li></ul>  to make list
    • <ol><li></li></ol>  to make ordered list
    • <h3></h3> to make headings
    • <a></a> for links
    • <img> to paste in an image
    • <blockquote></blockquote> to quote somebody
    • happy  :)
    • shocked  :|
    • sad  :(