Download the PHP package bkwld/laravel-pug without Composer

On this page you can find all versions of the php package bkwld/laravel-pug. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-pug

Laravel Pug

Packagist GitHub Actions StyleCI codecov Code Climate License

A small package that adds support for compiling Pug (Jade) templates to Laravel via Pug.php (see complete documentation). Both vanilla php and Blade syntax is supported within the view.

This is the documentation for the ongoing version 2.0. Click here to load the documentation for 1.11

Installation

First you need composer if you haven't yet: https://getcomposer.org/download/

Now open a terminal at the root of your Laravel project. If it's a new project, create it with: composer create-project --prefer-dist laravel/laravel my-new-project (replace my-new-project with your own project name, see the documentation for further information)

Then run:

Usage

Will now try to load views/my-page.pug first, or views/my-page.blade.pug or fallback to the default blade engine loading views/my-page.blade.php.

As with Blade, you can pass variables to your view:

Any file with the extension .pug will be compiled as a pug template. Laravel Pug also registers the .pug.blade which also compile blade code once Pug code has been compiled; but we highly recommend you to use the clean and standard extension .pug that will be recognized by most systems. It compiles your Pug templates in the same way as Blade templates; the compiled template is put in your storage directory. Thus, you don't suffer compile times on every page load.

In other words, just put your Pug files in the regular views directory and name them like whatever.pug. You reference them in Laravel like normal such as view('home.whatever') for resources/views/home/whatever.pug.

The Pug view files can work side-by-side with regular PHP views.

Use Blade in Pug templates

This feature is designed for transition purpose, since every blade features are available in pug, you would not need both.

To use Blade templating within your Pug, just name the files with .blade.pug extensions.

Read more Be aware that this mode will first render your template with pug, then give the output to render to blade, it means your template must have a valid pug syntax and must render a valid blade template. This also means blade directives are only available through pug text output, see the example below: If you render this with the following values: `['one' => 1, 'two' => 2]`, you will get: PS: note that you would get the same output with the following pure pug code:

Use in Lumen

Register the service in bootstrap/app.php (Register Service Providers section is the dedicated place):

Then you can use it with view():

Configuration

All Pug.php options are passed through via a Laravel config array file you can edit /config/laravel-pug.php

If for any reason, the config file is missing, just run the following command: php artisan vendor:publish --provider="Bkwld\LaravelPug\ServiceProvider"

Extending Layouts / Include Sub-views

Default root directory for templates is resources/views, so from any template any deep in the directory, you can use absolute paths to get other pug files from the root: extends /layouts/main will extends the file resources/views/layouts/main.pug, include /partial/foo/bar, will include resources/views/partial/foo/bar.pug. You can use the basedir option to set the root to an other directory. Paths that does not start with a slash will be resolved relatively to the current template file.

History

Read the Github project releases for release notes.


All versions of laravel-pug with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ^8.0
illuminate/support Version >=6
illuminate/view Version >=6
phug/component Version ^1.1.3
pug-php/pug Version ^3.3.1
pug-php/pug-assets Version ^1.0.1
pug/installer Version ^1.0.0
composer-plugin-api Version ^1.0 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bkwld/laravel-pug contains the following files

Loading the files please wait ....