From c641a51ab3a2ea91ef33ee9303a2518e0bec2563 Mon Sep 17 00:00:00 2001 From: myckhel Date: Mon, 8 Mar 2021 19:27:31 +0100 Subject: [PATCH] init --- .styleci.yml | 1 + changelog.md | 8 +++ composer.json | 42 ++++++++++++++++ config/chatsystem.php | 5 ++ contributing.md | 27 ++++++++++ license.md | 5 ++ phpunit.xml | 22 +++++++++ readme.md | 57 +++++++++++++++++++++ src/ChatSystem.php | 10 ++++ src/ChatSystemServiceProvider.php | 82 +++++++++++++++++++++++++++++++ src/Facades/ChatSystem.php | 18 +++++++ 11 files changed, 277 insertions(+) create mode 100644 .styleci.yml create mode 100644 changelog.md create mode 100644 composer.json create mode 100644 config/chatsystem.php create mode 100644 contributing.md create mode 100644 license.md create mode 100644 phpunit.xml create mode 100644 readme.md create mode 100644 src/ChatSystem.php create mode 100644 src/ChatSystemServiceProvider.php create mode 100644 src/Facades/ChatSystem.php diff --git a/.styleci.yml b/.styleci.yml new file mode 100644 index 0000000..c3bb259 --- /dev/null +++ b/.styleci.yml @@ -0,0 +1 @@ +preset: laravel \ No newline at end of file diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..d35e6d4 --- /dev/null +++ b/changelog.md @@ -0,0 +1,8 @@ +# Changelog + +All notable changes to `ChatSystem` will be documented in this file. + +## Version 1.0 + +### Added +- Everything diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..fbbf4e3 --- /dev/null +++ b/composer.json @@ -0,0 +1,42 @@ +{ + "name": "myckhel/laravel-chat-system", + "description": "laravel chat system", + "license": "license", + "authors": [ + { + "name": "myckhel", + "email": "myckhel1@hotmail.com", + "homepage": "myckhel.com" + } + ], + "homepage": "https://github.com/myckhel/laravel-chat-system", + "keywords": ["Laravel", "ChatSystem"], + "require": { + "php": "^7.4|^8.0", + "illuminate/support": "~7|~8" + }, + "require-dev": { + "phpunit/phpunit": "~9.0", + "orchestra/testbench": "~5|~6" + }, + "autoload": { + "psr-4": { + "Myckhel\\ChatSystem\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Myckhel\\ChatSystem\\Tests\\": "tests" + } + }, + "extra": { + "laravel": { + "providers": [ + "Myckhel\\ChatSystem\\ChatSystemServiceProvider" + ], + "aliases": { + "ChatSystem": "Myckhel\\ChatSystem\\Facades\\ChatSystem" + } + } + } +} diff --git a/config/chatsystem.php b/config/chatsystem.php new file mode 100644 index 0000000..035fcd5 --- /dev/null +++ b/config/chatsystem.php @@ -0,0 +1,5 @@ + + +...Add your license text here... \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..ce34605 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,22 @@ + + + + + ./tests/ + + + + + src/ + + + diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..329448a --- /dev/null +++ b/readme.md @@ -0,0 +1,57 @@ +# ChatSystem + +[![Latest Version on Packagist][ico-version]][link-packagist] +[![Total Downloads][ico-downloads]][link-downloads] +[![Build Status][ico-travis]][link-travis] +[![StyleCI][ico-styleci]][link-styleci] + +This is where your description should go. Take a look at [contributing.md](contributing.md) to see a to do list. + +## Installation + +Via Composer + +``` bash +$ composer require myckhel/laravel-chat-system +``` + +## Usage + +## Change log + +Please see the [changelog](changelog.md) for more information on what has changed recently. + +## Testing + +``` bash +$ composer test +``` + +## Contributing + +Please see [contributing.md](contributing.md) for details and a todolist. + +## Security + +If you discover any security related issues, please email author email instead of using the issue tracker. + +## Credits + +- [author name][link-author] +- [All Contributors][link-contributors] + +## License + +license. Please see the [license file](license.md) for more information. + +[ico-version]: https://img.shields.io/packagist/v/myckhel/laravel-chat-system.svg?style=flat-square +[ico-downloads]: https://img.shields.io/packagist/dt/myckhel/laravel-chat-system.svg?style=flat-square +[ico-travis]: https://img.shields.io/travis/myckhel/laravel-chat-system/master.svg?style=flat-square +[ico-styleci]: https://styleci.io/repos/12345678/shield + +[link-packagist]: https://packagist.org/packages/myckhel/laravel-chat-system +[link-downloads]: https://packagist.org/packages/myckhel/laravel-chat-system +[link-travis]: https://travis-ci.org/myckhel/laravel-chat-system +[link-styleci]: https://styleci.io/repos/12345678 +[link-author]: https://github.com/myckhel +[link-contributors]: ../../contributors diff --git a/src/ChatSystem.php b/src/ChatSystem.php new file mode 100644 index 0000000..0d353b7 --- /dev/null +++ b/src/ChatSystem.php @@ -0,0 +1,10 @@ +loadTranslationsFrom(__DIR__.'/../resources/lang', 'myckhel'); + // $this->loadViewsFrom(__DIR__.'/../resources/views', 'myckhel'); + // $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); + // $this->loadRoutesFrom(__DIR__.'/routes.php'); + + // Publishing is only necessary when using the CLI. + if ($this->app->runningInConsole()) { + $this->bootForConsole(); + } + } + + /** + * Register any package services. + * + * @return void + */ + public function register(): void + { + $this->mergeConfigFrom(__DIR__.'/../config/chatsystem.php', 'chatsystem'); + + // Register the service the package provides. + $this->app->singleton('chat-system', function ($app) { + return new ChatSystem; + }); + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return ['chatsystem']; + } + + /** + * Console-specific booting. + * + * @return void + */ + protected function bootForConsole(): void + { + // Publishing the configuration file. + $this->publishes([ + __DIR__.'/../config/chatsystem.php' => config_path('chatsystem.php'), + ], 'chatsystem.config'); + + // Publishing the views. + /*$this->publishes([ + __DIR__.'/../resources/views' => base_path('resources/views/vendor/myckhel'), + ], 'chatsystem.views');*/ + + // Publishing assets. + /*$this->publishes([ + __DIR__.'/../resources/assets' => public_path('vendor/myckhel'), + ], 'chatsystem.views');*/ + + // Publishing the translation files. + /*$this->publishes([ + __DIR__.'/../resources/lang' => resource_path('lang/vendor/myckhel'), + ], 'chatsystem.views');*/ + + // Registering package commands. + // $this->commands([]); + } +} diff --git a/src/Facades/ChatSystem.php b/src/Facades/ChatSystem.php new file mode 100644 index 0000000..a04c425 --- /dev/null +++ b/src/Facades/ChatSystem.php @@ -0,0 +1,18 @@ +