New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

ytake/laravel-smarty

Smarty template engine for Laravel and Lumen
419,138 85

Larablocks Analysis

ytake/laravel-smarty works with Laravel 10 and 11 (latest release 8.0.0, Mar 4, 2024), all past end of life (the last on Mar 12, 2026): no more fixes, even for security.

Laravel 4 to 9 in earlier releases.

Recommendation checks

Use with care

Use with care: meets 0 of 4 checks.

  • Supports only Laravel 10 and 11, past end of life since Mar 12, 2026
  • No release in the last 12 months (last: Mar 4, 2024)
  • 1,594 downloads a month (needs 10,000)
  • 85 GitHub stars (needs 100)

State

Quiet
  • Last stable release: Mar 4, 2024.
  • No releases in the last 12 months.
  • First released: Sep 19, 2014.
  • Monthly downloads: 1,594, down 15% from six months ago.
  • 8 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require ytake/laravel-smarty
Latest Version:8.0.0
PHP:^8.1
Laravel:10 · 11
Older releases:4 – 9
License:MIT
Last Updated:Apr 10, 2025
Links: GitHub  ·  Packagist
Maintainer: ytake

Laravel.Smarty

Smarty Template Engine for Laravel
(Support for Laravel5.x - Laravel8.x and Lumen)

Build Status Coverage Status Scrutinizer Code Quality

License Latest Version Total Downloads

Installation For Laravel

Require this package with Composer

$ composer require ytake/laravel-smarty

or composer.json

"require": {
  "ytake/laravel-smarty": "^6.0"
},

Supported Auto-Discovery(^Laravel5.5)

add Laravel.Smarty Service Providers

your config/app.php

'providers' => [
    // add smarty extension
    Ytake\LaravelSmarty\SmartyServiceProvider::class, 
    // add artisan commands  
    Ytake\LaravelSmarty\SmartyConsoleServiceProvider::class, 
]

Installation For Lumen

Require this package with Composer

$ composer require ytake/laravel-smarty

or composer.json

"require": {
  "ytake/laravel-smarty": "~2.0"
},

register Laravel.Smarty Service Providers

your bootstrap/app.php

$app->configure('ytake-laravel-smarty');
$app->register(Ytake\LaravelSmarty\SmartyServiceProvider::class);
$app->register(Ytake\LaravelSmarty\SmartyConsoleServiceProvider::class);

Configuration

publish configuration file (for Laravel5)

$ php artisan vendor:publish

publish to config directory

Of Course, Blade Template can also be used to Render Engine.

configuration file (for Lumen)

Copy the vendor/ytake/laravel-smarty/src/config/ytake-laravel-smarty.php file to your local config directory

config for Production

edit config/ytake-laravel-smarty.php

    // enabled smarty template cache
    'caching' => true, // default false
    
    // disabled smarty template compile
    'force_compile' => false, // default true(for develop)

Or

add .env file

SMARTY_CACHE=true
SMARTY_COMPILE=false

edit config/ytake-laravel-smarty.php

    'caching' => env('SMARTY_CACHING', false),
   
    'force_compile' => env('SMARTY_FORCE_COMPILE', true),

and more..!

Basic

easily use all the methods of Smarty

// laravel5 view render
view("template.name");

// Laravel blade template render(use Facades)
\View::make('template', ['hello']);
// use Smarty method

\View::assign('word', 'hello');  
\View::clearAllAssign(); // smarty method

View Composer, and View Share

$this->app['view']->composer('index', function (View $view) {
    $view->with('message', 'enable smarty');
});
$this->app['view']->share('title', 'laravel-smarty');

Hello Laravel.Smarty

{$title}

{$message}

Artisan

smarty's cache clear, remove compile class from Artisan(cli)

Template cache clear

$ php artisan ytake:smarty-clear-cache
Options description
--file (-f) specify file
--time (-t) clear all of the files that are specified duration time
--cache_id (-cache) specified cache_id groups

Remove compile file

$ php artisan ytake:smarty-clear-compiled
Options description
--file (-f) specify file
--compile_id (-compile) specified compile_id

Template Compiler

$ php artisan ytake:smarty-optimize
Options description
--extension (-e) specified smarty file extension(default: .tpl)
--force compiles template files found in views directory

Template Caching

choose file, memcached, Redis
(default file cache driver)

// smarty cache driver "file", "memcached", "redis"
'cache_driver' => 'file',

// memcached servers
'memcached' => [
    [
        'host' => '127.0.0.1',
        'port' => 11211,
        'weight' => 100
    ],
],

// redis configure
'redis' => [
    [
        'host' => '127.0.0.1',
        'port' => 6379,
        'database' => 0,
    ],
],

example

registerFilter in ServiceProvider
registerFilter in Controller
layout.sample
layout.extends.sample

Alternatives to ytake/laravel-smarty

eftec/bladeone

The standalone version Blade Template Engine from Laravel in a single php file

12,330,588 832
jenssegers/blade

The standalone version of Laravel's Blade templating engine for use outside of L...

1,455,408 859
miko/laravel-latte

Latte template engine for Laravel

4,908 4
rcalicdan/blade

A standalone fork of jenssegers/blade, Laravel's Blade templating engine for use...

1,421 0
rubellum/slim-blade-view

Slim Framework 3 view helper built on the Blade component

23,436 18

Version History

Version Released PHP Laravel License
8.0.0 ^8.1 ^10.0|^11.0 MIT
7.0.1 ^8.1 ^10.0 MIT
7.0.0 ^8.1 ^10.0 MIT
6.0.0 ^8.0.2 ^9.0 MIT
5.1.0 ^7.3 | ^8.0 ^8.0 MIT