{"id":15025142,"url":"https://github.com/prinsfrank/indentingpersistentbladecompiler","last_synced_at":"2025-04-12T12:52:28.720Z","repository":{"id":35012320,"uuid":"194722780","full_name":"PrinsFrank/IndentingPersistentBladeCompiler","owner":"PrinsFrank","description":"Extension on the Laravel Blade compiler that persists indenting when using replaced content in blade templates.","archived":false,"fork":false,"pushed_at":"2022-02-23T21:06:17.000Z","size":104,"stargazers_count":17,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T07:36:33.410Z","etag":null,"topics":["blade","blade-compiler","blade-template-engine","compiler","laravel","laravel-framework","laravel-package","template-compiler"],"latest_commit_sha":null,"homepage":null,"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/PrinsFrank.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-01T18:19:22.000Z","updated_at":"2022-01-30T22:24:11.000Z","dependencies_parsed_at":"2022-08-08T03:16:28.314Z","dependency_job_id":null,"html_url":"https://github.com/PrinsFrank/IndentingPersistentBladeCompiler","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinsFrank%2FIndentingPersistentBladeCompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinsFrank%2FIndentingPersistentBladeCompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinsFrank%2FIndentingPersistentBladeCompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinsFrank%2FIndentingPersistentBladeCompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrinsFrank","download_url":"https://codeload.github.com/PrinsFrank/IndentingPersistentBladeCompiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571607,"owners_count":21126519,"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":["blade","blade-compiler","blade-template-engine","compiler","laravel","laravel-framework","laravel-package","template-compiler"],"created_at":"2024-09-24T20:01:34.170Z","updated_at":"2025-04-12T12:52:28.699Z","avatar_url":"https://github.com/PrinsFrank.png","language":"PHP","readme":"# Indenting persistent blade compiler\n\n[![Build Status](https://travis-ci.org/PrinsFrank/IndentingPersistentBladeCompiler.svg?branch=master)](https://travis-ci.org/PrinsFrank/IndentingPersistentBladeCompiler)\n\nHave you ever looked at the HTML Laravel generates and wondered about the mess? That's what I want to solve with this package. [As this is not going to be fixed in Laravel Framework itself](https://github.com/laravel/framework/pull/28768) I decided to make it into a package, and here it is!\n\n## The problem\nAn example with all replaced content types:\n```\n// app.blade.php\n@push('scripts')\n\u003cstack\u003e\u003c/stack\u003e\n\u003cstack\u003e\u003c/stack\u003e\n@endpush\n\u003chtml\u003e\n    \u003chead\u003e\n        @stack('scripts')\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003csidebar\u003e\n            @section('sidebar')\n            \u003csidebarcontent\u003e\u003c/sidebarcontent\u003e\n            @show\n        \u003c/sidebar\u003e\n        \u003ccontainer\u003e\n            @yield('content')\n        \u003c/container\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n```\n// main.blade.php\n@extends('example.app')\n\n@section('sidebar')\n@parent\n\u003csidebarsectioncontent\u003e\u003c/sidebarsectioncontent\u003e\n@endsection\n\n@section('content')\n\u003clevel-1\u003e\n    @include('example.include')\n    @includeif('example.include')\n    @includewhen(true, 'example.include')\n    @includefirst(['example.include', 'example.include'])\n    \u003clevel-2\u003e\n        \u003clevel-3\u003e\n            @each('example.include', [1,2], 'index')\n        \u003c/level-3\u003e\n    \u003c/level-2\u003e\n    @component('example.component')\n        @slot('title')\n            \u003ctitle\u003e\u003c/title\u003e\n            \u003ctitle\u003e\u003c/title\u003e\n        @endslot\n        \u003ccomponent\u003e\u003c/component\u003e\n        \u003ccomponent\u003e\u003c/component\u003e\n    @endcomponent\n\u003c/level-1\u003e\n@endsection\n```\n```\n// component.blade.php\n\u003cwrapper-component\u003e\n    \u003cwrapper-title\u003e\n        {{ $title }}\n    \u003c/wrapper-title\u003e\n    {{ $slot }}\n\u003c/wrapper-component\u003e\n```\n```\n// include.blade.php\n\u003cinclude\u003e\n\u003c/include\u003e\n```\nResults in the following HTML. What a mess, right?\n```\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003cstack\u003e\u003c/stack\u003e\n\u003cstack\u003e\u003c/stack\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003csidebar\u003e\n                        \u003csidebarcontent\u003e\u003c/sidebarcontent\u003e\n            \n\u003csidebarsectioncontent\u003e\u003c/sidebarsectioncontent\u003e\n        \u003c/sidebar\u003e\n        \u003ccontainer\u003e\n            \u003clevel-1\u003e\n    \u003cinclude\u003e\n\u003c/include\u003e    \u003cinclude\u003e\n\u003c/include\u003e    \u003cinclude\u003e\n\u003c/include\u003e    \u003cinclude\u003e\n\u003c/include\u003e    \u003clevel-2\u003e\n        \u003clevel-3\u003e\n            \u003cinclude\u003e\n\u003c/include\u003e\u003cinclude\u003e\n\u003c/include\u003e        \u003c/level-3\u003e\n    \u003c/level-2\u003e\n    \u003cwrapper-component\u003e\n    \u003cwrapper-title\u003e\n        \u003ctitle\u003e\u003c/title\u003e\n            \u003ctitle\u003e\u003c/title\u003e\n    \u003c/wrapper-title\u003e\n    \u003ccomponent\u003e\u003c/component\u003e\n        \u003ccomponent\u003e\u003c/component\u003e\n\u003c/wrapper-component\u003e\u003c/level-1\u003e\n        \u003c/container\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\nThis package fixes that and generates the following HTML:\n```\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003cstack\u003e\u003c/stack\u003e\n        \u003cstack\u003e\u003c/stack\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003csidebar\u003e\n            \u003csidebarcontent\u003e\u003c/sidebarcontent\u003e\n            \u003csidebarsectioncontent\u003e\u003c/sidebarsectioncontent\u003e\n        \u003c/sidebar\u003e\n        \u003ccontainer\u003e\n            \u003clevel-1\u003e\n                \u003cinclude\u003e\n                \u003c/include\u003e\n                \u003cinclude\u003e\n                \u003c/include\u003e\n                \u003cinclude\u003e\n                \u003c/include\u003e\n                \u003cinclude\u003e\n                \u003c/include\u003e\n                \u003clevel-2\u003e\n                    \u003clevel-3\u003e\n                        \u003cinclude\u003e\n                        \u003c/include\u003e\n                        \u003cinclude\u003e\n                        \u003c/include\u003e\n                    \u003c/level-3\u003e\n                \u003c/level-2\u003e\n                \u003cwrapper-component\u003e\n                    \u003cwrapper-title\u003e\n                        \u003ctitle\u003e\u003c/title\u003e\n                        \u003ctitle\u003e\u003c/title\u003e\n                    \u003c/wrapper-title\u003e\n                    \u003ccomponent\u003e\u003c/component\u003e\n                    \u003ccomponent\u003e\u003c/component\u003e\n                \u003c/wrapper-component\u003e\n            \u003c/level-1\u003e\n        \u003c/container\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Setting things up\n\nRun ```composer require prinsfrank/indenting-persistent-blade-compiler```\n\nRun ```php artisan view:clear``` to clear the already compiled views. Don't forget to do this when deploying to production as well, existing templates will break!","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprinsfrank%2Findentingpersistentbladecompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprinsfrank%2Findentingpersistentbladecompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprinsfrank%2Findentingpersistentbladecompiler/lists"}