Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mpociot/teamwork
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.0.1
Choose a base ref
...
head repository: mpociot/teamwork
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 1,453 additions and 4,461 deletions.
  1. +58 −0 .github/workflows/run-tests.yml
  2. +22 −0 .github/workflows/stale.yml
  3. +28 −0 .github/workflows/update-changelog.yml
  4. +2 −0 .gitignore
  5. +147 −0 .php_cs
  6. +1 −0 .styleci.yml
  7. +0 −16 .travis.yml
  8. +42 −1 CHANGELOG.md
  9. +70 −97 README.md
  10. +35 −14 composer.json
  11. +0 −3,365 composer.lock
  12. +0 −7 {src → }/config/config.php
  13. +83 −0 database/migrations/2016_05_18_000000_teamwork_setup_tables.php
  14. +0 −23 phpunit.xml
  15. +24 −0 phpunit.xml.dist
  16. +13 −12 src/{Mpociot/Teamwork → }/Commands/MakeTeamwork.php
  17. +16 −22 src/{Mpociot/Teamwork → }/Contracts/TeamworkUserInterface.php
  18. +1 −1 src/{Mpociot/Teamwork → }/Events/UserInvitedToTeam.php
  19. 0 src/{Mpociot/Teamwork → }/Events/UserJoinedTeam.php
  20. 0 src/{Mpociot/Teamwork → }/Events/UserLeftTeam.php
  21. +5 −4 src/{Mpociot/Teamwork → }/Exceptions/UserNotInTeamException.php
  22. +3 −1 src/{Mpociot/Teamwork → }/Facades/Teamwork.php
  23. +24 −0 src/Middleware/TeamOwner.php
  24. +0 −114 src/Mpociot/Teamwork/TeamworkServiceProvider.php
  25. +0 −44 src/Mpociot/Teamwork/Traits/TeamworkTeamInviteTrait.php
  26. +0 −67 src/Mpociot/Teamwork/Traits/UsedByTeams.php
  27. +0 −273 src/Mpociot/Teamwork/Traits/UserHasTeams.php
  28. +6 −5 src/{Mpociot/Teamwork → }/TeamInvite.php
  29. +38 −45 src/{Mpociot/Teamwork → }/Teamwork.php
  30. +90 −0 src/TeamworkServiceProvider.php
  31. +6 −5 src/{Mpociot/Teamwork → }/TeamworkTeam.php
  32. +38 −0 src/Traits/TeamworkTeamInviteTrait.php
  33. +14 −20 src/{Mpociot/Teamwork → }/Traits/TeamworkTeamTrait.php
  34. +65 −0 src/Traits/UsedByTeams.php
  35. +285 −0 src/Traits/UserHasTeams.php
  36. +0 −87 src/database/2016_05_18_000000_teamwork_setup_tables.php
  37. +0 −22 src/stubs/routes.stub
  38. +5 −5 {src → }/stubs/controllers/AuthController.stub
  39. +13 −6 {src → }/stubs/controllers/TeamController.stub
  40. +10 −9 {src → }/stubs/controllers/TeamMemberController.stub
  41. +2 −1 {src → }/stubs/listeners/JoinTeamListener.stub
  42. +22 −0 stubs/routes.stub
  43. 0 {src → }/stubs/views/create.blade.php
  44. 0 {src → }/stubs/views/edit.blade.php
  45. 0 {src → }/stubs/views/emails/invite.blade.php
  46. 0 {src → }/stubs/views/index.blade.php
  47. 0 {src → }/stubs/views/members/list.blade.php
  48. +14 −29 tests/{ → Feature}/TeamworkTeamInviteTraitTest.php
  49. +35 −32 tests/{ → Feature}/TeamworkTeamTraitTest.php
  50. +71 −68 tests/{ → Feature}/TeamworkTest.php
  51. +12 −16 tests/{ → Feature}/UsedByTeamsTraitTest.php
  52. +57 −28 tests/{ → Feature}/UserHasTeamsTraitTest.php
  53. +42 −0 tests/Feature/UserNotInTeamExceptionTest.php
  54. +4 −1 tests/{models → Support}/Task.php
  55. +7 −2 tests/{models → Support}/User.php
  56. +43 −0 tests/TestCase.php
  57. +0 −19 tests/UserNotInTeamExceptionTest.php
