{"id":15293841,"url":"https://github.com/thinhbuzz/laravel-theme","last_synced_at":"2025-07-03T03:04:40.389Z","repository":{"id":36057652,"uuid":"40356232","full_name":"thinhbuzz/laravel-theme","owner":"thinhbuzz","description":"Theme Management for Laravel 5.*","archived":false,"fork":false,"pushed_at":"2016-01-04T06:54:28.000Z","size":23,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-02T06:55:45.429Z","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/thinhbuzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-07T10:59:16.000Z","updated_at":"2021-02-11T20:05:47.000Z","dependencies_parsed_at":"2022-09-04T19:50:25.388Z","dependency_job_id":null,"html_url":"https://github.com/thinhbuzz/laravel-theme","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/thinhbuzz/laravel-theme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinhbuzz%2Flaravel-theme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinhbuzz%2Flaravel-theme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinhbuzz%2Flaravel-theme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinhbuzz%2Flaravel-theme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thinhbuzz","download_url":"https://codeload.github.com/thinhbuzz/laravel-theme/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinhbuzz%2Flaravel-theme/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263250596,"owners_count":23437288,"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":"2024-09-30T16:53:27.009Z","updated_at":"2025-07-03T03:04:40.360Z","avatar_url":"https://github.com/thinhbuzz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Theme Management for Laravel 5.*\n\n\u003e Detect device use package  [serbanghita/Mobile-Detect](https://github.com/serbanghita/Mobile-Detect).\n\u003e If you want to be simple, use a version 1.\n\u003e Note: v2.* switch language to vietnamese\n\n## Contents\n\n1. \u003ca href=\"#introduction\"\u003eIntroduction\u003c/a\u003e\n2. \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\n3. \u003ca href=\"#configuration\"\u003eConfiguration\u003c/a\u003e\n4. \u003ca href=\"#structure\"\u003eStructure\u003c/a\u003e\n5. \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\n\n## Introduction\nThis is package support the management view files and assets under separate folders. Compatible with Laravel 5.*\n\n## Installation\nThe first run command:\n\n```\ncomposer require buzz/laravel-theme 2.*\n```\n\nand then open `config/app.php` add `LaravelThemeServiceProvider` to array `providers`\n\n```\n'providers' =\u003e [\n    //.....\n    'Illuminate\\Validation\\ValidationServiceProvider',\n    'Illuminate\\View\\ViewServiceProvider,\n    //.....\n    'Buzz\\LaravelTheme\\LaravelThemeServiceProvider',\n],\n```\n\nAdd `Theme` alias (when set `auto_alias =\u003e false` in theme config):\n\n```\n'aliases' =\u003e [\n    //.....\n    'Validator' =\u003e 'Illuminate\\Support\\Facades\\Validator',\n    'View'      =\u003e 'Illuminate\\Support\\Facades\\View',\n    //.....\n    'Theme' =\u003e  'Buzz\\LaravelTheme\\ThemeFacade',\n],\n```\n\n## Configuration\n\nPublish config file `config/theme.php` with command:\n\n~~~\nphp artisan vendor:publish --provider=\"Buzz\\LaravelTheme\\LaravelThemeServiceProvider\"\n~~~\n\n## Usage\n\n### Structure\n##### Assets\n\n```\n├── public/\n    └── themes/\n        ├── theme_name/\n        |   ├── js/\n        |   ├── css/\n        |\n        └── another_theme_name/\n\n```\n\n##### Views\n\n```\n├── resources/\n    └── themes/\n        ├── theme_name/\n        |   ├── index.blade.php\n        |   ├── footer.blade.php\n        |\n        └── another_theme_name/\n\n```\n\n### Render view\n\npackage does not change the way you render view, you still use the `View::make` or `view()` as default of laravel, read more on [views document](http://laravel.com/docs/5.1/views). If the render view and the view does not exist in the `resources/themes/theme-name`, it will render view in `resources/views`.\n\n### Theme assets\n\nUse ``themeAsset()`` instead of ``asset()`` when link to assets in theme, example:\n\n```php\n\u003clink rel=\"stylesheet\" href=\"{!! themeAsset('css/bootstrap.css') !!}\"\u003e\n//render \u003clink rel=\"stylesheet\" href=\"http://domain/themes/theme-name/css/bootstrap.css\"\u003e\n```\n\n### Change current theme\n\nYou can change the theme in the following ways:\n\n```php\napp('theme')-\u003eset($themeName)\n```\n\nOr use function helper\n\n```php\nsetTheme($themeName);//function helper\n```\n\nor use Facade\n\n```php\nTheme::set($themeName);//use facade\n```\n\n### Support methods\n\n```php\nTheme::client();//return object of MobileDetect\nTheme::pathTheme($name = null);//return path to current theme or name input\nTheme::currentTheme();//return name of current theme\nTheme::reset();//reset default theme\nTheme::set();//set theme\nTheme::allTheme($except = [], $config = true);//get list theme in folder themes\nthemeAsset($name = false);//link to asset current theme or by theme name\nsetTheme($name);// change theme by theme name\n```\n\n### Support other config provider\nBy default package use provider ``config`` of laravel, you can change to provider you want by edit config ``'config_provider' =\u003e 'provider_name'``\n\n\u003e P/s: excuse me my English.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinhbuzz%2Flaravel-theme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinhbuzz%2Flaravel-theme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinhbuzz%2Flaravel-theme/lists"}