Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
myckhel committed Mar 8, 2021
0 parents commit c641a51
Show file tree
Hide file tree
Showing 11 changed files with 277 additions and 0 deletions.
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
preset: laravel
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

All notable changes to `ChatSystem` will be documented in this file.

## Version 1.0

### Added
- Everything
42 changes: 42 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "myckhel/laravel-chat-system",
"description": "laravel chat system",
"license": "license",
"authors": [
{
"name": "myckhel",
"email": "[email protected]",
"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"
}
}
}
}
5 changes: 5 additions & 0 deletions config/chatsystem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
//
];
27 changes: 27 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing

Contributions are welcome and will be fully credited.

Contributions are accepted via Pull Requests on [Github](https://github.com/myckhel/laravel-chat-system).

# Things you could do
If you want to contribute but do not know where to start, this list provides some starting points.
- Add license text
- Remove rewriteRules.php
- Set up TravisCI, StyleCI, ScrutinizerCI
- Write a comprehensive ReadMe

## Pull Requests

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `readme.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.


**Happy coding**!
5 changes: 5 additions & 0 deletions license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# The license

Copyright (c) author name <author email>

...Add your license text here...
22 changes: 22 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Package">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>src/</directory>
</whitelist>
</filter>
</phpunit>
57 changes: 57 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions src/ChatSystem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Myckhel\ChatSystem;

class ChatSystem
{
static function hello() {
return 'hello-world';
}
}
82 changes: 82 additions & 0 deletions src/ChatSystemServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php

namespace Myckhel\ChatSystem;

use Illuminate\Support\ServiceProvider;

class ChatSystemServiceProvider extends ServiceProvider
{
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot(): void
{
// $this->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([]);
}
}
18 changes: 18 additions & 0 deletions src/Facades/ChatSystem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Myckhel\ChatSystem\Facades;

use Illuminate\Support\Facades\Facade;

class ChatSystem extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor(): string
{
return 'chat-system';
}
}

0 comments on commit c641a51

Please sign in to comment.