58 changes: 58 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: run-tests

on:
- push
- pull_request

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.2, 8.1, 8.0]
laravel: ['9.*', '10.*', '11.*']
dependency-version: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 10.*
php: 8.0
- laravel: 11.*
php: 8.1
- laravel: 11.*
php: 8.0

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
22 changes: 22 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Close inactive issues
on:
schedule:
- cron: "30 1 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v4
with:
days-before-issue-stale: 60
days-before-issue-close: 14
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 60 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Update Changelog"

on:
release:
types: [released]

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: master

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: master
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@
/vendor
composer.phar
phpunit.phar
composer.lock
.php_cs.cache

/conf
/.settings
147 changes: 147 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<?php

// Provided by Laravel Shift: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null],
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => ['return'],
],
'braces' => true,
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => ['method'],
],
'class_definition' => true,
'concat_space' => [
'spacing' => 'none',
],
'declare_equal_normalize' => true,
'elseif' => true,
'encoding' => true,
'full_opening_tag' => true,
'fully_qualified_strict_types' => true, // added by Shift
'function_declaration' => true,
'function_typehint_space' => true,
'heredoc_to_nowdoc' => true,
'include' => true,
'increment_style' => ['style' => 'post'],
'indentation_type' => true,
'linebreak_after_opening_tag' => true,
'line_ending' => true,
'lowercase_cast' => true,
'lowercase_constants' => true,
'lowercase_keywords' => true,
'lowercase_static_reference' => true, // added from Symfony
'magic_method_casing' => true, // added from Symfony
'magic_constant_casing' => true,
'method_argument_space' => true,
'native_function_casing' => true,
'no_alias_functions' => true,
'no_extra_blank_lines' => [
'tokens' => [
'extra',
'throw',
'use',
'use_trait',
],
],
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_closing_tag' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => [
'use' => 'echo',
],
'no_multiline_whitespace_around_double_arrow' => true,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'not_operator_with_successor_space' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'phpdoc_no_access' => true,
'phpdoc_no_package' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
'psr4' => true,
'self_accessor' => true,
'short_scalar_cast' => true,
'simplified_null_return' => false, // disabled by Shift
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_line_comment_style' => [
'comment_types' => ['hash'],
],
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
'elements' => ['method', 'property'],
],
'whitespace_after_comma_in_array' => true,
];

$project_path = getcwd();
$finder = Finder::create()
->in([
$project_path.'/src',
$project_path.'/config',
$project_path.'/database',
$project_path.'/stubs',
$project_path.'/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return Config::create()
->setFinder($finder)
->setRules($rules)
->setRiskyAllowed(true)
->setUsingCache(true);
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
preset: laravel
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

43 changes: 42 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,45 @@
# Changelog

#### v6.1.0 `2020-09-11`

- Add Laravel 8 support

#### v6.0.3 `2020-08-06`

- Teamwork class can be resolved through type hinting (If you prefer, you can still use the Facade). Thanks to @rmccullagh.

#### v6.0.2 `2020-06-29`

#### v6.0.1 `2020-06-13`

- Fixed installation for Laravel 6.17 and below. Thanks to @oliuz.
- Fixed docs compatibility note.

#### v6.0.0 `2020-06-13`

- Added Laravel 6 and 7 Support.

#### v2.0.0 `2016-01-04`
- Added Laravel 5.2 support.

- Added Laravel 5.2 support.

## 8.1.0 - 2023-03-24

### What's Changed

- Remove redundant word by @ubpon in https://github.com/mpociot/teamwork/pull/154
- Added function createOwnedTeam to UserHasTeams by @khatriafaz in https://github.com/mpociot/teamwork/pull/155

### New Contributors

- @ubpon made their first contribution in https://github.com/mpociot/teamwork/pull/154
- @khatriafaz made their first contribution in https://github.com/mpociot/teamwork/pull/155

**Full Changelog**: https://github.com/mpociot/teamwork/compare/8.0.0...8.1.0

## Added Laravel 10 Support and drop obsolete version - 2023-02-15

### Removed

- Removed support for obsolete versions of Laravel and PHP.
- Do no longer run tests for `prefer-lowest` versions.
Loading