Skip to content

nasrulhazim/template-into-laravel

Repository files navigation

Template Into Laravel

How to import templates into Laravel Application?

Here are some of the templates I want to demostrate, how to import templates into Laravel application.

More details written in my blog post Laravel: Import Templates into Laravel

I'm going to import Tabler template in this repo. You may want to choose other template as well.

Basically the steps is:

  1. Clone / Download the template into resources/assets/templates/template-name

  2. Install dependencies for templates by navigating to resources/assets/templates/template-name. For this particular step, it depends on template. There is template require you to install the dependencies like Adminator some template already compiled it for you like Tabler - so your work will be much simpler - skip to next step.

  3. Copy compiled templates asset to public directory, by specify in webpack.mix.js. But first, if you are first time setup the template, make sure to npm install or yarn install your application. Only then you can update webpack.mix.js like the following:

    mix.js('resources/assets/js/app.js', 'public/js')
    .sass('resources/assets/sass/app.scss', 'public/css')
    .copy('resources/assets/templates/tabler/dist/assets', 'public/tabler/assets');

Once you are done 3 steps above, run npm run prod. This will simply compile your resource assets, and copy it to public directory. That's it!

Now you are ready to use all the template's assets.

In this repository - I will use Tabler template and do the implementation on layouts/app.blade.php and auth/login.blade.php.

  1. Get the main layouts
  2. Apply the CSS use based on resources/assets/templates/tabler/dist or sample here.

The result:

login

About

How to import Templates into Laravel Project?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published