{"id":19706718,"url":"https://github.com/unisharp/laravel-widgetify","last_synced_at":"2025-07-01T11:05:18.091Z","repository":{"id":57075576,"uuid":"45236139","full_name":"UniSharp/laravel-widgetify","owner":"UniSharp","description":null,"archived":false,"fork":false,"pushed_at":"2015-11-10T03:18:00.000Z","size":128,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-01T11:04:51.489Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UniSharp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-30T07:39:54.000Z","updated_at":"2016-06-28T03:33:55.000Z","dependencies_parsed_at":"2022-08-24T14:40:31.256Z","dependency_job_id":null,"html_url":"https://github.com/UniSharp/laravel-widgetify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/UniSharp/laravel-widgetify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UniSharp%2Flaravel-widgetify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UniSharp%2Flaravel-widgetify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UniSharp%2Flaravel-widgetify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UniSharp%2Flaravel-widgetify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UniSharp","download_url":"https://codeload.github.com/UniSharp/laravel-widgetify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UniSharp%2Flaravel-widgetify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262950293,"owners_count":23389638,"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-11-11T21:36:41.008Z","updated_at":"2025-07-01T11:05:17.823Z","avatar_url":"https://github.com/UniSharp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Widget generator for Laravel\n\n * Help you get partial views as widgets\n\n## Installation\n\n1. install package\n\n    ```php\n        composer require unisharp/laravel-widgetify\n    ```\n\n1. edit config/app.php\n\n    service provider :\n\n    ```php\n        Unisharp\\Widget\\WidgetServiceProvider::class,\n    ```\n\n    class aliases :\n\n    ```php\n        'Widget' =\u003e Unisharp\\Widget\\WidgetFacade::class,\n    ```\n\n1. publish widget template class\n\n    ```php\n        php artisan vendor:publish --tag=widget_example\n    ```\n\n## Usage\n\n```php\n    Widget::set('side', 'widget-class-name', $args = []]);\n    // set widgets with position\n\n    Widget::get('side');\n    // get all widgets of a position\n```\n\n## Example\n\n1. in `App\\Widgets\\Block.php` :\n\n    ```php\n        class Block implements WidgetInterface\n        {\n            public $view = 'home.widgets.side_html';\n\n            public function getData($args)\n            {\n                return ['html' =\u003e \\App\\Utility::getPageByAlias($args['alias'])];\n            }\n        }\n    ```\n\n1. in `home.widgets.side_html.blade.php` :\n\n    ```html\n        @if(!empty($html-\u003econtent))\n            \u003csection class=\"facebook-plugin\"\u003e\n                {!! $html-\u003econtent !!}\n            \u003c/section\u003e\n        @endif\n    ```\n\n1. set widgets in in controller :\n\n    ```php\n        \\Widget::set('side', 'block', ['alias' =\u003e 'side_top_html']);\n        \\Widget::set('side', 'facebook');\n        \\Widget::set('side', 'block', ['alias' =\u003e 'side_mid_html']);\n        \\Widget::set('side', 'subscription');\n        \\Widget::set('side', 'block', ['alias' =\u003e 'side_buttom_html']);\n    ```\n\n1. display widgets in view :\n\n    ```html\n        {!! \\Widget::get('side') !!}\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funisharp%2Flaravel-widgetify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funisharp%2Flaravel-widgetify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funisharp%2Flaravel-widgetify/lists"}