{"id":19029960,"url":"https://github.com/padosoft/laravel-support","last_synced_at":"2025-10-25T09:08:04.975Z","repository":{"id":37587607,"uuid":"65997461","full_name":"padosoft/laravel-support","owner":"padosoft","description":"Laravel-support package is a collection of helpers and tools for Laravel projects.","archived":false,"fork":false,"pushed_at":"2025-04-07T06:25:06.000Z","size":302,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T01:47:26.569Z","etag":null,"topics":["helpers","laravel","laravel-package","laravel-support"],"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/padosoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2016-08-18T13:00:30.000Z","updated_at":"2025-04-07T06:25:09.000Z","dependencies_parsed_at":"2025-04-20T08:00:35.418Z","dependency_job_id":null,"html_url":"https://github.com/padosoft/laravel-support","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padosoft%2Flaravel-support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padosoft%2Flaravel-support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padosoft%2Flaravel-support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padosoft%2Flaravel-support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/padosoft","download_url":"https://codeload.github.com/padosoft/laravel-support/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250468272,"owners_count":21435451,"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":["helpers","laravel","laravel-package","laravel-support"],"created_at":"2024-11-08T21:15:55.292Z","updated_at":"2025-10-25T09:08:04.911Z","avatar_url":"https://github.com/padosoft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel-support\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/padosoft/laravel-support.svg?style=flat-square)](https://packagist.org/packages/padosoft/laravel-support)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Build Status](https://img.shields.io/travis/padosoft/laravel-support/master.svg?style=flat-square)](https://travis-ci.org/padosoft/laravel-support)\n[![Quality Score](https://img.shields.io/scrutinizer/g/padosoft/laravel-support.svg?style=flat-square)](https://scrutinizer-ci.com/g/padosoft/laravel-support)\n[![Total Downloads](https://img.shields.io/packagist/dt/padosoft/laravel-support.svg?style=flat-square)](https://packagist.org/packages/padosoft/laravel-support)\n\nLaravel-support package is a collection of helpers and tools for Laravel projects.\n\n##Requires\n  \n- php: \u003e=7.0.0\n- illuminate/database: ^5.0\n- illuminate/support: ^5.0\n- illuminate/auth: ^5.0\n- illuminate/contracts: ^5.0\n  \n## Installation\n\nYou can install the package via composer:\n``` bash\n$ composer require padosoft/laravel-support\n```\n  \n## List of functions\n\n- validate\n- locale\n- userIsLogged\n- query_interpolate\n- queries\n- query_table\n  \n## Usage\n\nHere is some support method:\n\nUsing helper for laravel validator:\n``` php\necho validate('192.168.0.1', 'ip'); //true\necho validate('dfdsfdsfs', 'ip'); //false\necho validate('20150230', 'date'); //false\necho validate('20150227', 'date'); //true\n```\n\nUsing locale() helper:\n``` php\necho locale();  //'en'\nthis-\u003eapp-\u003esetLocale('it');\necho locale(); 'it'\n```\n\nUsing query_interpolate() helper:\n``` php\n$query = 'update \"users\" set \"remember_token\" = ? where \"id\" = ?';\n$bindings = [\n    0 =\u003e \"dfsf234wdfsafsdfsdf\",\n    1 =\u003e \"1\"\n];\n$result = query_interpolate($query, $bindings);\necho $result; //update \"users\" set \"remember_token\" = 'dfsf234wdfsafsdfsdf' where \"id\" = 1\n```\n\nUsing queries() helper:\n``` php\n//You need enable query log by calling:\n\\DB::enableQueryLog();\n\n//If you have more than one DB connection you must specify it and Enables query log for my_connection\n\\DB::connection('my_connection')-\u003eenableQueryLog();\n \n//query the db\nUser::first();\nUser::first();\nUser::first();\n\n$queries = queries();\ndd($result);\n```\n\nThe output is:\n``` php\n[\n  \"query\" =\u003e \"select * from `negozi` where `id` = ?\",\n  \"bindings\" =\u003e [343242342,],\n  \"time\" =\u003e 1.77,\n  \"look\" =\u003e \"select * from `negozi` where `id` = 343242342\",\n]\n```\n\n``` php\n//If you want to print interpolated queries and relative time\nforeach ($queries as $query) {\n    echo 'e($query['look']) . \"\\t\" . e($query['time']) . PHP_EOL;\n}\n\n//For performance and memory reasons, after get queries info, you can disable query log by excecute\n\\DB::disableQueryLog();\n//or in case of more db connections:\n\\DB::connection('my_connection')-\u003edisableQueryLog();\n```\n\nUsing query_table() helper:\n``` php\n\\DB::enableQueryLog();\nUser::first();\nUser::first();\nUser::first();\necho query_table();//print html table with queries\n\\DB::disableQueryLog();\n```\n\nUsing current_user() helper:\n``` php\necho current_user(); //false\n$user = User::first();\nAuth::login($user);\nvar_dump(current_user()); //sump current logged user\necho current_user('id'); //1\necho current_user('email'); //test@user.com\n```\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email instead of using the issue tracker.\n\n## Credits\n- [Lorenzo Padovani](https://github.com/lopadova)\n- [All Contributors](../../contributors)\n\n## About Padosoft\nPadosoft (https://www.padosoft.com) is a software house based in Florence, Italy. Specialized in E-commerce and web sites.\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%2Fpadosoft%2Flaravel-support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpadosoft%2Flaravel-support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpadosoft%2Flaravel-support/lists"}