{"id":27437423,"url":"https://github.com/keepsuit/laravel-liquid","last_synced_at":"2025-04-14T20:29:09.289Z","repository":{"id":191767649,"uuid":"685535704","full_name":"keepsuit/laravel-liquid","owner":"keepsuit","description":"Liquid template engine for Laravel","archived":false,"fork":false,"pushed_at":"2025-03-15T13:44:08.000Z","size":125,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T14:31:40.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keepsuit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-31T12:59:43.000Z","updated_at":"2025-03-15T13:44:11.000Z","dependencies_parsed_at":"2024-02-26T16:53:49.193Z","dependency_job_id":"0e0cdf1d-9553-44b2-b7c7-309d9944939f","html_url":"https://github.com/keepsuit/laravel-liquid","commit_stats":null,"previous_names":["keepsuit/laravel-liquid"],"tags_count":11,"template":false,"template_full_name":"spatie/package-skeleton-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepsuit%2Flaravel-liquid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepsuit%2Flaravel-liquid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepsuit%2Flaravel-liquid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepsuit%2Flaravel-liquid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keepsuit","download_url":"https://codeload.github.com/keepsuit/laravel-liquid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248954874,"owners_count":21188876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-14T20:29:08.653Z","updated_at":"2025-04-14T20:29:09.263Z","avatar_url":"https://github.com/keepsuit.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Liquid template engine for Laravel\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/keepsuit/laravel-liquid.svg?style=flat-square)](https://packagist.org/packages/keepsuit/laravel-liquid)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/keepsuit/laravel-liquid/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/keepsuit/laravel-liquid/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/keepsuit/laravel-liquid/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/keepsuit/laravel-liquid/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/keepsuit/laravel-liquid.svg?style=flat-square)](https://packagist.org/packages/keepsuit/laravel-liquid)\n\nThis is a Laravel view integration of the Shopify Liquid template engine.\nIt uses [keepsuit/liquid](https://github.com/keepsuit/php-liquid) PHP porting under the hood to parse liquid templates.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require keepsuit/laravel-liquid\n```\n\n## Usage\n\n1. Create a liquid template file in `resources/views` folder (for example `home.liquid`).\n2. Render the template as usual with Laravel view engine.\n\n```php\nclass HomeController extends Controller\n{\n    public function index()\n    {\n        return view('home');\n    }\n}\n```\n\n## Tags\n\nThis package provides some custom tags in addition to the standard Liquid tags.\n\n### Auth\n\nCheck if the user is authenticated. \nSame as laravel [`@auth`](https://laravel.com/docs/blade#authentication-directives) directive.\n\n```liquid\n{% auth %}\nuser is authenticated\n{% endauth %}\n\n{% guest %}\nuser is not authenticated\n{% endguest %}\n```\n\nor with custom guard\n\n```liquid\n{% auth('admin') %}\nadmin is authenticated\n{% endauth %}\n\n{% guest 'admin' %}\nadmin is not authenticated\n{% endguest %}\n```\n\n### Env\n\nCheck if the application environment is the specified one. \nSame as laravel [`@env`](https://laravel.com/docs/blade#environment-directives) directive.\n\n```liquid\n{% env 'production' %}\napplication is in production environment\n{% endenv %}\n```\n\n### Session\n\nCheck if the session has a specific key.\nSame as laravel [`@session`](https://laravel.com/docs/blade#session-directives) directive.\nThe value of the session key can be accessed with the `value` variable.\n\n```liquid\n{% session 'status' %}\n\u003cdiv class=\"p-4 bg-green-100\"\u003e\n  {{ value }}\n\u003c/div\u003e\n{% endsession %}\n```\n\n### Error\n\nCheck if a validation error exists for the given field.\nSame as laravel [`@error`](https://laravel.com/docs/blade#validation-errors) directive.\nThe error message can be accessed with the `message` variable.\n\n```liquid\n{% error 'email' %}\n\u003cdiv class=\"text-red-500 text-sm\"\u003e\n  {{ message }}\n\u003c/div\u003e\n{% enderror %}\n```\n\n### Csrf field\n\nGenerate a hidden CSRF token form field.\nSame as laravel [`@csrf`](https://laravel.com/docs/blade#csrf-field) directive.\n\n```liquid\n\u003cform method=\"POST\" action=\"/foo\"\u003e\n  {% csrf %}\n  ...\n\u003c/form\u003e\n```\n\n### Vite\n\nAdds your vite assets to the template.\nSame as laravel [`@vite`](https://laravel.com/docs/vite#loading-your-scripts-and-styles) directive.\n\n```liquid\n{% vite 'resources/css/app.css', 'resources/js/app.js' %}\n\n{% comment %}With custom build directory{% endcomment %}\n{% vite \"resources/js/app.js\", directory: \"custom\" %}\n```\n\n## Filters\n\nThis package provides some custom filters in addition to the standard Liquid filters.\n\n### Debug\n\nDebug variable content with `dump` and `dd` filters.\n\n\n```liquid\n{{ variable | dump }}\n\n{{ variable | dd }}\n```\n\n### Localization\n\nTranslate a string with `trans` (or `t` alias) and `trans_choice` filters using the Laravel localization system.\n\n```liquid\n{{ 'messages.welcome' | trans }}\n\n{{ 'messages.items_count' | trans_choice: 3 }}\n```\n\n### Url\n\nGenerate urls using the laravel url helpers.\n\n```liquid\n{{ 'app.js' | asset }}\n{{ 'app.js' | secure_asset }}\n\n{{ '/home' | url }}\n{{ '/home' | secure_url }}\n\n{{ 'home' | route }}\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Credits\n\n- [Fabio Capucci](https://github.com/keepsuit)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeepsuit%2Flaravel-liquid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeepsuit%2Flaravel-liquid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeepsuit%2Flaravel-liquid/lists"}