Skip to content

Commit 7140d74

Browse files
first commit
0 parents  commit 7140d74

34 files changed

+1165
-0
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at https://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.gitattributes

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
* text=auto
2+
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
/.gitattributes export-ignore
10+
/.gitignore export-ignore
11+
/.github export-ignore
12+
/.editorconfig export-ignore
13+
/art export-ignore
14+
/phpunit.xml.dist export-ignore
15+
/pint.json export-ignore
16+
/tests export-ignore

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.idea
2+
/vendor
3+
/composer.lock

CHANGELOG.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Changelog
2+
3+
All notable changes to `botble/git-commit-checker` will be documented in this file.
4+
5+
## 2.1.2 - 2023-01-11
6+
7+
- Bump version `laravel/pint`
8+
9+
## 2.1.1 - 2023-01-06
10+
11+
- Fix various bugs
12+
13+
## 2.1.0 - 2023-01-06
14+
15+
- Fix output render on Windows platform (https://github.com/botble/git-commit-checker/pull/10)
16+
17+
## 2.0.1 - 2023-01-05
18+
19+
- Add warning message "Run command to see coding standard detail issues"
20+
- Update version icon from README.md
21+
- Remove verbose when run `pint --test`
22+
23+
## 2.0.0 - 2023-01-05
24+
25+
- Drop support PHP 7.x, Laravel <= 8.x
26+
- Replace PHP Code Sniffer, PHPLint to Laravel Pint
27+
- Rename command `git:install-hooks` to `git-commit-checker:install`
28+
- Rename command `git:pre-commit-hook` to `git-commit-checker:pre-commit-hook`
29+
- Remove command `git:create-phpcs`
30+
- Remove TravisCI, StyleCI, Scrutinizer
31+
- Remove unnecessary files
32+
33+
## 1.0.0 - 2019-08-26
34+
35+
- First release.

CONTRIBUTING.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
Please read and understand the contribution guide before creating an issue or pull request.
6+
7+
## Etiquette
8+
9+
This project is open source, and as such, the maintainers give their free time to build and maintain the source code
10+
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
11+
extremely unfair for them to suffer abuse or anger for their hard work.
12+
13+
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
14+
world that developers are civilized and selfless people.
15+
16+
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
17+
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
18+
19+
## Viability
20+
21+
When requesting or submitting new features, first consider whether it might be useful to others. Open
22+
source projects are used by many developers, who may have entirely different needs to your own. Think about
23+
whether or not your feature is likely to be used by other users of the project.
24+
25+
## Procedure
26+
27+
Before filing an issue:
28+
29+
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
30+
- Check to make sure your feature suggestion isn't already present within the project.
31+
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
32+
- Check the pull requests tab to ensure that the feature isn't already in progress.
33+
34+
Before submitting a pull request:
35+
36+
- Check the codebase to ensure that your feature doesn't already exist.
37+
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
38+
39+
## Requirements
40+
41+
If the project maintainer has any additional requirements, you will find them listed here.
42+
43+
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
44+
45+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
46+
47+
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
48+
49+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
50+
51+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
52+
53+
- **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.
54+
55+
**Happy coding**!

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2023 Botble Technologies <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# API for Botble CMS
2+
3+
<p align="center">
4+
<a href="https://packagist.org/packages/botble/api"><img src="https://img.shields.io/packagist/v/botble/api.svg?style=flat-square" alt="Latest V$
5+
<a href="/LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square" alt="Software License"></a>
6+
<a href="https://packagist.org/packages/botble/api"><img src="https://img.shields.io/packagist/dt/botble/api.svg?style=flat-square" alt="Total D$
7+
<a href="https://codeclimate.com/github/botble/api/maintainability"><img src="https://api.codeclimate.com/v1/badges/a6e4612307e3b3bf8252/maintainabil$
8+
</p>
9+
10+
## Installation
11+
12+
You can install the package via composer:
13+
14+
```shell
15+
composer require botble/api
16+
```
17+
18+
## Documentation
19+
20+
https://docs.botble.com/cms
21+
22+
Laravel Sanctum official docs: https://laravel.com/docs/sanctum
23+
24+
# Available API
25+
26+
- See the list in `http://your-domain.com/docs/index.html`
27+
28+
# Generate API docs
29+
```shell
30+
php artisan scribe:generate
31+
```
32+
33+
### Changelog
34+
35+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
36+
37+
## Contributing
38+
39+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
40+
41+
### Security
42+
43+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
44+
45+
## Credits
46+
47+
- [Botble Technologies](https://github.com/botble)
48+
- [All Contributors](../../contributors)
49+
50+
## License
51+
52+
The MIT License (MIT). Please see [License File](LICENSE) for more information.
53+

composer.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "botble/api",
3+
"description": "API package",
4+
"type": "package",
5+
"autoload": {
6+
"psr-4": {
7+
"Botble\\Api\\": "src"
8+
}
9+
},
10+
"require": {},
11+
"extra": {
12+
"laravel": {
13+
"providers": [
14+
"Botble\\Api\\Providers\\ApiServiceProvider"
15+
],
16+
"aliases": {
17+
"ApiHelper": "Botble\\Api\\Facades\\ApiHelper"
18+
}
19+
}
20+
}
21+
}

config/api.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
use Botble\ACL\Models\User;
4+
5+
return [
6+
'provider' => [
7+
'model' => User::class,
8+
'guard' => 'web',
9+
'password_broker' => 'users',
10+
'verify_email' => false,
11+
],
12+
];

config/permissions.php

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
return [
4+
[
5+
'name' => 'API settings',
6+
'flag' => 'api.settings',
7+
'parent_flag' => 'settings.options',
8+
],
9+
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class () extends Migration {
8+
public function up(): void
9+
{
10+
if (Schema::hasTable('personal_access_tokens') && ! Schema::hasColumn('personal_access_tokens', 'expires_at')) {
11+
Schema::table('personal_access_tokens', function (Blueprint $table) {
12+
$table->timestamp('expires_at')->nullable();
13+
});
14+
}
15+
}
16+
17+
public function down(): void
18+
{
19+
if (Schema::hasColumn('personal_access_tokens', 'expires_at')) {
20+
Schema::table('personal_access_tokens', function (Blueprint $table) {
21+
$table->dropColumn('expires_at');
22+
});
23+
}
24+
}
25+
};

phpunit.xml.dist

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Botble Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
</phpunit>

pint.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"preset": "psr12",
3+
"rules": {
4+
"array_syntax": {
5+
"syntax": "short"
6+
},
7+
"binary_operator_spaces": {
8+
"default": "single_space",
9+
"operators": {
10+
"=": null
11+
}
12+
},
13+
"blank_line_before_statement": {
14+
"statements": [
15+
"break",
16+
"continue",
17+
"declare",
18+
"return",
19+
"throw",
20+
"try"
21+
]
22+
},
23+
"concat_space": {
24+
"spacing": "one"
25+
},
26+
"function_typehint_space": true,
27+
"native_function_casing": true,
28+
"no_extra_blank_lines": true,
29+
"no_leading_namespace_whitespace": true,
30+
"no_spaces_around_offset": true,
31+
"no_unused_imports": true,
32+
"not_operator_with_successor_space": true,
33+
"object_operator_without_whitespace": true,
34+
"single_quote": true,
35+
"trailing_comma_in_multiline": true,
36+
"unary_operator_spaces": true,
37+
"whitespace_after_comma_in_array": true
38+
}
39+
}

resources/lang/en/api.php

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
return [
4+
'settings' => 'API Settings',
5+
'save_settings' => 'Save settings',
6+
'setting_title' => 'API settings',
7+
'setting_description' => 'Settings for API',
8+
'api_enabled' => 'API enabled?',
9+
];

resources/views/settings.blade.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@extends(BaseHelper::getAdminMasterLayoutTemplate())
2+
3+
@section('content')
4+
<div class="max-width-1200">
5+
{!! Form::open(['route' => ['api.settings.update']]) !!}
6+
<x-core-setting::section
7+
:title="trans('packages/api::api.setting_title')"
8+
:description="trans('packages/api::api.setting_description')"
9+
>
10+
<x-core-setting::on-off
11+
name="api_enabled"
12+
:label="trans('packages/api::api.api_enabled')"
13+
:value="ApiHelper::enabled()"
14+
/>
15+
</x-core-setting::section>
16+
17+
<div class="flexbox-annotated-section" style="border: none">
18+
<div class="flexbox-annotated-section-annotation">&nbsp;</div>
19+
<div class="flexbox-annotated-section-content">
20+
<button class="btn btn-info" type="submit">{{ trans('packages/api::api.save_settings') }}</button>
21+
</div>
22+
</div>
23+
{!! Form::close() !!}
24+
</div>
25+
@endsection

0 commit comments

Comments
 (0)