Compare commits

...

660 Commits

Author SHA1 Message Date
snyk-bot
0c57d87786 fix: upgrade @tiptap/extension-link from 2.1.16 to 2.2.4
Snyk has created this PR to upgrade @tiptap/extension-link from 2.1.16 to 2.2.4.

See this package in npm:
https://www.npmjs.com/package/@tiptap/extension-link

See this project in Snyk:
https://app.snyk.io/org/nomadjimbob/project/66c7b29c-3171-4fcc-b6f1-0bc65698880c?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-04-17 00:43:59 +00:00
5fbca80a3c disable Intervention\Image\ImageServiceProvider::class 2024-04-04 20:59:59 +10:00
4fa1410790 dependency updates 2024-04-04 20:33:31 +10:00
411fc5f37f dependency updates 2024-04-04 20:22:09 +10:00
f7c20719f7 dependency updates 2024-04-04 20:18:43 +10:00
e5a7aeede8 Merge pull request #431 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/parser-6.19.1 2024-01-26 19:48:06 +10:00
dependabot[bot]
cfbf3a4033 Bump @typescript-eslint/parser from 6.19.0 to 6.19.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.19.0 to 6.19.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.19.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-26 09:47:25 +00:00
89cda7c415 Merge pull request #436 from STEMMechanics/dependabot/composer/doctrine/dbal-3.8.0 2024-01-26 19:47:21 +10:00
e211436675 Merge pull request #435 from STEMMechanics/dependabot/npm_and_yarn/dotenv-16.4.1 2024-01-26 19:47:09 +10:00
d1be96a1df Merge pull request #434 from STEMMechanics/dependabot/composer/laravel/sail-1.27.2 2024-01-26 19:46:59 +10:00
dependabot[bot]
7e87312d99 Bump laravel/sail from 1.27.1 to 1.27.2
Bumps [laravel/sail](https://github.com/laravel/sail) from 1.27.1 to 1.27.2.
- [Release notes](https://github.com/laravel/sail/releases)
- [Changelog](https://github.com/laravel/sail/blob/1.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/sail/compare/v1.27.1...v1.27.2)

---
updated-dependencies:
- dependency-name: laravel/sail
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-26 09:45:36 +00:00
dependabot[bot]
73c277acfb Bump dotenv from 16.3.1 to 16.4.1
Bumps [dotenv](https://github.com/motdotla/dotenv) from 16.3.1 to 16.4.1.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v16.3.1...v16.4.1)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-26 09:45:31 +00:00
0728233206 Merge pull request #430 from STEMMechanics/dependabot/npm_and_yarn/vitejs/plugin-vue-5.0.3 2024-01-26 19:45:07 +10:00
b127ce0514 Merge pull request #429 from STEMMechanics/dependabot/npm_and_yarn/knip-4.2.1 2024-01-26 19:44:57 +10:00
5924222296 Merge pull request #428 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-6.19.1 2024-01-26 19:44:45 +10:00
6d2c601b5d Merge pull request #427 from STEMMechanics/dependabot/composer/laravel/pint-1.13.10 2024-01-26 19:43:32 +10:00
f2fb993596 Merge pull request #426 from STEMMechanics/dependabot/composer/phpunit/phpunit-10.5.9 2024-01-26 19:43:08 +10:00
c40232099f Merge pull request #425 from STEMMechanics/dependabot/composer/intervention/image-3.3.1 2024-01-26 19:42:48 +10:00
dependabot[bot]
17d33a9ad2 Bump doctrine/dbal from 3.7.2 to 3.8.0
Bumps [doctrine/dbal](https://github.com/doctrine/dbal) from 3.7.2 to 3.8.0.
- [Release notes](https://github.com/doctrine/dbal/releases)
- [Commits](https://github.com/doctrine/dbal/compare/3.7.2...3.8.0)

---
updated-dependencies:
- dependency-name: doctrine/dbal
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-26 00:25:53 +00:00
dependabot[bot]
e380bafbb0 Bump @vitejs/plugin-vue from 4.6.2 to 5.0.3
Bumps [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/HEAD/packages/plugin-vue) from 4.6.2 to 5.0.3.
- [Release notes](https://github.com/vitejs/vite-plugin-vue/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-vue/commits/plugin-vue@5.0.3/packages/plugin-vue)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-vue"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-23 00:33:50 +00:00
dependabot[bot]
4c63e68625 Bump knip from 4.2.0 to 4.2.1
Bumps [knip](https://github.com/webpro/knip/tree/HEAD/packages/knip) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/webpro/knip/releases)
- [Commits](https://github.com/webpro/knip/commits/4.2.1/packages/knip)

---
updated-dependencies:
- dependency-name: knip
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-23 00:33:39 +00:00
dependabot[bot]
8b5d150fe2 Bump @typescript-eslint/eslint-plugin from 6.19.0 to 6.19.1
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.19.0 to 6.19.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.19.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-23 00:33:30 +00:00
dependabot[bot]
10808f3622 Bump laravel/pint from 1.13.9 to 1.13.10
Bumps [laravel/pint](https://github.com/laravel/pint) from 1.13.9 to 1.13.10.
- [Release notes](https://github.com/laravel/pint/releases)
- [Changelog](https://github.com/laravel/pint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/laravel/pint/compare/v1.13.9...v1.13.10)

---
updated-dependencies:
- dependency-name: laravel/pint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-23 00:27:26 +00:00
dependabot[bot]
37ba8f0f29 Bump phpunit/phpunit from 10.5.8 to 10.5.9
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.5.8 to 10.5.9.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.5.9/ChangeLog-10.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.5.8...10.5.9)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-23 00:27:18 +00:00
dependabot[bot]
51fb0150d9 Bump intervention/image from 3.3.0 to 3.3.1
Bumps [intervention/image](https://github.com/Intervention/image) from 3.3.0 to 3.3.1.
- [Commits](https://github.com/Intervention/image/compare/3.3.0...3.3.1)

---
updated-dependencies:
- dependency-name: intervention/image
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-23 00:27:11 +00:00
James Collins
03dd12cea1 Merge pull request #423 from STEMMechanics/dependabot/npm_and_yarn/vitest-1.2.1
Bump vitest from 0.34.6 to 1.2.1
2024-01-22 12:08:26 +10:00
dependabot[bot]
56ae719a2e Bump vitest from 0.34.6 to 1.2.1
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 0.34.6 to 1.2.1.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.2.1/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 02:07:55 +00:00
James Collins
68b7e50b9e Merge pull request #422 from STEMMechanics/dependabot/npm_and_yarn/eslint-plugin-jsdoc-48.0.2
Bump eslint-plugin-jsdoc from 46.10.1 to 48.0.2
2024-01-22 12:07:27 +10:00
James Collins
386e2009c4 Merge pull request #421 from STEMMechanics/dependabot/npm_and_yarn/knip-4.2.0
Bump knip from 2.43.0 to 4.2.0
2024-01-22 12:07:15 +10:00
James Collins
3da55bca81 Merge pull request #420 from STEMMechanics/dependabot/npm_and_yarn/vite-5.0.12
Bump vite from 4.5.1 to 5.0.12
2024-01-22 12:06:58 +10:00
dependabot[bot]
5d8f1457d4 Bump vite from 4.5.1 to 5.0.12
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.1 to 5.0.12.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.12/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.12/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 01:42:15 +00:00
James Collins
39d9ebc549 Merge pull request #419 from STEMMechanics/dependabot/composer/intervention/image-3.3.0
Bump intervention/image from 2.7.2 to 3.3.0
2024-01-22 11:41:32 +10:00
James Collins
b2f3664909 Merge pull request #418 from STEMMechanics/dependabot/composer/phpunit/phpunit-10.5.8
Bump phpunit/phpunit from 10.5.7 to 10.5.8
2024-01-22 11:41:15 +10:00
James Collins
06c2f0e3d0 Merge pull request #417 from STEMMechanics/dependabot/npm_and_yarn/vite-4.5.2
Bump vite from 4.5.1 to 4.5.2
2024-01-22 11:40:54 +10:00
dependabot[bot]
2d2392c8ae Bump intervention/image from 2.7.2 to 3.3.0
Bumps [intervention/image](https://github.com/Intervention/image) from 2.7.2 to 3.3.0.
- [Commits](https://github.com/Intervention/image/compare/2.7.2...3.3.0)

---
updated-dependencies:
- dependency-name: intervention/image
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 01:22:46 +00:00
dependabot[bot]
5e7061bc61 Bump vite from 4.5.1 to 4.5.2
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.1 to 4.5.2.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.2/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.2/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 01:20:29 +00:00
James Collins
8451a2bd4b Merge pull request #415 from STEMMechanics/dependabot/npm_and_yarn/prettier-3.2.4
Bump prettier from 3.0.3 to 3.2.4
2024-01-22 11:11:23 +10:00
James Collins
dd135f10ec Merge pull request #413 from STEMMechanics/dependabot/composer/square/square-34.0.1.20240118
Bump square/square from 32.0.0.20231018 to 34.0.1.20240118
2024-01-22 11:11:00 +10:00
dependabot[bot]
247eb03cea Bump eslint-plugin-jsdoc from 46.10.1 to 48.0.2
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 46.10.1 to 48.0.2.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v46.10.1...v48.0.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 01:10:49 +00:00
dependabot[bot]
19c16cfbf1 Bump square/square from 32.0.0.20231018 to 34.0.1.20240118
Bumps [square/square](https://github.com/square/square-php-sdk) from 32.0.0.20231018 to 34.0.1.20240118.
- [Release notes](https://github.com/square/square-php-sdk/releases)
- [Changelog](https://github.com/square/square-php-sdk/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/square-php-sdk/compare/32.0.0.20231018...34.0.1.20240118)

---
updated-dependencies:
- dependency-name: square/square
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 01:10:22 +00:00
dependabot[bot]
456687edc5 Bump knip from 2.43.0 to 4.2.0
Bumps [knip](https://github.com/webpro/knip/tree/HEAD/packages/knip) from 2.43.0 to 4.2.0.
- [Release notes](https://github.com/webpro/knip/releases)
- [Commits](https://github.com/webpro/knip/commits/4.2.0/packages/knip)

---
updated-dependencies:
- dependency-name: knip
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 01:10:18 +00:00
James Collins
aab63bb627 Merge pull request #397 from STEMMechanics/dependabot/npm_and_yarn/unocss-0.58.3
Bump unocss from 0.57.7 to 0.58.3
2024-01-22 11:06:09 +10:00
dependabot[bot]
efb3cac129 Bump unocss from 0.57.7 to 0.58.3
Bumps [unocss](https://github.com/unocss/unocss) from 0.57.7 to 0.58.3.
- [Release notes](https://github.com/unocss/unocss/releases)
- [Commits](https://github.com/unocss/unocss/compare/v0.57.7...v0.58.3)

---
updated-dependencies:
- dependency-name: unocss
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 01:03:28 +00:00
James Collins
36314339fb Merge pull request #361 from STEMMechanics/dependabot/composer/guzzlehttp/guzzle-7.8.1
Bump guzzlehttp/guzzle from 7.8.0 to 7.8.1
2024-01-22 10:49:10 +10:00
dependabot[bot]
c6247e445f Bump phpunit/phpunit from 10.5.7 to 10.5.8
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.5.7 to 10.5.8.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.5.8/ChangeLog-10.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.5.7...10.5.8)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 00:44:40 +00:00
b028856eb5 php 8.2 now required 2024-01-19 10:04:51 +10:00
1925b2ef0c dependency updates 2024-01-19 09:53:52 +10:00
dependabot[bot]
0d1bd4522e Bump prettier from 3.0.3 to 3.2.4
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.2.4.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.2.4)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-18 00:55:39 +00:00
f2e84b63fa dependency updates 2024-01-15 09:02:21 +10:00
ac6257ed6d vs settings change 2024-01-15 09:02:16 +10:00
2486dec824 added rel="nofollow" to download links 2024-01-15 09:01:36 +10:00
04e6c0d0fc fix bad param 2024-01-06 15:57:46 +10:00
b948c42fe2 check if file_security is missing 2024-01-06 15:57:39 +10:00
5d7be1a482 dependency updates 2024-01-06 15:57:22 +10:00
4e81d06a6e dep updates 2023-12-25 19:23:46 +10:00
dependabot[bot]
0f2400ff2b Bump guzzlehttp/guzzle from 7.8.0 to 7.8.1
Bumps [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) from 7.8.0 to 7.8.1.
- [Release notes](https://github.com/guzzle/guzzle/releases)
- [Changelog](https://github.com/guzzle/guzzle/blob/7.8/CHANGELOG.md)
- [Commits](https://github.com/guzzle/guzzle/compare/7.8.0...7.8.1)

---
updated-dependencies:
- dependency-name: guzzlehttp/guzzle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-04 00:54:13 +00:00
7ed2332a3e dependency updates 2023-12-01 10:52:49 +10:00
James Collins
c432b32d08 Merge pull request #319 from STEMMechanics/dependabot/composer/laravel/framework-10.30.1
Bump laravel/framework from 10.30.0 to 10.30.1
2023-11-02 10:39:26 +10:00
James Collins
8cf628153c Merge pull request #318 from STEMMechanics/dependabot/npm_and_yarn/knip-2.38.6
Bump knip from 2.38.4 to 2.38.6
2023-11-02 10:38:24 +10:00
dependabot[bot]
ab0bd9e7d9 Bump laravel/framework from 10.30.0 to 10.30.1
Bumps [laravel/framework](https://github.com/laravel/framework) from 10.30.0 to 10.30.1.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/10.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/framework/compare/v10.30.0...v10.30.1)

---
updated-dependencies:
- dependency-name: laravel/framework
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 00:26:04 +00:00
dependabot[bot]
51cd70f2ec Bump knip from 2.38.4 to 2.38.6
Bumps [knip](https://github.com/webpro/knip) from 2.38.4 to 2.38.6.
- [Release notes](https://github.com/webpro/knip/releases)
- [Changelog](https://github.com/webpro/knip/blob/main/docs/release-notes-v2.md)
- [Commits](https://github.com/webpro/knip/compare/2.38.4...2.38.6)

---
updated-dependencies:
- dependency-name: knip
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 00:15:36 +00:00
235d4e3784 Merge pull request #317 from STEMMechanics/dependabot/composer/laravel/framework-10.30.0 2023-11-01 10:52:42 +10:00
dependabot[bot]
dd0bbad18f Bump laravel/framework from 10.29.0 to 10.30.0
Bumps [laravel/framework](https://github.com/laravel/framework) from 10.29.0 to 10.30.0.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/10.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/framework/compare/v10.29.0...v10.30.0)

---
updated-dependencies:
- dependency-name: laravel/framework
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 00:51:33 +00:00
f32059c3e7 Merge pull request #316 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/parser-6.9.1 2023-10-31 11:24:17 +10:00
dependabot[bot]
92578ef738 Bump @typescript-eslint/parser from 6.9.0 to 6.9.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.9.0 to 6.9.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-31 01:21:23 +00:00
367205f955 Merge pull request #315 from STEMMechanics/dependabot/npm_and_yarn/eslint-8.52.0 2023-10-31 11:20:58 +10:00
1fdf36669f Merge pull request #314 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-6.9.1 2023-10-31 11:20:43 +10:00
dependabot[bot]
dfa06b148f Bump eslint from 8.51.0 to 8.52.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.51.0 to 8.52.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.51.0...v8.52.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-31 01:08:07 +00:00
dependabot[bot]
139b437118 Bump @typescript-eslint/eslint-plugin from 6.9.0 to 6.9.1
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.9.0 to 6.9.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-31 01:07:54 +00:00
4dca636359 Merge pull request #312 from STEMMechanics/dependabot/npm_and_yarn/vue-3.3.7 2023-10-30 15:59:16 +10:00
4f1d2a179b Merge pull request #311 from STEMMechanics/dependabot/npm_and_yarn/knip-2.38.4 2023-10-30 15:59:02 +10:00
dependabot[bot]
ede28f375a Bump knip from 2.35.0 to 2.38.4
Bumps [knip](https://github.com/webpro/knip) from 2.35.0 to 2.38.4.
- [Release notes](https://github.com/webpro/knip/releases)
- [Changelog](https://github.com/webpro/knip/blob/main/docs/release-notes-v2.md)
- [Commits](https://github.com/webpro/knip/compare/2.35.0...2.38.4)

---
updated-dependencies:
- dependency-name: knip
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 01:38:00 +00:00
dependabot[bot]
06dfb8d7f6 Bump vue from 3.3.4 to 3.3.7
Bumps [vue](https://github.com/vuejs/core) from 3.3.4 to 3.3.7.
- [Release notes](https://github.com/vuejs/core/releases)
- [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vuejs/core/compare/v3.3.4...v3.3.7)

---
updated-dependencies:
- dependency-name: vue
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 01:37:46 +00:00
2d4090922f Merge pull request #313 from STEMMechanics/dependabot/npm_and_yarn/vite-plugin-compression2-0.11.0 2023-10-30 11:37:04 +10:00
3d58a09c21 Merge pull request #310 from STEMMechanics/dependabot/npm_and_yarn/sass-1.69.5 2023-10-30 11:36:40 +10:00
05da5f016c Merge pull request #309 from STEMMechanics/dependabot/npm_and_yarn/eslint-plugin-vue-9.18.1 2023-10-30 11:36:27 +10:00
dependabot[bot]
256eead944 Bump vite-plugin-compression2 from 0.10.6 to 0.11.0
Bumps [vite-plugin-compression2](https://github.com/nonzzz/vite-plugin-compression) from 0.10.6 to 0.11.0.
- [Release notes](https://github.com/nonzzz/vite-plugin-compression/releases)
- [Changelog](https://github.com/nonzzz/vite-plugin-compression/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nonzzz/vite-plugin-compression/compare/v0.10.6...v0.11.0)

---
updated-dependencies:
- dependency-name: vite-plugin-compression2
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 00:26:20 +00:00
dependabot[bot]
dcb8ffaa0d Bump sass from 1.69.4 to 1.69.5
Bumps [sass](https://github.com/sass/dart-sass) from 1.69.4 to 1.69.5.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.69.4...1.69.5)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 00:24:57 +00:00
dependabot[bot]
def671dd47 Bump eslint-plugin-vue from 9.17.0 to 9.18.1
Bumps [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) from 9.17.0 to 9.18.1.
- [Release notes](https://github.com/vuejs/eslint-plugin-vue/releases)
- [Commits](https://github.com/vuejs/eslint-plugin-vue/compare/v9.17.0...v9.18.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-vue
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 00:24:30 +00:00
717f360952 Merge pull request #302 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/parser-6.9.0 2023-10-29 11:59:09 +10:00
dependabot[bot]
1c0b91f52c Bump @typescript-eslint/parser from 6.8.0 to 6.9.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.8.0 to 6.9.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-28 07:52:11 +00:00
c733d39d30 Merge pull request #301 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-6.9.0 2023-10-28 17:51:41 +10:00
87bdea3bba Merge pull request #308 from STEMMechanics/dependabot/composer/phpunit/phpunit-10.4.2 2023-10-28 17:51:28 +10:00
efe80694f9 Merge pull request #307 from STEMMechanics/dependabot/composer/laravel/pint-1.13.5 2023-10-28 17:51:19 +10:00
be7e6ee400 Merge pull request #306 from STEMMechanics/dependabot/npm_and_yarn/unocss-0.57.1 2023-10-28 17:51:09 +10:00
319a7b27c5 Merge pull request #304 from STEMMechanics/dependabot/composer/laravel/sail-1.26.0 2023-10-28 17:51:00 +10:00
dbe20ac724 Merge pull request #303 from STEMMechanics/dependabot/composer/laravel/framework-10.29.0 2023-10-28 17:50:51 +10:00
dependabot[bot]
dc6ed3f43a Bump @typescript-eslint/eslint-plugin from 6.8.0 to 6.9.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.8.0 to 6.9.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-28 07:50:16 +00:00
ecddb5c6d3 Merge pull request #299 from STEMMechanics/dependabot/npm_and_yarn/ls-lint/ls-lint-2.2.2 2023-10-28 17:49:35 +10:00
34e5a37e24 Merge pull request #297 from STEMMechanics/dependabot/composer/square/square-32.0.0.20231018 2023-10-28 17:49:23 +10:00
eaca6bcc72 Merge pull request #283 from STEMMechanics/dependabot/npm_and_yarn/vitejs/plugin-vue-4.4.0 2023-10-28 17:49:04 +10:00
dependabot[bot]
bad588d4b2 Bump phpunit/phpunit from 10.4.1 to 10.4.2
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.4.1 to 10.4.2.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.4.2/ChangeLog-10.4.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.4.1...10.4.2)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-27 01:15:59 +00:00
dependabot[bot]
d5daf20351 Bump laravel/pint from 1.13.3 to 1.13.5
Bumps [laravel/pint](https://github.com/laravel/pint) from 1.13.3 to 1.13.5.
- [Release notes](https://github.com/laravel/pint/releases)
- [Changelog](https://github.com/laravel/pint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/laravel/pint/compare/v1.13.3...v1.13.5)

---
updated-dependencies:
- dependency-name: laravel/pint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-27 01:15:53 +00:00
dependabot[bot]
f512ab96fc Bump unocss from 0.55.7 to 0.57.1
Bumps [unocss](https://github.com/unocss/unocss) from 0.55.7 to 0.57.1.
- [Release notes](https://github.com/unocss/unocss/releases)
- [Commits](https://github.com/unocss/unocss/compare/v0.55.7...v0.57.1)

---
updated-dependencies:
- dependency-name: unocss
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-25 01:10:26 +00:00
dependabot[bot]
0cfa9a5483 Bump laravel/sail from 1.25.0 to 1.26.0
Bumps [laravel/sail](https://github.com/laravel/sail) from 1.25.0 to 1.26.0.
- [Release notes](https://github.com/laravel/sail/releases)
- [Changelog](https://github.com/laravel/sail/blob/1.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/sail/compare/v1.25.0...v1.26.0)

---
updated-dependencies:
- dependency-name: laravel/sail
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-25 00:17:49 +00:00
dependabot[bot]
979f934f22 Bump laravel/framework from 10.28.0 to 10.29.0
Bumps [laravel/framework](https://github.com/laravel/framework) from 10.28.0 to 10.29.0.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/10.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/framework/compare/v10.28.0...v10.29.0)

---
updated-dependencies:
- dependency-name: laravel/framework
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-25 00:17:39 +00:00
dependabot[bot]
1fa5820550 Bump @ls-lint/ls-lint from 2.2.1 to 2.2.2
Bumps [@ls-lint/ls-lint](https://github.com/loeffel-io/ls-lint) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/loeffel-io/ls-lint/releases)
- [Commits](https://github.com/loeffel-io/ls-lint/compare/v2.2.1...v2.2.2)

---
updated-dependencies:
- dependency-name: "@ls-lint/ls-lint"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-23 01:09:34 +00:00
8233afa825 codesniffer fixes 2023-10-20 11:10:33 +10:00
ba6f67798d obsolete 2023-10-20 09:47:29 +10:00
daabbaa3e4 ignore codesniffer 2023-10-20 09:22:30 +10:00
caa68b24d6 dependency updates 2023-10-20 09:21:09 +10:00
114db744b4 better error handling 2023-10-19 19:20:17 +10:00
8c910ed5f3 show error 2023-10-19 19:02:37 +10:00
1ef4332df6 cleanup 2023-10-19 18:55:57 +10:00
6e98269a0b dependency updates 2023-10-19 18:55:57 +10:00
dependabot[bot]
c918b91438 Bump square/square from 30.0.0.20230816 to 32.0.0.20231018
Bumps [square/square](https://github.com/square/square-php-sdk) from 30.0.0.20230816 to 32.0.0.20231018.
- [Release notes](https://github.com/square/square-php-sdk/releases)
- [Changelog](https://github.com/square/square-php-sdk/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/square-php-sdk/compare/30.0.0.20230816...32.0.0.20231018)

---
updated-dependencies:
- dependency-name: square/square
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-18 00:19:35 +00:00
2a1e634b34 added YT Link 2023-10-04 08:20:19 +10:00
dependabot[bot]
d45165d759 Bump @vitejs/plugin-vue from 4.3.4 to 4.4.0
Bumps [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/HEAD/packages/plugin-vue) from 4.3.4 to 4.4.0.
- [Release notes](https://github.com/vitejs/vite-plugin-vue/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-vue/commits/plugin-vue@4.4.0/packages/plugin-vue)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-vue"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 00:51:18 +00:00
a0a885e004 fix media dialog title 2023-09-29 17:05:28 +10:00
52f7070311 bad comma 2023-09-29 17:03:11 +10:00
e0650da5e9 fix new getURLPath 2023-09-29 16:57:55 +10:00
bf5cf3bce4 fix public validation 2023-09-29 16:45:42 +10:00
07d1dc4955 home button 2023-09-29 16:23:26 +10:00
11db41b900 accept media or string 2023-09-29 16:02:57 +10:00
3bca959d49 set field to user friendly url 2023-09-29 16:00:56 +10:00
3fee673314 remove console.log 2023-09-29 15:59:23 +10:00
3121d12f3a sort media list in reverse 2023-09-29 15:55:35 +10:00
b8731c3f37 clear unneeded initalize 2023-09-29 13:20:26 +10:00
b445a42896 reload 2023-09-29 13:19:06 +10:00
dbab224a9d fix pageloading 2023-09-29 13:17:18 +10:00
03f9659243 reload 2023-09-29 13:15:45 +10:00
0fb56133ff reload 2023-09-29 13:12:44 +10:00
afa7ca629c reload 2023-09-29 13:10:30 +10:00
9a9c382d7f fix reload 2023-09-29 13:08:39 +10:00
518b8d67bc reload page 2023-09-29 13:04:54 +10:00
ff0f8194e0 remove debug 2023-09-29 13:01:44 +10:00
f84f982c29 add retry button 2023-09-29 13:00:30 +10:00
420d81866c back button detection 2023-09-29 12:53:24 +10:00
1cd78ce93a back button fix 2023-09-29 12:47:47 +10:00
7cae8af89a catch back button 2023-09-29 12:45:33 +10:00
5088cea413 reset mounted 2023-09-29 12:36:39 +10:00
d670d52083 catch bad selectors 2023-09-29 12:33:23 +10:00
004aa116fb allow security_data in the correct contexts 2023-09-29 12:22:48 +10:00
32a08e1e10 better handling of storage exists 2023-09-29 12:16:43 +10:00
30d39c5326 cleanup 2023-09-29 12:16:25 +10:00
8affea3360 ignore empty mime_types 2023-09-29 12:00:01 +10:00
3b6b4dc388 support null $medium 2023-09-29 11:58:11 +10:00
9a9e75d96d remove empty mime_type ignore 2023-09-29 11:57:54 +10:00
ad6e4f0a23 fix case where new media has no security type 2023-09-29 11:52:17 +10:00
f66bc6d8aa updated lock icons and small views 2023-09-29 11:47:28 +10:00
845bb4763b fix thumb always overriding 2023-09-29 11:31:26 +10:00
e476b203c7 add download query 2023-09-29 11:22:29 +10:00
dd163630cb dependency updates 2023-09-29 11:14:43 +10:00
5d8a5ede7d add security icons 2023-09-29 11:10:08 +10:00
35ccb03c2b cleanup of styling 2023-09-29 11:10:01 +10:00
f6df068787 fix bad local storage url 2023-09-29 11:01:37 +10:00
b60a3601cb urlencode variables 2023-09-29 11:01:28 +10:00
8676844930 fix security policy notification styling 2023-09-29 07:40:14 +10:00
7e80e19eec fix change password dialog 2023-09-29 07:34:29 +10:00
e21c7ce1d0 add defaults for missing filter data 2023-09-29 07:28:21 +10:00
42f2baca5e media security_type updates 2023-09-29 07:19:33 +10:00
d9c0c8f1d8 fix sqlite error with renameColumn 2023-09-28 20:23:38 +10:00
b98e184d32 dependency updates 2023-09-28 10:09:48 +10:00
f764466199 ensure duplicate media items are not readded 2023-09-28 10:06:53 +10:00
6adfd9f3fa complete secure files 2023-09-28 09:59:40 +10:00
dbf9db1c92 create generic variants and thumbnail for secure documents 2023-09-27 17:08:45 +10:00
6cb7a8cb43 update secure media backend 2023-09-25 19:36:44 +10:00
2913960bcb update dependencies 2023-09-25 15:33:37 +10:00
8d0382a279 added 2023-09-25 15:33:29 +10:00
aa5ef50ed0 push params 2023-09-14 21:56:42 +10:00
d87b869633 added url support 2023-09-14 21:53:00 +10:00
99782bdf67 added helper function 2023-09-14 21:52:52 +10:00
6fa459e88e fix margin 2023-09-14 21:34:43 +10:00
954f2beea7 dependency updates 2023-09-14 21:32:55 +10:00
f216413a23 pagination on bottom 2023-09-14 21:30:35 +10:00
63572a2740 fix query comparison 2023-09-14 08:35:01 +10:00
aeb7595166 no default date if filter params exist 2023-09-14 08:32:03 +10:00
f507d198a7 fix query operators 2023-09-14 08:24:34 +10:00
9b5166c570 remove unused componets 2023-09-13 20:10:46 +10:00
2271aae557 use rawurlencode 2023-09-13 20:08:53 +10:00
8ed07e539f use new urlencode function 2023-09-13 20:04:43 +10:00
b029574fa5 add URLEncode function 2023-09-13 20:04:37 +10:00
e9d903ce79 autoload urlencode 2023-09-13 20:04:30 +10:00
1c9100e5de page not found error 2023-09-13 19:55:47 +10:00
1a59ac955d encode url 2023-09-13 19:23:31 +10:00
4d8e58f920 added scratch icon 2023-09-13 19:13:22 +10:00
James Collins
55ce8e0d9e Merge pull request #246 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-6.7.0
Bump @typescript-eslint/eslint-plugin from 6.6.0 to 6.7.0
2023-09-12 11:09:15 +10:00
dependabot[bot]
0d1a3f8dbf Bump @typescript-eslint/eslint-plugin from 6.6.0 to 6.7.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.6.0 to 6.7.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 01:08:20 +00:00
James Collins
9687a3c7a8 Merge pull request #247 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/parser-6.7.0
Bump @typescript-eslint/parser from 6.6.0 to 6.7.0
2023-09-12 11:07:38 +10:00
dependabot[bot]
471534021e Bump @typescript-eslint/parser from 6.6.0 to 6.7.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.6.0 to 6.7.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 00:53:48 +00:00
8c75abf16a add index to controller 2023-09-11 21:04:12 +10:00
472abaf30b use new routes 2023-09-11 21:04:02 +10:00
35426e1189 use new routes 2023-09-11 21:03:52 +10:00
6507d57424 change job to jobs and add index 2023-09-11 21:03:45 +10:00
4252878019 support the | (or) operator 2023-09-11 21:03:12 +10:00
James Collins
8451cc1547 Merge pull request #245 from STEMMechanics/dependabot/npm_and_yarn/eslint-plugin-jsdoc-46.6.0
Bump eslint-plugin-jsdoc from 46.5.1 to 46.6.0
2023-09-11 11:24:52 +10:00
dependabot[bot]
70ecefb007 Bump eslint-plugin-jsdoc from 46.5.1 to 46.6.0
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 46.5.1 to 46.6.0.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v46.5.1...v46.6.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 01:15:29 +00:00
4e7be1a18c remove stale jobs 2023-09-10 21:16:00 +10:00
d1cc468dfa added clean temp files schedule 2023-09-10 21:06:00 +10:00
484512f2c7 fix spacing 2023-09-10 20:43:28 +10:00
83b4df3462 fix icon text 2023-09-10 20:34:39 +10:00
8ea46b4ea8 update message 2023-09-10 20:34:34 +10:00
a68faa11b0 increase max chunks count 2023-09-10 20:26:51 +10:00
541cd93c99 cleanup 2023-09-10 20:26:00 +10:00
c5a7982945 update file icons 2023-09-10 20:25:54 +10:00
5cee36453e Transferring to CDN, not Uploading 2023-09-10 20:13:12 +10:00
47ea87b614 improve upload progress indicator 2023-09-10 20:11:22 +10:00
4ad0df2c39 dependency updates 2023-09-10 20:11:11 +10:00
f2ff8398eb dont rotate non images/video 2023-09-10 20:06:48 +10:00
3f915d6964 fixes to uploading in chunks 2023-09-10 19:59:26 +10:00
3e6a9da0d1 media job now uses progress_max 2023-09-10 18:33:54 +10:00
James Collins
ca5f4ffd84 Merge pull request #244 from STEMMechanics/dependabot/npm_and_yarn/knip-2.22.0
Bump knip from 2.21.2 to 2.22.0
2023-09-08 11:19:41 +10:00
James Collins
b66f9f79d2 Merge pull request #243 from STEMMechanics/dependabot/composer/league/flysystem-aws-s3-v3-3.16.0
Bump league/flysystem-aws-s3-v3 from 3.15.0 to 3.16.0
2023-09-08 11:17:58 +10:00
dependabot[bot]
dc0bfe6d7a Bump knip from 2.21.2 to 2.22.0
Bumps [knip](https://github.com/webpro/knip) from 2.21.2 to 2.22.0.
- [Release notes](https://github.com/webpro/knip/releases)
- [Changelog](https://github.com/webpro/knip/blob/main/docs/release-notes-v2.md)
- [Commits](https://github.com/webpro/knip/compare/2.21.2...2.22.0)

---
updated-dependencies:
- dependency-name: knip
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-08 01:01:38 +00:00
dependabot[bot]
5de463bd02 Bump league/flysystem-aws-s3-v3 from 3.15.0 to 3.16.0
Bumps [league/flysystem-aws-s3-v3](https://github.com/thephpleague/flysystem-aws-s3-v3) from 3.15.0 to 3.16.0.
- [Commits](https://github.com/thephpleague/flysystem-aws-s3-v3/compare/3.15.0...3.16.0)

---
updated-dependencies:
- dependency-name: league/flysystem-aws-s3-v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-08 00:59:15 +00:00
James Collins
f3d858d785 Merge pull request #242 from STEMMechanics/dependabot/composer/laravel/pint-1.13.1
Bump laravel/pint from 1.13.0 to 1.13.1
2023-09-07 17:52:51 +10:00
dependabot[bot]
0e537a6b46 Bump laravel/pint from 1.13.0 to 1.13.1
Bumps [laravel/pint](https://github.com/laravel/pint) from 1.13.0 to 1.13.1.
- [Release notes](https://github.com/laravel/pint/releases)
- [Changelog](https://github.com/laravel/pint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/laravel/pint/compare/v1.13.0...v1.13.1)

---
updated-dependencies:
- dependency-name: laravel/pint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 00:21:35 +00:00
8d78b15751 block access to the .git directory 2023-09-06 12:25:03 +10:00
James Collins
e1fc2fa271 Merge pull request #239 from STEMMechanics/dependabot/npm_and_yarn/knip-2.21.2
Bump knip from 2.21.1 to 2.21.2
2023-09-06 11:08:00 +10:00
James Collins
27466ad3a6 Merge pull request #241 from STEMMechanics/dependabot/npm_and_yarn/tiptap/starter-kit-2.1.8
Bump @tiptap/starter-kit from 2.1.7 to 2.1.8
2023-09-06 11:06:48 +10:00
dependabot[bot]
f0d63b4120 Bump @tiptap/starter-kit from 2.1.7 to 2.1.8
Bumps [@tiptap/starter-kit](https://github.com/ueberdosis/tiptap/tree/HEAD/packages/starter-kit) from 2.1.7 to 2.1.8.
- [Release notes](https://github.com/ueberdosis/tiptap/releases)
- [Changelog](https://github.com/ueberdosis/tiptap/blob/v2.1.8/packages/starter-kit/CHANGELOG.md)
- [Commits](https://github.com/ueberdosis/tiptap/commits/v2.1.8/packages/starter-kit)

---
updated-dependencies:
- dependency-name: "@tiptap/starter-kit"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 01:00:47 +00:00
dependabot[bot]
163dd98b7b Bump knip from 2.21.1 to 2.21.2
Bumps [knip](https://github.com/webpro/knip) from 2.21.1 to 2.21.2.
- [Release notes](https://github.com/webpro/knip/releases)
- [Changelog](https://github.com/webpro/knip/blob/main/docs/release-notes-v2.md)
- [Commits](https://github.com/webpro/knip/compare/2.21.1...2.21.2)

---
updated-dependencies:
- dependency-name: knip
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 00:58:27 +00:00
8610a1678d dependency updates 2023-09-06 10:57:21 +10:00
James Collins
d20c7832da Merge pull request #234 from STEMMechanics/dependabot/composer/laravel/sail-1.24.1
Bump laravel/sail from 1.24.0 to 1.24.1
2023-09-06 10:45:38 +10:00
James Collins
fcba4015ed Merge pull request #233 from STEMMechanics/dependabot/composer/laravel/pint-1.13.0
Bump laravel/pint from 1.12.0 to 1.13.0
2023-09-06 10:45:25 +10:00
James Collins
bb34a3c33a Merge pull request #232 from STEMMechanics/dependabot/composer/phpunit/phpunit-10.3.3
Bump phpunit/phpunit from 10.3.2 to 10.3.3
2023-09-06 10:45:13 +10:00
James Collins
dbded3ba14 Merge pull request #231 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/parser-6.6.0
Bump @typescript-eslint/parser from 6.5.0 to 6.6.0
2023-09-06 10:44:59 +10:00
dependabot[bot]
3a654e0480 Bump laravel/sail from 1.24.0 to 1.24.1
Bumps [laravel/sail](https://github.com/laravel/sail) from 1.24.0 to 1.24.1.
- [Release notes](https://github.com/laravel/sail/releases)
- [Changelog](https://github.com/laravel/sail/blob/1.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/sail/compare/v1.24.0...v1.24.1)

---
updated-dependencies:
- dependency-name: laravel/sail
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 00:44:55 +00:00
James Collins
4b358fba4f Merge pull request #230 from STEMMechanics/dependabot/npm_and_yarn/tiptap/extension-superscript-2.1.8
Bump @tiptap/extension-superscript from 2.1.7 to 2.1.8
2023-09-06 10:44:44 +10:00
dependabot[bot]
5aaeab686d Bump @typescript-eslint/parser from 6.5.0 to 6.6.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.5.0 to 6.6.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.6.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 00:43:06 +00:00
James Collins
5ff0a4e86f Merge pull request #229 from STEMMechanics/dependabot/npm_and_yarn/tiptap/extension-highlight-2.1.8
Bump @tiptap/extension-highlight from 2.1.7 to 2.1.8
2023-09-06 10:42:52 +10:00
James Collins
0c866ed009 Merge pull request #228 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-6.6.0
Bump @typescript-eslint/eslint-plugin from 6.5.0 to 6.6.0
2023-09-06 10:42:24 +10:00
James Collins
f09bf02c10 Merge pull request #227 from STEMMechanics/dependabot/composer/laravel/sanctum-3.3.0
Bump laravel/sanctum from 3.2.6 to 3.3.0
2023-09-06 10:42:07 +10:00
James Collins
ee2c30f938 Merge pull request #220 from STEMMechanics/dependabot/npm_and_yarn/prettier-3.0.3
Bump prettier from 3.0.2 to 3.0.3
2023-09-06 10:41:41 +10:00
dependabot[bot]
82f28bc712 Bump laravel/pint from 1.12.0 to 1.13.0
Bumps [laravel/pint](https://github.com/laravel/pint) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/laravel/pint/releases)
- [Changelog](https://github.com/laravel/pint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/laravel/pint/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: laravel/pint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 00:28:51 +00:00
dependabot[bot]
8020baf9d1 Bump phpunit/phpunit from 10.3.2 to 10.3.3
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.3.2 to 10.3.3.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.3.3/ChangeLog-10.3.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.3.2...10.3.3)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 00:28:46 +00:00
dependabot[bot]
b1cac44432 Bump @tiptap/extension-superscript from 2.1.7 to 2.1.8
Bumps [@tiptap/extension-superscript](https://github.com/ueberdosis/tiptap/tree/HEAD/packages/extension-superscript) from 2.1.7 to 2.1.8.
- [Release notes](https://github.com/ueberdosis/tiptap/releases)
- [Changelog](https://github.com/ueberdosis/tiptap/blob/v2.1.8/packages/extension-superscript/CHANGELOG.md)
- [Commits](https://github.com/ueberdosis/tiptap/commits/v2.1.8/packages/extension-superscript)

---
updated-dependencies:
- dependency-name: "@tiptap/extension-superscript"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 00:37:11 +00:00
dependabot[bot]
ab46b6118d Bump @tiptap/extension-highlight from 2.1.7 to 2.1.8
Bumps [@tiptap/extension-highlight](https://github.com/ueberdosis/tiptap/tree/HEAD/packages/extension-highlight) from 2.1.7 to 2.1.8.
- [Release notes](https://github.com/ueberdosis/tiptap/releases)
- [Changelog](https://github.com/ueberdosis/tiptap/blob/v2.1.8/packages/extension-highlight/CHANGELOG.md)
- [Commits](https://github.com/ueberdosis/tiptap/commits/v2.1.8/packages/extension-highlight)

---
updated-dependencies:
- dependency-name: "@tiptap/extension-highlight"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 00:36:45 +00:00
dependabot[bot]
52a1bfe804 Bump @typescript-eslint/eslint-plugin from 6.5.0 to 6.6.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.5.0 to 6.6.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.6.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 00:36:20 +00:00
dependabot[bot]
c7c5b5298c Bump laravel/sanctum from 3.2.6 to 3.3.0
Bumps [laravel/sanctum](https://github.com/laravel/sanctum) from 3.2.6 to 3.3.0.
- [Release notes](https://github.com/laravel/sanctum/releases)
- [Changelog](https://github.com/laravel/sanctum/blob/3.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/sanctum/compare/v3.2.6...v3.3.0)

---
updated-dependencies:
- dependency-name: laravel/sanctum
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 00:17:28 +00:00
James Collins
4c07917542 Merge pull request #225 from STEMMechanics/dependabot/npm_and_yarn/unocss-0.55.6
Bump unocss from 0.55.4 to 0.55.6
2023-09-04 11:11:03 +10:00
dependabot[bot]
fe06a2dd55 Bump unocss from 0.55.4 to 0.55.6
Bumps [unocss](https://github.com/unocss/unocss) from 0.55.4 to 0.55.6.
- [Release notes](https://github.com/unocss/unocss/releases)
- [Commits](https://github.com/unocss/unocss/compare/v0.55.4...v0.55.6)

---
updated-dependencies:
- dependency-name: unocss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 01:03:15 +00:00
143f002ead allow blank 2023-09-02 21:09:36 +10:00
83c0ae5841 bug fixes 2023-09-02 21:01:19 +10:00
0c05386804 bug fixes 2023-09-02 20:44:56 +10:00
9a70d4de0d bugfix 2023-09-02 19:59:26 +10:00
8950b5f50b titlecase to fix CDN 2023-09-02 19:56:06 +10:00
59e077fd6a bug fixes 2023-09-02 19:55:55 +10:00
c9fc5b2157 bugfix 2023-09-02 19:40:38 +10:00
e128bcfaf9 bugfix 2023-09-02 19:36:55 +10:00
7cf6b0bba6 bug fixes 2023-09-02 19:30:45 +10:00
c36d4783e7 dependency updates 2023-09-02 19:02:19 +10:00
29acd76051 fixes 2023-09-02 18:58:13 +10:00
eacf33b642 updates 2023-09-01 16:51:46 +10:00
46666db231 prevent truncation of urls 2023-09-01 13:00:07 +10:00
3dfa753f33 fix path truncates 2023-09-01 12:58:20 +10:00
41ae64a8c9 new media job support 2023-09-01 12:22:25 +10:00
fcf5400f71 added 2023-09-01 08:43:57 +10:00
2257736ad9 bug fixes 2023-08-31 23:21:20 +10:00
147b55ae78 updates 2023-08-30 15:20:24 +10:00
5b6c951dc0 use new mediaJob 2023-08-30 14:22:27 +10:00
0840d65011 added respondServerError 2023-08-30 12:00:44 +10:00
6394234960 more rules 2023-08-30 11:08:24 +10:00
e1dde655cb rename class 2023-08-30 10:55:36 +10:00
e01d59cbd8 use mediajob 2023-08-30 10:54:44 +10:00
22d1e195ed change id to job_id 2023-08-30 10:54:44 +10:00
c776e7b102 media job model 2023-08-30 10:52:26 +10:00
dependabot[bot]
3cd95a5a6b Bump prettier from 3.0.2 to 3.0.3
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-30 00:35:52 +00:00
aba7845a4b changes 2023-08-30 08:19:23 +10:00
f23c4c42b5 added location_url rule 2023-08-30 06:54:27 +10:00
05149dc723 update full description 2023-08-29 18:14:48 +10:00
a615c9d1d8 added full status 2023-08-29 18:11:29 +10:00
eed9ac8ff4 bugfix 2023-08-29 15:51:55 +10:00
258e7fe307 bugfix 2023-08-29 15:47:58 +10:00
a49a86a597 debug 2023-08-29 15:43:21 +10:00
b01c5d57c7 debug 2023-08-29 15:38:37 +10:00
4b0c113941 bug fix 2023-08-29 15:32:18 +10:00
277a0ae2e3 debug 2023-08-29 15:29:43 +10:00
a61aafdc6a debug 2023-08-29 15:25:31 +10:00
3a2899f913 debug 2023-08-29 15:22:27 +10:00
05b172cd47 bug fix 2023-08-29 15:07:40 +10:00
351259909c fix rule validation 2023-08-29 15:02:33 +10:00
0af44ffe02 bug fix 2023-08-29 14:56:02 +10:00
06799a90b0 bug fixes 2023-08-29 14:54:40 +10:00
c7fc9a1480 support chunk uploading 2023-08-29 14:51:30 +10:00
d5b8a89776 support file upload chunking 2023-08-29 14:34:59 +10:00
eada83aaf8 added chunking rules 2023-08-29 14:34:51 +10:00
9a63a9de80 additional helpers 2023-08-29 14:34:42 +10:00
b4859fd97f cleanup 2023-08-29 11:56:05 +10:00
794a18cfa0 updates to media handling on frontend 2023-08-29 11:31:57 +10:00
581b732b05 layout fixes 2023-08-29 08:44:56 +10:00
0119875d22 cache persistant 2023-08-29 08:03:06 +10:00
0f34c7dfb9 use new caching 2023-08-28 23:16:12 +10:00
04be7fdb3c implement callback/caching 2023-08-28 23:16:04 +10:00
123d45d172 removed debug log 2023-08-28 23:02:04 +10:00
James Collins
864ae189af Merge pull request #213 from STEMMechanics/dependabot/npm_and_yarn/vitest-0.34.3
Bump vitest from 0.33.0 to 0.34.3
2023-08-28 22:19:43 +10:00
dependabot[bot]
13b2620d2e Bump vitest from 0.33.0 to 0.34.3
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 0.33.0 to 0.34.3.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.34.3/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-28 12:19:18 +00:00
James Collins
75c4ad73ed Merge pull request #198 from STEMMechanics/dependabot/npm_and_yarn/prettier-3.0.2
Bump prettier from 3.0.0 to 3.0.2
2023-08-28 22:18:45 +10:00
James Collins
2c2f5621df Merge pull request #212 from STEMMechanics/dependabot/npm_and_yarn/unocss-0.55.3
Bump unocss from 0.54.3 to 0.55.3
2023-08-28 22:18:31 +10:00
James Collins
855accab4f Merge pull request #199 from STEMMechanics/dependabot/composer/square/square-30.0.0.20230816
Bump square/square from 29.0.0.20230720 to 30.0.0.20230816
2023-08-28 22:17:38 +10:00
dependabot[bot]
afaa702a02 Bump prettier from 3.0.0 to 3.0.2
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0 to 3.0.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.0...3.0.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-28 12:17:32 +00:00
James Collins
15637d398e Merge pull request #197 from STEMMechanics/dependabot/npm_and_yarn/laravel-vite-plugin-0.8.0
Bump laravel-vite-plugin from 0.7.8 to 0.8.0
2023-08-28 22:17:07 +10:00
James Collins
f346625bb1 Merge pull request #188 from STEMMechanics/dependabot/npm_and_yarn/eslint-config-prettier-9.0.0
Bump eslint-config-prettier from 8.9.0 to 9.0.0
2023-08-28 22:16:36 +10:00
9764fef01c dependency updates 2023-08-28 22:13:56 +10:00
338d6c6f9d bug fix 2023-08-28 15:40:12 +10:00
9da6f39e6e bug fix 2023-08-28 15:37:45 +10:00
5759794f71 dont process video if not changed 2023-08-28 15:31:31 +10:00
ee9d96a5bf fix increment 2023-08-28 15:31:20 +10:00
9197a86670 fix progress bar 2023-08-28 15:21:10 +10:00
64e45b1892 fixes 2023-08-28 15:11:18 +10:00
6890a0939d fix rotate error 2023-08-28 14:29:47 +10:00
61c78534d8 loading status and fixes 2023-08-28 14:21:09 +10:00
5a611f96a8 added x-small 2023-08-28 14:21:00 +10:00
3e7f34d5c4 fix video uploads 2023-08-28 14:00:07 +10:00
dependabot[bot]
78d16bec5f Bump unocss from 0.54.3 to 0.55.3
Bumps [unocss](https://github.com/unocss/unocss) from 0.54.3 to 0.55.3.
- [Release notes](https://github.com/unocss/unocss/releases)
- [Commits](https://github.com/unocss/unocss/compare/v0.54.3...v0.55.3)

---
updated-dependencies:
- dependency-name: unocss
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-28 01:13:24 +00:00
33f658e088 provide progress 2023-08-28 07:39:41 +10:00
0b46c34abe Probe video format 2023-08-27 07:08:31 +10:00
f1ad20cb0b Change hiding workshops from 14 to 8 days old 2023-08-27 06:50:30 +10:00
511da54909 dont force refresh alll files 2023-08-25 20:08:09 +10:00
104407646c fix missing filter 2023-08-25 19:48:36 +10:00
622229cfc9 fixes 2023-08-25 11:30:57 +10:00
f50e6ad209 dependency updates 2023-08-24 22:17:44 +10:00
d7529cef80 updated to media management 2023-08-24 22:14:43 +10:00
dependabot[bot]
f7432158e1 Bump square/square from 29.0.0.20230720 to 30.0.0.20230816
Bumps [square/square](https://github.com/square/square-php-sdk) from 29.0.0.20230720 to 30.0.0.20230816.
- [Release notes](https://github.com/square/square-php-sdk/releases)
- [Changelog](https://github.com/square/square-php-sdk/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/square-php-sdk/compare/29.0.0.20230720...30.0.0.20230816)

---
updated-dependencies:
- dependency-name: square/square
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-16 00:34:01 +00:00
dependabot[bot]
2df6597771 Bump laravel-vite-plugin from 0.7.8 to 0.8.0
Bumps [laravel-vite-plugin](https://github.com/laravel/vite-plugin) from 0.7.8 to 0.8.0.
- [Release notes](https://github.com/laravel/vite-plugin/releases)
- [Changelog](https://github.com/laravel/vite-plugin/blob/main/CHANGELOG.md)
- [Commits](https://github.com/laravel/vite-plugin/compare/v0.7.8...v0.8.0)

---
updated-dependencies:
- dependency-name: laravel-vite-plugin
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 00:44:20 +00:00
60a15c2227 cleanup slug formatting 2023-08-14 10:06:08 +10:00
a369db9ca1 move css out of app.blade.php 2023-08-14 10:02:01 +10:00
dependabot[bot]
ac35d61ae2 Bump eslint-config-prettier from 8.9.0 to 9.0.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.9.0 to 9.0.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.9.0...v9.0.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-13 10:22:44 +00:00
489668a2ff dependency updates 2023-08-13 20:21:52 +10:00
c9087d5df4 cleanup 2023-08-13 19:39:56 +10:00
ac06b3700c cleanup 2023-08-13 19:37:47 +10:00
31578f5ed3 cleanup 2023-08-13 18:58:52 +10:00
9b178ade4b use generateVariants in model 2023-08-13 07:58:19 +10:00
92522b5494 added generateVariants 2023-08-13 07:57:20 +10:00
ccebb4eb73 dont distort thumbnail 2023-08-13 07:39:36 +10:00
16873e7477 move generateThumbnail to model 2023-08-13 07:36:34 +10:00
79318e2f28 cleanup 2023-08-13 07:09:55 +10:00
f44a4f5d9d resize pagination 2023-08-13 07:05:29 +10:00
b28925079b add margin to pagination bottom 2023-08-13 07:05:22 +10:00
cbf6803812 Merge pull request #174 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/parser-6.2.1 2023-08-01 12:27:01 +10:00
dependabot[bot]
a0e804aa62 Bump @typescript-eslint/parser from 6.2.0 to 6.2.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.2.0 to 6.2.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.2.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-01 02:26:18 +00:00
d1b87bd64b Merge pull request #175 from STEMMechanics/dependabot/npm_and_yarn/knip-2.17.2 2023-08-01 12:25:57 +10:00
5b783035a3 Merge pull request #173 from STEMMechanics/dependabot/npm_and_yarn/unocss-0.54.1 2023-08-01 12:25:38 +10:00
a06363da75 Merge pull request #172 from STEMMechanics/dependabot/npm_and_yarn/sass-1.64.2 2023-08-01 12:25:11 +10:00
a68c691f75 Merge pull request #171 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-6.2.1 2023-08-01 12:24:53 +10:00
dependabot[bot]
8a61d258fb Bump knip from 2.17.1 to 2.17.2
Bumps [knip](https://github.com/webpro/knip) from 2.17.1 to 2.17.2.
- [Release notes](https://github.com/webpro/knip/releases)
- [Changelog](https://github.com/webpro/knip/blob/main/docs/release-notes-v2.md)
- [Commits](https://github.com/webpro/knip/compare/2.17.1...2.17.2)

---
updated-dependencies:
- dependency-name: knip
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-01 00:27:18 +00:00
dependabot[bot]
fd3f220752 Bump unocss from 0.54.0 to 0.54.1
Bumps [unocss](https://github.com/unocss/unocss) from 0.54.0 to 0.54.1.
- [Release notes](https://github.com/unocss/unocss/releases)
- [Commits](https://github.com/unocss/unocss/compare/v0.54.0...v0.54.1)

---
updated-dependencies:
- dependency-name: unocss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-01 00:25:37 +00:00
dependabot[bot]
0a0b2927ae Bump sass from 1.64.1 to 1.64.2
Bumps [sass](https://github.com/sass/dart-sass) from 1.64.1 to 1.64.2.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.64.1...1.64.2)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-01 00:25:03 +00:00
dependabot[bot]
4c19773818 Bump @typescript-eslint/eslint-plugin from 6.2.0 to 6.2.1
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.2.0 to 6.2.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.2.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-01 00:24:46 +00:00
James Collins
071af03577 Merge pull request #170 from STEMMechanics/dependabot/npm_and_yarn/eslint-plugin-vue-9.16.1
Bump eslint-plugin-vue from 9.16.0 to 9.16.1
2023-07-31 11:06:23 +10:00
James Collins
58da0b54b3 Merge pull request #169 from STEMMechanics/dependabot/npm_and_yarn/unocss-0.54.0
Bump unocss from 0.53.6 to 0.54.0
2023-07-31 11:06:10 +10:00
dependabot[bot]
528ea4bcfb Bump eslint-plugin-vue from 9.16.0 to 9.16.1
Bumps [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) from 9.16.0 to 9.16.1.
- [Release notes](https://github.com/vuejs/eslint-plugin-vue/releases)
- [Commits](https://github.com/vuejs/eslint-plugin-vue/compare/v9.16.0...v9.16.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-vue
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-31 01:05:16 +00:00
dependabot[bot]
ca124d34cd Bump unocss from 0.53.6 to 0.54.0
Bumps [unocss](https://github.com/unocss/unocss) from 0.53.6 to 0.54.0.
- [Release notes](https://github.com/unocss/unocss/releases)
- [Commits](https://github.com/unocss/unocss/compare/v0.53.6...v0.54.0)

---
updated-dependencies:
- dependency-name: unocss
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-31 01:04:51 +00:00
70b53ce21a clean up attributes 2023-07-31 10:05:13 +10:00
6dc226ab0b do not send email on unit testing 2023-07-31 10:05:04 +10:00
d6524942f7 fix permissions vs permissions() 2023-07-31 09:33:23 +10:00
3ca5e81e34 dependency updates 2023-07-30 07:20:19 +10:00
561b5ad1b9 install clockwork for dev 2023-07-30 07:15:01 +10:00
229bb9a5e0 fix arrays 2023-07-30 07:15:01 +10:00
280d3e9043 Update HasAttachments.php 2023-07-30 07:03:16 +10:00
a2384f4b35 caching 2023-07-29 23:04:14 +10:00
d65bf5bcd5 mobile fix 2023-07-28 15:37:04 +10:00
e763a9140c fix search bar on mobile 2023-07-28 14:59:22 +10:00
3a06a375ef fix on mobiles 2023-07-28 14:56:20 +10:00
bdf3f38190 improve table on mobile 2023-07-28 14:06:34 +10:00
5b2f6e44b1 fix label padding 2023-07-28 14:06:27 +10:00
250401fd62 show image loader/errors 2023-07-28 13:46:40 +10:00
c1fb03add1 Merge pull request #168 from STEMMechanics/dependabot/npm_and_yarn/eslint-plugin-jsdoc-46.4.5 2023-07-28 10:25:08 +10:00
dependabot[bot]
56bf7efcef Bump eslint-plugin-jsdoc from 46.4.4 to 46.4.5
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 46.4.4 to 46.4.5.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v46.4.4...v46.4.5)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-28 00:24:19 +00:00
cc0508683e Merge pull request #167 from STEMMechanics/dependabot/npm_and_yarn/eslint-config-prettier-8.9.0 2023-07-28 10:23:36 +10:00
dependabot[bot]
b232b65860 Bump eslint-config-prettier from 8.8.0 to 8.9.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.8.0 to 8.9.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.8.0...v8.9.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-28 00:19:25 +00:00
406d1d31c0 fix typedefs 2023-07-28 09:42:03 +10:00
f8fe5c92aa cleanup 2023-07-28 09:29:05 +10:00
69623bd248 add variant support for thumbnails 2023-07-28 09:28:54 +10:00
6d4995074b attachments do not have users 2023-07-28 08:40:39 +10:00
ac94068864 cleanuip 2023-07-28 08:38:41 +10:00
31ed355d64 cleanup 2023-07-28 08:17:33 +10:00
8a54fb272a remove old code 2023-07-27 22:23:05 +10:00
6ecf807081 update method name 2023-07-27 22:22:46 +10:00
728472b897 expose 2023-07-27 22:21:01 +10:00
30a8c8a03a wait until mounted 2023-07-27 22:13:47 +10:00
00e7490037 test 2023-07-27 22:12:04 +10:00
1d152d730a fix form progress 2023-07-27 22:04:17 +10:00
a010d91da2 show error 2023-07-27 21:59:17 +10:00
3717248764 fixed flatten 2023-07-27 21:55:35 +10:00
27753e903b added exception handling 2023-07-27 20:58:38 +10:00
b621f71b54 remove mail logging 2023-07-27 20:43:16 +10:00
d4b3300b88 update config 2023-07-27 19:48:04 +10:00
242fb9dda0 added email logging 2023-07-27 19:47:09 +10:00
4f505cd155 fix BelongsTo association 2023-07-27 19:44:09 +10:00
dca70a0f53 fix bad mimetype requests 2023-07-27 19:37:45 +10:00
b9a8c826ec pass in accepts to show relevant files 2023-07-27 16:06:13 +10:00
363deb3ca7 fix showing error on empty 2023-07-27 15:50:55 +10:00
f77b5f7556 fix accepts 2023-07-27 15:50:46 +10:00
d60efe38e2 add uploads to selection list 2023-07-27 15:37:32 +10:00
f779342e02 fix z-index and add delete button 2023-07-27 15:29:35 +10:00
204e62b3bb fix z-index 2023-07-27 15:29:28 +10:00
5adc24f997 dont shrink 2023-07-27 15:09:58 +10:00
ab25b0f64a update selection details on change 2023-07-27 15:07:24 +10:00
dd8e59cd4f thumbnail support 2023-07-27 14:36:46 +10:00
0c4c36eb74 dependency updates 2023-07-27 06:28:43 +10:00
James Collins
3481f10033 Merge pull request #166 from STEMMechanics/dependabot/composer/laravel/framework-10.16.0
Bump laravel/framework from 10.15.0 to 10.16.0
2023-07-26 11:03:38 +10:00
James Collins
fdf61fef3d Merge pull request #165 from STEMMechanics/dependabot/npm_and_yarn/knip-2.17.0
Bump knip from 2.16.1 to 2.17.0
2023-07-26 11:03:22 +10:00
James Collins
30c3c5d33f Merge pull request #164 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/parser-6.2.0
Bump @typescript-eslint/parser from 6.1.0 to 6.2.0
2023-07-26 11:03:09 +10:00
dependabot[bot]
6cd7df79d9 Bump @typescript-eslint/parser from 6.1.0 to 6.2.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.2.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-26 01:02:30 +00:00
James Collins
b5b0b5d7bd Merge pull request #162 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-6.2.0
Bump @typescript-eslint/eslint-plugin from 6.1.0 to 6.2.0
2023-07-26 11:01:53 +10:00
James Collins
d0266c7d0c Merge pull request #161 from STEMMechanics/dependabot/npm_and_yarn/vite-4.4.7
Bump vite from 4.4.6 to 4.4.7
2023-07-26 11:01:38 +10:00
dependabot[bot]
283fd30c19 Bump vite from 4.4.6 to 4.4.7
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.4.6 to 4.4.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.4.7/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-26 01:00:23 +00:00
James Collins
5d13135bd0 Merge pull request #160 from STEMMechanics/dependabot/npm_and_yarn/unocss-0.53.6
Bump unocss from 0.53.5 to 0.53.6
2023-07-26 10:59:46 +10:00
dependabot[bot]
6c2961eef6 Bump laravel/framework from 10.15.0 to 10.16.0
Bumps [laravel/framework](https://github.com/laravel/framework) from 10.15.0 to 10.16.0.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/10.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/framework/compare/v10.15.0...v10.16.0)

---
updated-dependencies:
- dependency-name: laravel/framework
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-26 00:39:12 +00:00
dependabot[bot]
f9c006403e Bump knip from 2.16.1 to 2.17.0
Bumps [knip](https://github.com/webpro/knip) from 2.16.1 to 2.17.0.
- [Release notes](https://github.com/webpro/knip/releases)
- [Changelog](https://github.com/webpro/knip/blob/main/docs/release-notes-v2.md)
- [Commits](https://github.com/webpro/knip/compare/2.16.1...2.17.0)

---
updated-dependencies:
- dependency-name: knip
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-26 00:11:54 +00:00
dependabot[bot]
1f65f0fe30 Bump @typescript-eslint/eslint-plugin from 6.1.0 to 6.2.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.2.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-25 00:42:34 +00:00
dependabot[bot]
a49a287855 Bump unocss from 0.53.5 to 0.53.6
Bumps [unocss](https://github.com/unocss/unocss) from 0.53.5 to 0.53.6.
- [Release notes](https://github.com/unocss/unocss/releases)
- [Commits](https://github.com/unocss/unocss/compare/v0.53.5...v0.53.6)

---
updated-dependencies:
- dependency-name: unocss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-25 00:41:48 +00:00
bf7f830f9e fix formatted date 2023-07-24 20:25:27 +10:00
ffce564a47 fix info box icon shrinkage 2023-07-24 20:25:27 +10:00
2cdcd9a424 fix button types not displayed correctly 2023-07-24 20:25:27 +10:00
ffbc733571 fix undefined method 2023-07-24 15:02:13 +10:00
3ea7188253 updated logo 2023-07-24 13:05:57 +10:00
97c6a4c4ef cleanup 2023-07-24 12:51:34 +10:00
f3fe112427 fix params 2023-07-24 12:39:29 +10:00
189e4ef230 set null value to empty string 2023-07-24 12:36:34 +10:00
d35b895ff4 incorrect table name 2023-07-24 12:35:12 +10:00
c47c511674 fix bad call to gallery() 2023-07-24 12:32:55 +10:00
20be21c87d allow nullable useragent 2023-07-24 12:31:16 +10:00
1d57dc519f fix margin 2023-07-24 12:13:12 +10:00
644b42afe9 enable form on error 2023-07-24 12:12:15 +10:00
9ad11f24c2 update event controller to save attachments 2023-07-24 11:58:10 +10:00
1e2564f753 open links in new window 2023-07-24 11:52:58 +10:00
f1ab544aae fix attachments editor not shown 2023-07-24 11:50:04 +10:00
James Collins
aa85d24952 Merge pull request #159 from STEMMechanics/dependabot/npm_and_yarn/pinia-plugin-persistedstate-3.2.0
Bump pinia-plugin-persistedstate from 3.1.0 to 3.2.0
2023-07-24 11:48:41 +10:00
dependabot[bot]
b0f8817aae Bump pinia-plugin-persistedstate from 3.1.0 to 3.2.0
Bumps [pinia-plugin-persistedstate](https://github.com/prazdevs/pinia-plugin-persistedstate) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/prazdevs/pinia-plugin-persistedstate/releases)
- [Commits](https://github.com/prazdevs/pinia-plugin-persistedstate/compare/v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: pinia-plugin-persistedstate
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 01:48:25 +00:00
James Collins
b9e3e9f5f2 Merge pull request #158 from STEMMechanics/dependabot/npm_and_yarn/knip-2.16.1
Bump knip from 2.16.0 to 2.16.1
2023-07-24 11:48:21 +10:00
dependabot[bot]
ea05f5992d Bump knip from 2.16.0 to 2.16.1
Bumps [knip](https://github.com/webpro/knip) from 2.16.0 to 2.16.1.
- [Release notes](https://github.com/webpro/knip/releases)
- [Changelog](https://github.com/webpro/knip/blob/main/docs/release-notes-v2.md)
- [Commits](https://github.com/webpro/knip/compare/2.16.0...2.16.1)

---
updated-dependencies:
- dependency-name: knip
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 01:48:14 +00:00
James Collins
9c138d6bee Merge pull request #157 from STEMMechanics/dependabot/npm_and_yarn/sass-1.64.1
Bump sass from 1.64.0 to 1.64.1
2023-07-24 11:47:44 +10:00
James Collins
7325880a70 Merge pull request #156 from STEMMechanics/dependabot/npm_and_yarn/postcss-8.4.27
Bump postcss from 8.4.26 to 8.4.27
2023-07-24 11:47:30 +10:00
James Collins
320631e91d Merge pull request #155 from STEMMechanics/dependabot/npm_and_yarn/vite-4.4.6
Bump vite from 4.4.5 to 4.4.6
2023-07-24 11:47:09 +10:00
James Collins
0997864cd6 Merge pull request #154 from STEMMechanics/dependabot/composer/doctrine/dbal-3.6.5
Bump doctrine/dbal from 3.6.4 to 3.6.5
2023-07-24 11:46:50 +10:00
James Collins
9e0451d541 Merge pull request #149 from STEMMechanics/dependabot/composer/square/square-29.0.0.20230720
Bump square/square from 28.0.1.20230608 to 29.0.0.20230720
2023-07-24 11:46:35 +10:00
dependabot[bot]
84245c5584 Bump sass from 1.64.0 to 1.64.1
Bumps [sass](https://github.com/sass/dart-sass) from 1.64.0 to 1.64.1.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.64.0...1.64.1)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 00:56:49 +00:00
dependabot[bot]
d72c0ea9f5 Bump postcss from 8.4.26 to 8.4.27
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.26 to 8.4.27.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.26...8.4.27)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 00:56:24 +00:00
dependabot[bot]
bf9500f960 Bump vite from 4.4.5 to 4.4.6
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.4.5 to 4.4.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.4.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 00:56:11 +00:00
dependabot[bot]
f18cda6c00 Bump doctrine/dbal from 3.6.4 to 3.6.5
Bumps [doctrine/dbal](https://github.com/doctrine/dbal) from 3.6.4 to 3.6.5.
- [Release notes](https://github.com/doctrine/dbal/releases)
- [Commits](https://github.com/doctrine/dbal/compare/3.6.4...3.6.5)

---
updated-dependencies:
- dependency-name: doctrine/dbal
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 00:48:53 +00:00
0ab20a75ac duplicates should be draft, fix hour column 2023-07-21 11:34:48 +10:00
133a6ed4ea added duplication support 2023-07-21 11:30:16 +10:00
bc424b7a00 update event to new attachments API 2023-07-21 11:25:35 +10:00
be3c6d89ee Fix #150 2023-07-21 11:18:08 +10:00
d814ed1972 use transparent background instead of white 2023-07-21 11:10:07 +10:00
8322229001 dependency updates 2023-07-21 10:54:45 +10:00
da2a76d6cf only show current events if date is empty 2023-07-21 10:52:16 +10:00
dependabot[bot]
abf7a2783c Bump square/square from 28.0.1.20230608 to 29.0.0.20230720
Bumps [square/square](https://github.com/square/square-php-sdk) from 28.0.1.20230608 to 29.0.0.20230720.
- [Release notes](https://github.com/square/square-php-sdk/releases)
- [Changelog](https://github.com/square/square-php-sdk/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/square-php-sdk/compare/28.0.1.20230608...29.0.0.20230720)

---
updated-dependencies:
- dependency-name: square/square
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-20 00:36:30 +00:00
6690c69efe fix sqlite error 2023-07-19 17:04:40 +10:00
67044b7cf9 use variant thumb 2023-07-19 15:53:58 +10:00
048d3af39b dont show duplicates 2023-07-19 15:35:10 +10:00
816989d472 display initial items in editor 2023-07-19 15:31:16 +10:00
8f6310b463 added delete item button 2023-07-19 15:19:35 +10:00
3cebdd838b fix typecasting 2023-07-19 15:05:56 +10:00
9996404e29 missing trait 2023-07-19 15:00:07 +10:00
1598efac35 updated attachments 2023-07-19 14:56:56 +10:00
bfacb86f35 allow uploads 2023-07-19 12:48:17 +10:00
James Collins
e5e5c7e19c Merge pull request #145 from STEMMechanics/dependabot/composer/mockery/mockery-1.6.3
Bump mockery/mockery from 1.6.2 to 1.6.3
2023-07-19 12:12:55 +10:00
dependabot[bot]
9ede1d7eea Bump mockery/mockery from 1.6.2 to 1.6.3
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.6.2 to 1.6.3.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/1.6.x/CHANGELOG.md)
- [Commits](https://github.com/mockery/mockery/compare/1.6.2...1.6.3)

---
updated-dependencies:
- dependency-name: mockery/mockery
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-19 00:19:04 +00:00
ff8cf83f1b fix test 2023-07-18 19:36:17 +10:00
326c8e7b81 migrate configuration 2023-07-18 19:34:03 +10:00
daeecfbd4f allow image upload 2023-07-18 19:16:59 +10:00
15c330c784 dependency updates 2023-07-18 18:44:27 +10:00
7ba80ccc58 fixes 2023-07-18 18:41:17 +10:00
ef4efe723f gallery support 2023-07-18 18:37:49 +10:00
64ef8e9acd removed gallery item 2023-07-18 18:36:12 +10:00
d88b6f6e95 changed attachment to addendum 2023-07-18 18:36:12 +10:00
440d66322c add drop column 2023-07-18 18:36:12 +10:00
James Collins
469a646ae3 changed layout for consistency 2023-07-15 21:56:56 +10:00
9cb9ebbe4f fix robots seo to not follow/index authenticated pages 2023-07-14 14:12:27 +10:00
James Collins
d004855dd8 Merge pull request #132 from STEMMechanics/dependabot/npm_and_yarn/postcss-8.4.26
Bump postcss from 8.4.25 to 8.4.26
2023-07-14 11:16:10 +10:00
dependabot[bot]
911645c9f5 Bump postcss from 8.4.25 to 8.4.26
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.25 to 8.4.26.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.25...8.4.26)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-14 01:13:15 +00:00
James Collins
6a16e78d80 Merge pull request #133 from STEMMechanics/dependabot/npm_and_yarn/knip-2.15.5
Bump knip from 2.15.2 to 2.15.5
2023-07-14 11:12:32 +10:00
937c5024cb add support to convert HEIC files 2023-07-14 11:09:46 +10:00
dependabot[bot]
7e12ba1a00 Bump knip from 2.15.2 to 2.15.5
Bumps [knip](https://github.com/webpro/knip) from 2.15.2 to 2.15.5.
- [Release notes](https://github.com/webpro/knip/releases)
- [Changelog](https://github.com/webpro/knip/blob/main/docs/release-notes-v2.md)
- [Commits](https://github.com/webpro/knip/compare/2.15.2...2.15.5)

---
updated-dependencies:
- dependency-name: knip
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-14 00:16:15 +00:00
89d57bb915 better handling of selection list 2023-07-14 08:57:02 +10:00
a111387a3f fix date in banner not using UTC 2023-07-13 20:10:06 +10:00
234fcb13af fix lists in html 2023-07-13 13:11:15 +10:00
377fdad6e0 allow uploading of images 2023-07-13 13:00:12 +10:00
68020b0201 fix small block 2023-07-13 11:46:43 +10:00
f0628c5c05 fix small block 2023-07-13 11:28:00 +10:00
66d2a2c48c fix display small 2023-07-13 11:25:52 +10:00
6f1229418e added small option 2023-07-13 11:19:56 +10:00
a430fee568 fix page padding 2023-07-13 08:28:08 +10:00
53b7ce651e updated minecraft information 2023-07-13 07:34:17 +10:00
1028064abe fix link underline 2023-07-12 22:54:22 +10:00
ab285870e3 package fixes 2023-07-12 22:41:12 +10:00
1a02d46151 add support for multiple selections 2023-07-12 22:30:44 +10:00
1bb70bbe66 fix bubble menu 2023-07-12 22:30:37 +10:00
c158155194 fix setValidationResult 2023-07-12 22:30:12 +10:00
7bfd4c1198 added mimeMatches 2023-07-12 22:29:51 +10:00
ea959d1a10 fix alignment on small screens 2023-07-12 22:29:43 +10:00
9fc5d81877 fix toolbar on mobile 2023-07-12 13:43:24 +10:00
719aac6727 fix shorthand time parsing 2023-07-12 13:29:19 +10:00
c8398920c5 bubble updates 2023-07-12 12:52:48 +10:00
James Collins
55bd914b8f Merge pull request #126 from STEMMechanics/dependabot/npm_and_yarn/vite-4.4.3
Bump vite from 4.4.2 to 4.4.3
2023-07-12 11:29:42 +10:00
dependabot[bot]
2b06a52705 Bump vite from 4.4.2 to 4.4.3
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.4.2 to 4.4.3.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.4.3/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-12 01:27:06 +00:00
James Collins
2c9c997d5a Merge pull request #119 from STEMMechanics/dependabot/npm_and_yarn/vite-plugin-compression2-0.10.2
Bump vite-plugin-compression2 from 0.9.3 to 0.10.2
2023-07-12 11:26:29 +10:00
James Collins
17f305d9cb Merge pull request #128 from STEMMechanics/dependabot/composer/laravel/sail-1.23.1
Bump laravel/sail from 1.23.0 to 1.23.1
2023-07-12 11:26:13 +10:00
James Collins
44d071696f Merge pull request #127 from STEMMechanics/dependabot/npm_and_yarn/knip-2.15.2
Bump knip from 2.15.1 to 2.15.2
2023-07-12 11:25:55 +10:00
dependabot[bot]
fa8f44135c Bump vite-plugin-compression2 from 0.9.3 to 0.10.2
Bumps [vite-plugin-compression2](https://github.com/nonzzz/vite-compression-plugin) from 0.9.3 to 0.10.2.
- [Release notes](https://github.com/nonzzz/vite-compression-plugin/releases)
- [Changelog](https://github.com/nonzzz/vite-plugin-compression/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nonzzz/vite-compression-plugin/compare/v0.9.3...v0.10.2)

---
updated-dependencies:
- dependency-name: vite-plugin-compression2
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-12 01:25:52 +00:00
dependabot[bot]
b38e79ef8f Bump laravel/sail from 1.23.0 to 1.23.1
Bumps [laravel/sail](https://github.com/laravel/sail) from 1.23.0 to 1.23.1.
- [Release notes](https://github.com/laravel/sail/releases)
- [Changelog](https://github.com/laravel/sail/blob/1.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/sail/compare/v1.23.0...v1.23.1)

---
updated-dependencies:
- dependency-name: laravel/sail
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-12 01:25:41 +00:00
James Collins
e2e39fbdf5 Merge pull request #123 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-6.0.0
Bump @typescript-eslint/eslint-plugin from 5.61.0 to 6.0.0
2023-07-12 11:25:35 +10:00
James Collins
a8262932cc Merge pull request #117 from STEMMechanics/dependabot/npm_and_yarn/vitest-0.33.0
Bump vitest from 0.32.4 to 0.33.0
2023-07-12 11:24:55 +10:00
James Collins
6d3e9b3c1d Merge pull request #129 from STEMMechanics/dependabot/composer/laravel/framework-10.15.0
Bump laravel/framework from 10.14.1 to 10.15.0
2023-07-12 11:24:41 +10:00
James Collins
b91619801d Merge pull request #130 from STEMMechanics/dependabot/composer/laravel/pint-1.10.4
Bump laravel/pint from 1.10.3 to 1.10.4
2023-07-12 11:24:26 +10:00
dependabot[bot]
f1e32096f3 Bump laravel/pint from 1.10.3 to 1.10.4
Bumps [laravel/pint](https://github.com/laravel/pint) from 1.10.3 to 1.10.4.
- [Release notes](https://github.com/laravel/pint/releases)
- [Changelog](https://github.com/laravel/pint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/laravel/pint/compare/v1.10.3...v1.10.4)

---
updated-dependencies:
- dependency-name: laravel/pint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-12 00:48:53 +00:00
dependabot[bot]
f5a327e72c Bump laravel/framework from 10.14.1 to 10.15.0
Bumps [laravel/framework](https://github.com/laravel/framework) from 10.14.1 to 10.15.0.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/10.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/framework/compare/v10.14.1...v10.15.0)

---
updated-dependencies:
- dependency-name: laravel/framework
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-12 00:48:49 +00:00
4fe05e39f7 updates 2023-07-12 10:21:45 +10:00
dependabot[bot]
c3779bf371 Bump knip from 2.15.1 to 2.15.2
Bumps [knip](https://github.com/webpro/knip) from 2.15.1 to 2.15.2.
- [Release notes](https://github.com/webpro/knip/releases)
- [Changelog](https://github.com/webpro/knip/blob/main/docs/release-notes-v2.md)
- [Commits](https://github.com/webpro/knip/compare/2.15.1...2.15.2)

---
updated-dependencies:
- dependency-name: knip
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-12 00:20:21 +00:00
54aa7e249e fix allowUploads permission 2023-07-12 09:11:04 +10:00
1744d192b5 fix error on url 2023-07-11 21:55:01 +10:00
3f7426c550 fix class 2023-07-11 21:52:29 +10:00
c4e017c7b7 fix content parsing 2023-07-11 21:50:49 +10:00
e723831548 added bubble menu 2023-07-11 21:50:33 +10:00
56b5dcd7d8 fix ignore allowUpload in file drop 2023-07-11 19:34:07 +10:00
dependabot[bot]
913d229630 Bump @typescript-eslint/eslint-plugin from 5.61.0 to 6.0.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.61.0 to 6.0.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.0.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-11 09:32:05 +00:00
3dfb11d692 dependency updates 2023-07-11 19:31:09 +10:00
759ab14899 fix calculation 2023-07-11 19:29:08 +10:00
329ff7c478 fix incorrect key 2023-07-11 19:28:59 +10:00
a6022f7251 final media dialog 2023-07-11 19:22:18 +10:00
d345be889e work 2023-07-11 16:37:04 +10:00
2dbe9955d9 added info api 2023-07-11 10:36:57 +10:00
dependabot[bot]
8fcd33e0a1 Bump vitest from 0.32.4 to 0.33.0
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 0.32.4 to 0.33.0.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.33.0/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-10 06:05:41 +00:00
14aa5e3b28 additons 2023-07-10 16:05:00 +10:00
2cb9aac070 dependency updates 2023-07-10 08:38:08 +10:00
1c6a5c9d04 editor expansion 2023-07-07 22:54:34 +10:00
936aabf412 dependency updates 2023-07-07 18:37:06 +10:00
fa7478a5b5 remove bad dependency 2023-07-07 18:36:36 +10:00
8992554ba6 started toolbar 2023-07-07 16:40:23 +10:00
c8895137fa show loading icon 2023-07-07 11:31:43 +10:00
f8bc75f1f9 fix styling 2023-07-07 11:27:23 +10:00
43faa0f020 styling editor 2023-07-07 11:22:04 +10:00
8e76a18590 add loader option 2023-07-07 11:14:17 +10:00
9c1df26b4b remove obsolete css 2023-07-07 11:14:07 +10:00
6d89a499b1 pagination bar margin bottom 2023-07-07 09:54:32 +10:00
03430c272f reduce posts to 18 2023-07-07 09:52:04 +10:00
baf15296ce add toast loaders 2023-07-07 09:44:12 +10:00
56f74964ed removed mdpreview and added SMHTML 2023-07-07 07:21:14 +10:00
afad2df8f5 cleanup 2023-07-07 07:12:32 +10:00
d17ff1f2e7 dependency updates 2023-07-07 07:12:25 +10:00
4d9be34b4e changed to TipTap 2023-07-06 13:53:24 +10:00
James Collins
5213b28c2e Merge pull request #116 from STEMMechanics/dependabot/npm_and_yarn/prettier-3.0.0
Bump prettier from 2.8.8 to 3.0.0
2023-07-06 10:34:05 +10:00
dependabot[bot]
e0df5a53dc Bump prettier from 2.8.8 to 3.0.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-06 00:30:28 +00:00
James Collins
f13022ee1d update dependencies 2023-07-06 00:08:39 +00:00
James Collins
c063badb38 install tiptap dep 2023-07-06 00:06:35 +00:00
James Collins
693cf4cd2a remove md-editor 2023-07-06 00:05:15 +00:00
cc70b1a67f update dependencies 2023-07-04 09:28:41 +10:00
08d3366fe1 remove display name 2023-07-04 09:25:53 +10:00
080b2fcfc4 fixed bad link 2023-07-02 10:17:25 +10:00
5b1d02e3c1 reload value when late change 2023-07-01 19:36:55 +10:00
b322a405c7 fix form 2023-07-01 19:32:22 +10:00
0ed05b103b added 2023-07-01 19:32:15 +10:00
5431da3930 fix offset 2023-06-23 19:09:41 +10:00
2a6e5b7992 fix md-editor css crossover 2023-06-23 19:07:56 +10:00
85af95a8a0 dont wrap action column 2023-06-23 18:55:00 +10:00
e0b04a57ae fix starts at column not showing correct relative date 2023-06-23 18:53:57 +10:00
0533cd24fe fix relative dates in the future 2023-06-23 18:53:44 +10:00
9598031dd1 replace copy icon 2023-06-23 18:32:51 +10:00
9f808717d2 fix page padding 2023-06-23 18:30:32 +10:00
b4aa71b81b fix margin pagination 2023-06-23 12:07:55 +10:00
James Collins
321a8f0946 Merge pull request #98 from STEMMechanics/dependabot/npm_and_yarn/sass-1.63.6
Bump sass from 1.63.1 to 1.63.6
2023-06-23 11:32:38 +10:00
James Collins
93124cdad0 Merge pull request #99 from STEMMechanics/dependabot/npm_and_yarn/unocss-0.53.3
Bump unocss from 0.53.1 to 0.53.3
2023-06-23 11:32:17 +10:00
dependabot[bot]
26eae9b1cf Bump unocss from 0.53.1 to 0.53.3
Bumps [unocss](https://github.com/unocss/unocss) from 0.53.1 to 0.53.3.
- [Release notes](https://github.com/unocss/unocss/releases)
- [Commits](https://github.com/unocss/unocss/compare/v0.53.1...v0.53.3)

---
updated-dependencies:
- dependency-name: unocss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-23 01:09:48 +00:00
f803bc0a59 fix editor passing changes 2023-06-23 10:50:12 +10:00
be5925f40d margin below pagination 2023-06-23 10:20:50 +10:00
b25b697e7b disable payments 2023-06-23 10:12:13 +10:00
66e2a68cde added open_at for events 2023-06-23 09:54:52 +10:00
673f6051c1 disable cart icon 2023-06-23 09:48:09 +10:00
0478ab9eb2 fix incorrect select image control 2023-06-23 09:43:09 +10:00
b7fde520be add type=button to button elements 2023-06-23 08:44:44 +10:00
6f031f78e8 remove component 2023-06-23 08:40:45 +10:00
2f850ce152 remove last SMButton 2023-06-23 08:40:18 +10:00
dependabot[bot]
a6240a3ca9 Bump sass from 1.63.1 to 1.63.6
Bumps [sass](https://github.com/sass/dart-sass) from 1.63.1 to 1.63.6.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.63.1...1.63.6)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-22 21:57:27 +00:00
8906936e51 updates 2023-06-23 07:56:45 +10:00
fd6867740e fix preload 2023-06-22 21:46:13 +10:00
183231206b add loader 2023-06-22 17:42:04 +10:00
d4e832b526 show loader 2023-06-22 17:28:16 +10:00
667ff5cf94 rewrite 2023-06-22 17:16:22 +10:00
6d2db21a62 added api error callback with toast display 2023-06-12 13:13:38 +10:00
df398faddb fix permission check 2023-06-12 11:45:41 +10:00
e07e2d2e2c check item exists in object 2023-06-12 11:45:33 +10:00
ca29189f9e fix formatting 2023-06-12 11:45:20 +10:00
James Collins
15a1a3f666 Merge pull request #82 from STEMMechanics/dependabot/npm_and_yarn/eslint-plugin-jsdoc-46.2.6
Bump eslint-plugin-jsdoc from 46.2.4 to 46.2.6
2023-06-08 11:21:11 +10:00
James Collins
8c4c09bc90 Merge pull request #81 from STEMMechanics/dependabot/npm_and_yarn/sass-1.63.1
Bump sass from 1.62.1 to 1.63.1
2023-06-08 11:20:58 +10:00
James Collins
5a926d2d41 Merge pull request #79 from STEMMechanics/dependabot/composer/laravel/pint-1.10.1
Bump laravel/pint from 1.10.0 to 1.10.1
2023-06-08 11:20:42 +10:00
James Collins
5127d8b283 Merge pull request #77 from STEMMechanics/dependabot/npm_and_yarn/vitest-0.32.0
Bump vitest from 0.31.4 to 0.32.0
2023-06-08 11:20:28 +10:00
dependabot[bot]
c043a43fc5 Bump eslint-plugin-jsdoc from 46.2.4 to 46.2.6
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 46.2.4 to 46.2.6.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v46.2.4...v46.2.6)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-08 01:18:52 +00:00
dependabot[bot]
013930d7c3 Bump sass from 1.62.1 to 1.63.1
Bumps [sass](https://github.com/sass/dart-sass) from 1.62.1 to 1.63.1.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.62.1...1.63.1)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-08 01:18:20 +00:00
James Collins
6b0d66be25 Merge pull request #80 from STEMMechanics/dependabot/composer/mockery/mockery-1.6.2
Bump mockery/mockery from 1.6.1 to 1.6.2
2023-06-08 11:11:58 +10:00
dependabot[bot]
3b492d2005 Bump mockery/mockery from 1.6.1 to 1.6.2
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mockery/mockery/compare/1.6.1...1.6.2)

---
updated-dependencies:
- dependency-name: mockery/mockery
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-08 01:08:18 +00:00
dependabot[bot]
29f4bfd3cc Bump laravel/pint from 1.10.0 to 1.10.1
Bumps [laravel/pint](https://github.com/laravel/pint) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/laravel/pint/releases)
- [Changelog](https://github.com/laravel/pint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/laravel/pint/compare/v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: laravel/pint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-07 01:10:20 +00:00
dependabot[bot]
86e42c36cb Bump vitest from 0.31.4 to 0.32.0
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 0.31.4 to 0.32.0.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.32.0/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-07 01:08:47 +00:00
James Collins
c1d81c65d2 Merge pull request #74 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.59.9
Bump @typescript-eslint/eslint-plugin from 5.59.8 to 5.59.9
2023-06-06 11:08:00 +10:00
dependabot[bot]
fd864b03d9 Bump @typescript-eslint/eslint-plugin from 5.59.8 to 5.59.9
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.59.8 to 5.59.9.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.59.9/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-06 01:07:42 +00:00
James Collins
97eb51a434 Merge pull request #73 from STEMMechanics/dependabot/composer/mockery/mockery-1.6.1
Bump mockery/mockery from 1.6.0 to 1.6.1
2023-06-06 11:07:29 +10:00
James Collins
76f9b96369 Merge pull request #72 from STEMMechanics/dependabot/composer/laravel/framework-10.13.2
Bump laravel/framework from 10.13.1 to 10.13.2
2023-06-06 11:07:16 +10:00
James Collins
13e5cf2133 Merge pull request #75 from STEMMechanics/dependabot/npm_and_yarn/vite-plugin-compression2-0.9.2
Bump vite-plugin-compression2 from 0.9.1 to 0.9.2
2023-06-06 11:07:00 +10:00
James Collins
1c92f6449e Merge pull request #76 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/parser-5.59.9
Bump @typescript-eslint/parser from 5.59.8 to 5.59.9
2023-06-06 11:06:46 +10:00
dependabot[bot]
3ed6cc8d5c Bump @typescript-eslint/parser from 5.59.8 to 5.59.9
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.59.8 to 5.59.9.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.59.9/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-06 01:06:17 +00:00
dependabot[bot]
5b79e415e0 Bump vite-plugin-compression2 from 0.9.1 to 0.9.2
Bumps [vite-plugin-compression2](https://github.com/nonzzz/vite-compression-plugin) from 0.9.1 to 0.9.2.
- [Release notes](https://github.com/nonzzz/vite-compression-plugin/releases)
- [Changelog](https://github.com/nonzzz/vite-plugin-compression/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nonzzz/vite-compression-plugin/compare/v0.9.1...v0.9.2)

---
updated-dependencies:
- dependency-name: vite-plugin-compression2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-06 01:06:02 +00:00
dependabot[bot]
98036c7266 Bump mockery/mockery from 1.6.0 to 1.6.1
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/1.6.1/CHANGELOG.md)
- [Commits](https://github.com/mockery/mockery/compare/1.6.0...1.6.1)

---
updated-dependencies:
- dependency-name: mockery/mockery
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-06 01:05:46 +00:00
dependabot[bot]
8c8c59d8bd Bump laravel/framework from 10.13.1 to 10.13.2
Bumps [laravel/framework](https://github.com/laravel/framework) from 10.13.1 to 10.13.2.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/10.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/framework/compare/v10.13.1...v10.13.2)

---
updated-dependencies:
- dependency-name: laravel/framework
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-06 01:05:36 +00:00
fdbadbac7f added convertFileNameToTitle 2023-06-06 10:47:21 +10:00
9d788f919a show draft banner correctly 2023-06-05 20:15:45 +10:00
fac00bc4f6 support tbc, tbd 2023-06-05 19:55:47 +10:00
6e511fc4a9 support TBC/TBD 2023-06-05 19:53:11 +10:00
2f6214c48d convert dates from utc before parsing 2023-06-05 19:46:50 +10:00
b2f791fc5f remove debug 2023-06-05 19:09:51 +10:00
39140611ca fix combined filters and empty values 2023-06-05 19:09:36 +10:00
567ee3062b cleanup 2023-06-05 18:55:30 +10:00
584e0903c8 log exception and continue 2023-06-05 18:55:20 +10:00
8990006d4c remove s3 disk 2023-06-05 18:55:08 +10:00
7feb78ba70 dependency updates 2023-06-05 18:25:09 +10:00
d67ca133eb fix incorrect JsonResponse 2023-06-05 15:48:47 +10:00
f95557aa3a updated 2023-06-05 15:28:30 +10:00
f539ab7294 dependency updates 2023-06-05 15:05:45 +10:00
James Collins
79284e2271 Merge pull request #71 from STEMMechanics/dependabot/npm_and_yarn/vue-loader-17.2.2
Bump vue-loader from 17.1.1 to 17.2.2
2023-06-05 12:11:34 +10:00
James Collins
e303b565fc Merge pull request #62 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/parser-5.59.8
Bump @typescript-eslint/parser from 5.59.7 to 5.59.8
2023-06-05 12:11:16 +10:00
dependabot[bot]
985e8a5cd6 Bump vue-loader from 17.1.1 to 17.2.2
Bumps [vue-loader](https://github.com/vuejs/vue-loader) from 17.1.1 to 17.2.2.
- [Release notes](https://github.com/vuejs/vue-loader/releases)
- [Changelog](https://github.com/vuejs/vue-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vuejs/vue-loader/compare/v17.1.1...v17.2.2)

---
updated-dependencies:
- dependency-name: vue-loader
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 02:09:12 +00:00
dependabot[bot]
541e1c4c2c Bump @typescript-eslint/parser from 5.59.7 to 5.59.8
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.59.7 to 5.59.8.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.59.8/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 02:04:46 +00:00
James Collins
10c1d500f3 Merge pull request #67 from STEMMechanics/dependabot/composer/laravel/framework-10.13.1
Bump laravel/framework from 10.12.0 to 10.13.1
2023-06-05 12:00:19 +10:00
James Collins
678f16788c Merge pull request #68 from STEMMechanics/dependabot/composer/phpunit/phpunit-10.2.0
Bump phpunit/phpunit from 10.1.3 to 10.2.0
2023-06-05 12:00:02 +10:00
James Collins
8871a1b7ae Merge pull request #69 from STEMMechanics/dependabot/npm_and_yarn/eslint-plugin-jsdoc-46.2.4
Bump eslint-plugin-jsdoc from 45.0.0 to 46.2.4
2023-06-05 11:59:40 +10:00
James Collins
05c2f28f25 Merge pull request #70 from STEMMechanics/dependabot/composer/doctrine/dbal-3.6.3
Bump doctrine/dbal from 3.6.2 to 3.6.3
2023-06-05 11:59:26 +10:00
James Collins
30179fe353 Merge pull request #61 from STEMMechanics/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.59.8
Bump @typescript-eslint/eslint-plugin from 5.59.7 to 5.59.8
2023-06-05 11:58:46 +10:00
James Collins
6846dd760d Merge pull request #59 from STEMMechanics/dependabot/npm_and_yarn/vue-router-4.2.2
Bump vue-router from 4.2.1 to 4.2.2
2023-06-05 11:58:33 +10:00
dependabot[bot]
408f285cf3 Bump doctrine/dbal from 3.6.2 to 3.6.3
Bumps [doctrine/dbal](https://github.com/doctrine/dbal) from 3.6.2 to 3.6.3.
- [Release notes](https://github.com/doctrine/dbal/releases)
- [Commits](https://github.com/doctrine/dbal/compare/3.6.2...3.6.3)

---
updated-dependencies:
- dependency-name: doctrine/dbal
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 01:40:07 +00:00
dependabot[bot]
fa76fc0f78 Bump eslint-plugin-jsdoc from 45.0.0 to 46.2.4
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 45.0.0 to 46.2.4.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v45.0.0...v46.2.4)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 01:40:02 +00:00
dependabot[bot]
ade9cd6b05 Bump phpunit/phpunit from 10.1.3 to 10.2.0
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.1.3 to 10.2.0.
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.2.0/ChangeLog-10.2.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/10.1.3...10.2.0)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 01:40:01 +00:00
dependabot[bot]
933d18b784 Bump laravel/framework from 10.12.0 to 10.13.1
Bumps [laravel/framework](https://github.com/laravel/framework) from 10.12.0 to 10.13.1.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/10.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/framework/compare/v10.12.0...v10.13.1)

---
updated-dependencies:
- dependency-name: laravel/framework
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 01:39:55 +00:00
48bae3b181 remove debug 2023-06-03 18:40:22 +10:00
78f6ed1ef6 allow : in filter values 2023-06-03 18:38:12 +10:00
6d503939a5 temp filter fix 2023-06-03 08:39:12 +10:00
3677f1c45b fix upcoming events filter 2023-06-02 20:44:42 +10:00
dependabot[bot]
a23ce4e0e6 Bump @typescript-eslint/eslint-plugin from 5.59.7 to 5.59.8
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.59.7 to 5.59.8.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.59.8/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-30 01:07:19 +00:00
dependabot[bot]
e7c43fa53a Bump vue-router from 4.2.1 to 4.2.2
Bumps [vue-router](https://github.com/vuejs/router) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/vuejs/router/releases)
- [Commits](https://github.com/vuejs/router/compare/v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: vue-router
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-30 01:05:49 +00:00
James Collins
0de6735855 Merge pull request #58 from STEMMechanics/dependabot/npm_and_yarn/postcss-8.4.24
Bump postcss from 8.4.23 to 8.4.24
2023-05-29 12:20:49 +10:00
James Collins
aa274b1df4 Merge pull request #57 from STEMMechanics/dependabot/npm_and_yarn/eslint-plugin-jsdoc-45.0.0
Bump eslint-plugin-jsdoc from 44.2.7 to 45.0.0
2023-05-29 12:20:34 +10:00
dependabot[bot]
51261a4a5c Bump postcss from 8.4.23 to 8.4.24
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.23 to 8.4.24.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.23...8.4.24)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 01:44:28 +00:00
dependabot[bot]
9e92561502 Bump eslint-plugin-jsdoc from 44.2.7 to 45.0.0
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 44.2.7 to 45.0.0.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v44.2.7...v45.0.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 01:43:37 +00:00
2b28ebc014 dependency updates 2023-05-27 12:41:37 +10:00
196d9c358c Merge pull request #56 from STEMMechanics:dependabot/composer/spatie/laravel-ignition-2.1.3
Bump spatie/laravel-ignition from 2.1.2 to 2.1.3
2023-05-27 12:38:44 +10:00
dependabot[bot]
38d58d92b4 Bump spatie/laravel-ignition from 2.1.2 to 2.1.3
Bumps [spatie/laravel-ignition](https://github.com/spatie/laravel-ignition) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/spatie/laravel-ignition/releases)
- [Changelog](https://github.com/spatie/laravel-ignition/blob/main/CHANGELOG.md)
- [Commits](https://github.com/spatie/laravel-ignition/compare/2.1.2...2.1.3)

---
updated-dependencies:
- dependency-name: spatie/laravel-ignition
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-26 01:14:39 +00:00
e136c910b5 support analytics dashboard 2023-05-25 21:54:59 +10:00
d0c4f7eea2 allow updating ended_at 2023-05-25 21:54:46 +10:00
bf9b0f3973 update session ended_at on new requests 2023-05-25 21:54:37 +10:00
4534b46e97 added AA key for uppercase AM/PM 2023-05-25 21:27:36 +10:00
68affe4e4c update table field names 2023-05-25 20:04:53 +10:00
aa2671f167 reset server error on reload 2023-05-25 20:04:38 +10:00
2178b61602 updated analytics structure 2023-05-25 19:35:20 +10:00
6a6b8ed9b2 added rename macro to Request 2023-05-25 19:35:05 +10:00
784e8cf787 added unmangle request params 2023-05-25 19:34:40 +10:00
89a8b6926a update getVariantsAttribute return type 2023-05-25 12:21:23 +10:00
9c926d15c1 updated dependencies 2023-05-25 12:19:19 +10:00
James Collins
1b1144c628 Merge pull request #55 from STEMMechanics/dependabot/npm_and_yarn/vue-dompurify-html-4.1.4
Bump vue-dompurify-html from 3.1.2 to 4.1.4
2023-05-25 12:16:29 +10:00
James Collins
e9b1802af3 Merge pull request #54 from STEMMechanics/dependabot/npm_and_yarn/vuepic/vue-datepicker-5.1.2
Bump @vuepic/vue-datepicker from 3.6.8 to 5.1.2
2023-05-25 12:16:16 +10:00
James Collins
fe7c1d93ae Merge pull request #53 from STEMMechanics/dependabot/npm_and_yarn/vitest-0.31.1
Bump vitest from 0.28.5 to 0.31.1
2023-05-25 12:09:09 +10:00
James Collins
8d1be827a7 Merge pull request #52 from STEMMechanics/dependabot/npm_and_yarn/typescript-5.0.4
Bump typescript from 4.9.5 to 5.0.4
2023-05-25 12:08:43 +10:00
dependabot[bot]
cd4fe13117 Bump vue-dompurify-html from 3.1.2 to 4.1.4
Bumps [vue-dompurify-html](https://github.com/LeSuisse/vue-dompurify-html/tree/HEAD/packages/vue-dompurify-html) from 3.1.2 to 4.1.4.
- [Release notes](https://github.com/LeSuisse/vue-dompurify-html/releases)
- [Commits](https://github.com/LeSuisse/vue-dompurify-html/commits/v4.1.4/packages/vue-dompurify-html)

---
updated-dependencies:
- dependency-name: vue-dompurify-html
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 01:08:06 +00:00
dependabot[bot]
34e169adba Bump @vuepic/vue-datepicker from 3.6.8 to 5.1.2
Bumps [@vuepic/vue-datepicker](https://github.com/Vuepic/vue-datepicker) from 3.6.8 to 5.1.2.
- [Release notes](https://github.com/Vuepic/vue-datepicker/releases)
- [Commits](https://github.com/Vuepic/vue-datepicker/compare/v3.6.8...v5.1.2)

---
updated-dependencies:
- dependency-name: "@vuepic/vue-datepicker"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 01:07:58 +00:00
dependabot[bot]
d064756cc6 Bump vitest from 0.28.5 to 0.31.1
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 0.28.5 to 0.31.1.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.31.1/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 01:07:35 +00:00
dependabot[bot]
bf7e1658f4 Bump typescript from 4.9.5 to 5.0.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.9.5 to 5.0.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.9.5...v5.0.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 01:07:21 +00:00
8de3c5dcba added .phpunit.result.cache 2023-05-25 08:20:19 +10:00
e8827cbd50 fix hinting and tests for L10 and PHP8 2023-05-25 08:18:51 +10:00
f839003f5e dependency updates 2023-05-25 07:54:35 +10:00
b68d97455b remove gunk 2023-05-25 07:54:35 +10:00
James Collins
e9dcb8b3f0 Merge pull request #51 from STEMMechanics/shift-91888
PHPUnit 10 Shift
2023-05-25 07:53:54 +10:00
293 changed files with 50972 additions and 40784 deletions

View File

@@ -11,7 +11,7 @@ jobs:
steps: steps:
- uses: shivammathur/setup-php@v2 - uses: shivammathur/setup-php@v2
with: with:
php-version: "8.1" php-version: "8.2"
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Copy .env - name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');" run: php -r "file_exists('.env') || copy('.env.example', '.env');"

15
.gitignore vendored
View File

@@ -237,11 +237,22 @@ dist/
### This Project ### ### This Project ###
/public/uploads /public/uploads
/public/build /public/build
# /public/tinymce
*.key *.key
### TinyMCE ###
/public/tinymce
!/public/tinymce/skins/ui/stemmech/
### Synk ### ### Synk ###
.dccache .dccache
### TempCodeRunner ### ### TempCodeRunner ###
tempCodeRunnerFile.* tempCodeRunnerFile.*
### PHPUnit ###
.phpunit.result.cache
.gitignore
### Codesniffer ###
phpcs.phar
phpcbf.phar

14
.ls-lint.yml Normal file
View File

@@ -0,0 +1,14 @@
ls:
resources/js/store:
.ts: pascalcase
"*":
.js: camelcase
.ts: camelcase
.vue: pascalcase
.dir: snakecase
.type.ts: camelcase
ignore:
- node_modules
- vendor
- public/build
- public/tinymce

View File

@@ -1,4 +1,5 @@
{ {
"bracketSameLine": true, "bracketSameLine": true,
"tabWidth": 4 "tabWidth": 4,
"htmlWhitespaceSensitivity": "css"
} }

View File

@@ -2,8 +2,7 @@
"editor.formatOnType": true, "editor.formatOnType": true,
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true "source.fixAll.eslint": "explicit"
// "source.organizeImports": true // <-- when enabled, breaks tinymce required import order
}, },
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode",
"[vue]": { "[vue]": {

23355
_ide_helper.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,16 +2,7 @@
namespace App\Conductors; namespace App\Conductors;
use App\Models\Media;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\InvalidCastException;
use Illuminate\Database\Eloquent\MissingAttributeException;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use LogicException;
class AnalyticsConductor extends Conductor class AnalyticsConductor extends Conductor
{ {
@@ -19,20 +10,14 @@ class AnalyticsConductor extends Conductor
* The Model Class * The Model Class
* @var string * @var string
*/ */
protected $class = \App\Models\Analytics::class; protected $class = \App\Models\AnalyticsSession::class;
/**
* The default sorting field
* @var string
*/
protected $sort = 'created_at';
/** /**
* The default includes to include in a request. * The default includes to include in a request.
* *
* @var array * @var array
*/ */
protected $includes = ['duration']; protected $includes = ['requests.type','requests.path'];
/** /**
@@ -43,6 +28,7 @@ class AnalyticsConductor extends Conductor
*/ */
public static function viewable(Model $model): bool public static function viewable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/analytics') === true); return ($user !== null && $user->hasPermission('admin/analytics') === true);
} }
@@ -65,6 +51,7 @@ class AnalyticsConductor extends Conductor
*/ */
public static function updatable(Model $model): bool public static function updatable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/analytics') === true); return ($user !== null && $user->hasPermission('admin/analytics') === true);
} }
@@ -77,6 +64,7 @@ class AnalyticsConductor extends Conductor
*/ */
public static function destroyable(Model $model): bool public static function destroyable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/analytics') === true); return ($user !== null && $user->hasPermission('admin/analytics') === true);
} }

View File

@@ -11,6 +11,7 @@ use Illuminate\Database\Eloquent\InvalidCastException;
use Illuminate\Database\Eloquent\MissingAttributeException; use Illuminate\Database\Eloquent\MissingAttributeException;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use LogicException; use LogicException;
class ArticleConductor extends Conductor class ArticleConductor extends Conductor
@@ -32,16 +33,18 @@ class ArticleConductor extends Conductor
* *
* @var string[] * @var string[]
*/ */
protected $includes = ['attachments', 'user']; protected $includes = ['attachments', 'user', 'gallery'];
/** /**
* Run a scope query on the collection before anything else. * Run a scope query on the collection before anything else.
* *
* @param Builder $builder The builder in use. * @param Builder $builder The builder in use.
* @return void
*/ */
public function scope(Builder $builder): void public function scope(Builder $builder): void
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
if ($user === null || $user->hasPermission('admin/articles') === false) { if ($user === null || $user->hasPermission('admin/articles') === false) {
$builder $builder
@@ -58,6 +61,7 @@ class ArticleConductor extends Conductor
public static function viewable(Model $model): bool public static function viewable(Model $model): bool
{ {
if (Carbon::parse($model->publish_at)->isFuture() === true) { if (Carbon::parse($model->publish_at)->isFuture() === true) {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
if ($user === null || $user->hasPermission('admin/articles') === false) { if ($user === null || $user->hasPermission('admin/articles') === false) {
return false; return false;
@@ -74,6 +78,7 @@ class ArticleConductor extends Conductor
*/ */
public static function creatable(): bool public static function creatable(): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/articles') === true); return ($user !== null && $user->hasPermission('admin/articles') === true);
} }
@@ -86,6 +91,7 @@ class ArticleConductor extends Conductor
*/ */
public static function updatable(Model $model): bool public static function updatable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/articles') === true); return ($user !== null && $user->hasPermission('admin/articles') === true);
} }
@@ -98,6 +104,7 @@ class ArticleConductor extends Conductor
*/ */
public static function destroyable(Model $model): bool public static function destroyable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/articles') === true); return ($user !== null && $user->hasPermission('admin/articles') === true);
} }
@@ -122,11 +129,24 @@ class ArticleConductor extends Conductor
*/ */
public function includeAttachments(Model $model) public function includeAttachments(Model $model)
{ {
return $model->attachments()->get()->map(function ($attachment) { return $model->getAttachments()->map(function ($attachment) {
return MediaConductor::includeModel(request(), 'attachments', $attachment->media); return MediaConductor::includeModel(request(), 'attachments', $attachment->media);
}); });
} }
/**
* Include Gallery Field.
*
* @param Model $model Them model.
* @return mixed The model result.
*/
public function includeGallery(Model $model)
{
return $model->getGallery()->map(function ($item) {
return MediaConductor::includeModel(request(), 'gallery', $item->media);
});
}
/** /**
* Include User Field. * Include User Field.
* *
@@ -135,17 +155,27 @@ class ArticleConductor extends Conductor
*/ */
public function includeUser(Model $model) public function includeUser(Model $model)
{ {
return UserConductor::includeModel(request(), 'user', User::find($model['user_id'])); $cacheKey = "user:{$model['user_id']}";
$user = Cache::remember($cacheKey, now()->addDays(28), function () use ($model) {
return User::find($model['user_id']);
});
return UserConductor::includeModel(request(), 'user', $user);
} }
/** /**
* Transform the Hero field. * Transform the Hero field.
* *
* @param mixed $value The current value. * @param mixed $value The current value.
* @return array The new value. * @return array|null The new value.
*/ */
public function transformHero(mixed $value): array public function transformHero(mixed $value): array|null
{ {
return MediaConductor::includeModel(request(), 'hero', Media::find($value)); $cacheKey = "media:{$value}";
$media = Cache::remember($cacheKey, now()->addDays(28), function () use ($value) {
return Media::find($value);
});
return MediaConductor::includeModel(request(), 'hero', $media);
} }
} }

View File

@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Str; use Illuminate\Support\Str;
class Conductor class Conductor
@@ -143,6 +143,7 @@ class Conductor
* *
* @param Request $request The user request. * @param Request $request The user request.
* @param array|null $limitFields A list of fields to limit the filter request to. * @param array|null $limitFields A list of fields to limit the filter request to.
* @return void
*/ */
private function filter(Request $request, array|null $limitFields = null): void private function filter(Request $request, array|null $limitFields = null): void
{ {
@@ -163,14 +164,18 @@ class Conductor
) { ) {
$value = trim($value); $value = trim($value);
$operator = ''; $operator = '';
$join = 'OR'; $join = 'AND';
// Check if value has a operator and remove it if it's a number // Check if value has a operator and remove it if it's a number
if (preg_match('/^(!?=|[<>]=?|<>|!)([^=!<>].*)*$/', $value, $matches) > 0) { if (preg_match('/^(!?=|[<>]=?|<>|!|\|)([^=!<>].*)*$/', $value, $matches) > 0) {
$operator = $matches[1]; $operator = $matches[1];
$value = ($matches[2] ?? ''); $value = ($matches[2] ?? '');
} }
if (strlen($value) === 0 && ($operator !== '==' && $operator !== '!=')) {
continue;
}
switch ($operator) { switch ($operator) {
case '=': case '=':
$operator = '=='; $operator = '==';
@@ -181,15 +186,23 @@ class Conductor
break; break;
case '>': case '>':
case '<': case '<':
case '|':
$separatorPos = strpos($value, '|');
if ($separatorPos !== false) {
$operator = '==';
$valueList = explode('|', $value);
foreach ($valueList as $valueItem) {
$this->appendFilter($field, $operator, $valueItem, 'OR');
}
continue 2;
}
break;
case '>=': case '>=':
case '<=': case '<=':
case '!=': case '!=':
break; break;
case '<>': case '<>':
$separatorPos = strpos($value, '|'); $operator = '!=';
if ($separatorPos === false) {
$operator = '!=';
}
break; break;
default: default:
$operator = 'LIKE'; $operator = 'LIKE';
@@ -209,6 +222,8 @@ class Conductor
/** /**
* Apple the filter array to the collection. * Apple the filter array to the collection.
*
* @return void
*/ */
final public function applyFilters(): void final public function applyFilters(): void
{ {
@@ -217,6 +232,40 @@ class Conductor
$result = null; $result = null;
$join = 'AND'; $join = 'AND';
$relationFilter = [];
$buildWhereFunc = function ($query, $field, $operator, $value, $join) {
if ($join === 'OR') {
if ($operator === '<>') {
$separatorPos = strpos($value, '|');
if ($separatorPos !== false) {
$query->orWhereBetween(
$field,
[substr($value, 0, $separatorPos), substr($value, ($separatorPos + 1))]
);
} else {
$query->orWhere($field, '!=', $value);
}
} else {
$query->orWhere($field, $operator, $value);
}
} else {
if ($operator === '<>') {
$separatorPos = strpos($value, '|');
if ($separatorPos !== false) {
$query->whereBetween(
$field,
[substr($value, 0, $separatorPos), substr($value, ($separatorPos + 1))]
);
} else {
$query->where($field, '!=', $value);
}
} else {
$query->where($field, $operator, $value);
}
}//end if
};
if (gettype($query) === 'array') { if (gettype($query) === 'array') {
$item = $query; $item = $query;
} }
@@ -240,81 +289,72 @@ class Conductor
} }
} }
} else { } else {
list($field, $operator, $value) = $condition; if (count($condition) < 3 && $condition[0] !== '') {
if (count($condition) < 2) {
if ($item !== null) { $condition[1] = 'LIKE';
if (array_key_exists($field, $item) === true) {
switch ($operator) {
case '==':
$currentResult = ($item[$field] == $value);
break;
case 'NOT LIKE':
$currentResult = (stripos($item[$field], substr($value, 1, -1)) === false);
break;
case '>':
$currentResult = ($item[$field] > $value);
break;
case '<':
$currentResult = ($item[$field] < $value);
break;
case '>=':
$currentResult = ($item[$field] >= $value);
break;
case '<=':
$currentResult = ($item[$field] <= $value);
break;
case '!=':
$currentResult = ($item[$field] != $value);
break;
case '<>':
$separatorPos = strpos($value, '|');
if ($separatorPos !== false) {
$fieldInt = intval($item[$field]);
$currentResult = (
$fieldInt > intVal(
substr($value, 0, $separatorPos)
) && $fieldInt < intVal(substr($value, ($separatorPos + 1))));
} else {
$currentResult = ($item[$field] != $value);
}
break;
case 'LIKE':
$currentResult = (stripos($item[$field], substr($value, 1, -1)) !== false);
break;
}//end switch
}//end if
} else {
if ($operator === '==') {
$operator = '=';
} }
$condition[2] = '%';
}
if ($join === 'OR') { if (count($condition) === 3) {
if ($operator === '<>') { list($field, $operator, $value) = $condition;
$separatorPos = strpos($value, '|');
if ($separatorPos !== false) { if ($item !== null) {
$query->orWhereBetween( if (array_key_exists($field, $item) === true) {
$field, switch ($operator) {
[substr($value, 0, $separatorPos), substr($value, ($separatorPos + 1))] case '==':
); $currentResult = ($item[$field] == $value);
} else { break;
$query->orWhere($field, '!=', $value); case 'NOT LIKE':
} $currentResult = (stripos($item[$field], substr($value, 1, -1)) === false);
} else { break;
$query->orWhere($field, $operator, $value); case '>':
} $currentResult = ($item[$field] > $value);
break;
case '<':
$currentResult = ($item[$field] < $value);
break;
case '>=':
$currentResult = ($item[$field] >= $value);
break;
case '<=':
$currentResult = ($item[$field] <= $value);
break;
case '!=':
$currentResult = ($item[$field] != $value);
break;
case '<>':
$separatorPos = strpos($value, '|');
if ($separatorPos !== false) {
$fieldInt = intval($item[$field]);
$currentResult = (
$fieldInt > intVal(
substr($value, 0, $separatorPos)
) && $fieldInt < intVal(substr($value, ($separatorPos + 1))));
} else {
$currentResult = ($item[$field] != $value);
}
break;
case 'LIKE':
$currentResult = (stripos($item[$field], substr($value, 1, -1)) !== false);
break;
}//end switch
}//end if
} else { } else {
if ($operator === '<>') { if ($operator === '==') {
$separatorPos = strpos($value, '|'); $operator = '=';
if ($separatorPos !== false) { }
$query->whereBetween(
$field, $relationSplit = strpos($field, '.');
[substr($value, 0, $separatorPos), substr($value, ($separatorPos + 1))] if ($relationSplit !== false) {
); $relation = substr($field, 0, $relationSplit);
} else { $field = substr($field, ($relationSplit + 1));
$query->where($field, '!=', $value);
if (method_exists($this->class, $relation) === true) {
$relationFilter[$relation][] = [$field, $operator, $value, $join];
} }
} else { } else {
$query->where($field, $operator, $value); $buildWhereFunc($query, $field, $operator, $value, $join);
} }
}//end if }//end if
}//end if }//end if
@@ -338,6 +378,14 @@ class Conductor
}//end if }//end if
}//end foreach }//end foreach
foreach ($relationFilter as $relation => $conditions) {
$query->whereHas($relation, function ($subQuery) use ($buildWhereFunc, $conditions) {
foreach ($conditions as $condition) {
$buildWhereFunc($subQuery, $condition[0], $condition[1], $condition[2], $condition[3]);
}
});
}
return $result; return $result;
}; };
@@ -415,7 +463,7 @@ class Conductor
return substr($field, 0, strpos($field, '.')); return substr($field, 0, strpos($field, '.'));
} }
return $field; return $field;
}, explode(',', $request->input('fields'))); }, explode(',', $request->input('fields', '')));
if ($limitFields === null) { if ($limitFields === null) {
$limitFields = $fields; $limitFields = $fields;
} else { } else {
@@ -500,6 +548,7 @@ class Conductor
* @param Builder $query The custom query. * @param Builder $query The custom query.
* @param Request $request The request. * @param Request $request The request.
* @param array|null $limitFields Limit the request to these fields. * @param array|null $limitFields Limit the request to these fields.
* @return Builder
*/ */
public static function filterQuery(Builder $query, Request $request, array|null $limitFields = null): Builder public static function filterQuery(Builder $query, Request $request, array|null $limitFields = null): Builder
{ {
@@ -519,9 +568,9 @@ class Conductor
* @param Request $request The request data. * @param Request $request The request data.
* @param string $key The key prefix to use. * @param string $key The key prefix to use.
* @param Model|null $model The model. * @param Model|null $model The model.
* @return array The processed and transformed model data. * @return array|null The processed and transformed model data.
*/ */
final public static function includeModel(Request $request, string $key, mixed $model): array final public static function includeModel(Request $request, string $key, mixed $model): array|null
{ {
$fields = []; $fields = [];
@@ -547,9 +596,9 @@ class Conductor
* *
* @param mixed $fields The fields to show. * @param mixed $fields The fields to show.
* @param Model|null $model The model. * @param Model|null $model The model.
* @return array The processed and transformed model data. * @return array|null The processed and transformed model data.
*/ */
final public static function model(mixed $fields, mixed $model): array final public static function model(mixed $fields, mixed $model): array|null
{ {
if ($model === null) { if ($model === null) {
return null; return null;
@@ -558,6 +607,7 @@ class Conductor
$conductor_class = get_called_class(); $conductor_class = get_called_class();
$conductor = new $conductor_class(); $conductor = new $conductor_class();
$requestIncludes = [];
$modelFields = $conductor->fields(new $conductor->class()); $modelFields = $conductor->fields(new $conductor->class());
// Limit fields // Limit fields
@@ -615,6 +665,7 @@ class Conductor
* Sort the conductor collection. * Sort the conductor collection.
* *
* @param mixed $fields A field name or array of field names to sort. Supports prefix of +/- to change direction. * @param mixed $fields A field name or array of field names to sort. Supports prefix of +/- to change direction.
* @return void
*/ */
final public function sort(mixed $fields = null): void final public function sort(mixed $fields = null): void
{ {
@@ -693,6 +744,7 @@ class Conductor
* *
* @param Model $model The model to append. * @param Model $model The model to append.
* @param array $includes The list of includes to include. * @param array $includes The list of includes to include.
* @return void
*/ */
final public function applyIncludes(Model $model, array $includes): void final public function applyIncludes(Model $model, array $includes): void
{ {
@@ -712,6 +764,7 @@ class Conductor
* Limit the returned fields in the conductor collection. * Limit the returned fields in the conductor collection.
* *
* @param array $fields An array of field names. * @param array $fields An array of field names.
* @return void
*/ */
final public function limitFields(array $fields): void final public function limitFields(array $fields): void
{ {
@@ -726,9 +779,13 @@ class Conductor
* @param string $rawFilter The raw filter string to parse. * @param string $rawFilter The raw filter string to parse.
* @param array|null $limitFields The fields to allow in the filter string. * @param array|null $limitFields The fields to allow in the filter string.
* @param string $outerJoin The join for this filter group. * @param string $outerJoin The join for this filter group.
* @return void
*/ */
final public function appendFilterString(string $rawFilter, array|null $limitFields = null, string $outerJoin = 'OR'): void final public function appendFilterString(
{ string $rawFilter,
array|null $limitFields = null,
string $outerJoin = 'AND'
): void {
if ($rawFilter === '') { if ($rawFilter === '') {
return; return;
} }
@@ -765,8 +822,10 @@ class Conductor
$field = substr($field, 1, -1); $field = substr($field, 1, -1);
} }
$set = &$value; if ($set !== $value) {
continue; $set = &$value;
continue;
}
} elseif (($char === ')' && $string[($i + 1)] === ',') || $char === ',') { } elseif (($char === ')' && $string[($i + 1)] === ',') || $char === ',') {
if ($value === null) { if ($value === null) {
$tokens[] = $field; $tokens[] = $field;
@@ -839,6 +898,7 @@ class Conductor
* @param string $operator The operator to append. * @param string $operator The operator to append.
* @param string $value The value to append. * @param string $value The value to append.
* @param string $join The join to append. * @param string $join The join to append.
* @return void
*/ */
final public function appendFilter(string $field, string $operator, string $value, string $join = 'OR'): void final public function appendFilter(string $field, string $operator, string $value, string $join = 'OR'): void
{ {
@@ -852,9 +912,11 @@ class Conductor
* Run a scope query on the collection before anything else. * Run a scope query on the collection before anything else.
* *
* @param Builder $builder The builder in use. * @param Builder $builder The builder in use.
* @return void
*/ */
public function scope(Builder $builder): void public function scope(Builder $builder): void
{ {
// empty
} }
/** /**
@@ -865,12 +927,26 @@ class Conductor
*/ */
public function fields(Model $model): array public function fields(Model $model): array
{ {
$visibleFields = $model->getVisible(); $visibleFields = Cache::remember(
if (empty($visibleFields) === true) { "model:{$model->getTable()}:visible",
$visibleFields = $model->getConnection() now()->addDays(28),
->getSchemaBuilder() function () use ($model) {
->getColumnListing($model->getTable()); $fields = $model->getVisible();
} if (empty($fields) === true) {
$fields = Cache::remember(
"schema:{$model->getTable()}:columns",
now()->addDays(28),
function () use ($model) {
return $model->getConnection()
->getSchemaBuilder()
->getColumnListing($model->getTable());
}
);
}
return $fields;
}
);
$appends = $model->getAppends(); $appends = $model->getAppends();
if (is_array($appends) === true) { if (is_array($appends) === true) {

View File

@@ -7,6 +7,7 @@ use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\InvalidCastException; use Illuminate\Database\Eloquent\InvalidCastException;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
class EventConductor extends Conductor class EventConductor extends Conductor
{ {
@@ -33,9 +34,11 @@ class EventConductor extends Conductor
* Run a scope query on the collection before anything else. * Run a scope query on the collection before anything else.
* *
* @param Builder $builder The builder in use. * @param Builder $builder The builder in use.
* @return void
*/ */
public function scope(Builder $builder): void public function scope(Builder $builder): void
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
if ($user === null || $user->hasPermission('admin/events') === false) { if ($user === null || $user->hasPermission('admin/events') === false) {
$builder $builder
@@ -53,6 +56,7 @@ class EventConductor extends Conductor
public static function viewable(Model $model): bool public static function viewable(Model $model): bool
{ {
if (strtolower($model->status) === 'draft' || Carbon::parse($model->publish_at)->isFuture() === true) { if (strtolower($model->status) === 'draft' || Carbon::parse($model->publish_at)->isFuture() === true) {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
if ($user === null || $user->hasPermission('admin/events') === false) { if ($user === null || $user->hasPermission('admin/events') === false) {
return false; return false;
@@ -69,6 +73,7 @@ class EventConductor extends Conductor
*/ */
public static function creatable(): bool public static function creatable(): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/events') === true); return ($user !== null && $user->hasPermission('admin/events') === true);
} }
@@ -81,6 +86,7 @@ class EventConductor extends Conductor
*/ */
public static function updatable(Model $model): bool public static function updatable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/events') === true); return ($user !== null && $user->hasPermission('admin/events') === true);
} }
@@ -93,6 +99,7 @@ class EventConductor extends Conductor
*/ */
public static function destroyable(Model $model): bool public static function destroyable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/events') === true); return ($user !== null && $user->hasPermission('admin/events') === true);
} }
@@ -105,10 +112,11 @@ class EventConductor extends Conductor
*/ */
public function includeAttachments(Model $model) public function includeAttachments(Model $model)
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return $model->attachments()->get()->map(function ($attachment) use ($user) { return $model->getAttachments()->map(function ($attachment) use ($user) {
if ($attachment->private === false || ($user !== null && ($user->hasPermission('admin/events') === true || $attachment->users->contains($user) === true))) { if ($attachment->private === false || ($user !== null && $user->hasPermission('admin/events') === true)) {
return MediaConductor::includeModel(request(), 'attachments', $attachment->media); return MediaConductor::includeModel(request(), 'attachments', $attachment->media);
} }
}); });
@@ -118,10 +126,15 @@ class EventConductor extends Conductor
* Transform the Hero field. * Transform the Hero field.
* *
* @param mixed $value The current value. * @param mixed $value The current value.
* @return array The new value. * @return array|null The new value.
*/ */
public function transformHero(mixed $value): array public function transformHero(mixed $value): array|null
{ {
return MediaConductor::includeModel(request(), 'hero', Media::find($value)); $cacheKey = "media:{$value}";
$media = Cache::remember($cacheKey, now()->addDays(28), function () use ($value) {
return Media::find($value);
});
return MediaConductor::includeModel(request(), 'hero', $media);
} }
} }

View File

@@ -2,9 +2,11 @@
namespace App\Conductors; namespace App\Conductors;
use App\Models\MediaJob;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User; use Illuminate\Support\Facades\Cache;
class MediaConductor extends Conductor class MediaConductor extends Conductor
{ {
@@ -25,16 +27,16 @@ class MediaConductor extends Conductor
* *
* @var string[] * @var string[]
*/ */
protected $includes = ['user']; protected $includes = ['user', 'jobs'];
/** /**
* The default filters to use in a request. * The default filters to use in a request.
* *
* @var array * @var array
*/ */
protected $defaultFilters = [ // protected $defaultFilters = [
'status' => 'OK' // 'status' => 'OK'
]; // ];
/** /**
@@ -47,9 +49,10 @@ class MediaConductor extends Conductor
{ {
$fields = parent::fields($model); $fields = parent::fields($model);
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
if ($user === null || $user->hasPermission('admin/media') === false) { if ($user === null || $user->hasPermission('admin/media') === false) {
$fields = arrayRemoveItem($fields, ['permission', 'storage']); $fields = arrayRemoveItem($fields, ['security_data', 'storage']);
} }
return $fields; return $fields;
@@ -59,14 +62,23 @@ class MediaConductor extends Conductor
* Run a scope query on the collection before anything else. * Run a scope query on the collection before anything else.
* *
* @param Builder $builder The builder in use. * @param Builder $builder The builder in use.
* @return void
*/ */
public function scope(Builder $builder): void public function scope(Builder $builder): void
{ {
$user = auth()->user(); $user = auth()->user();
if ($user === null) { if ($user === null) {
$builder->where('permission', ''); $builder->where('security_type', '')
->orWhere('security_type', 'password');
} else { } else {
$builder->where('permission', '')->orWhereIn('permission', $user->permissions); $builder->where(function ($query) use ($user) {
$query->where('security_type', '')
->orWhere('security_type', 'password')
->orWhere(function ($subquery) use ($user) {
$subquery->where('security_type', 'permission')
->whereIn('security_data', $user->permissions);
});
});
} }
} }
@@ -78,11 +90,14 @@ class MediaConductor extends Conductor
*/ */
public static function viewable(Model $model): bool public static function viewable(Model $model): bool
{ {
if ($model->permission !== '') { if (strcasecmp('permission', $model->security_type) === 0) {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
if ($user === null || $user->hasPermission($model->permission) === false) { if ($user === null || $user->hasPermission($model->security_data) === false) {
return false; return false;
} }
} elseif ($model->security_type !== '' && strcasecmp('password', $model->security_type) !== 0) {
return false;
} }
return true; return true;
@@ -107,8 +122,10 @@ class MediaConductor extends Conductor
*/ */
public static function updatable(Model $model): bool public static function updatable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && (strcasecmp($model->user_id, $user->id) === 0 || $user->hasPermission('admin/media') === true)); return ($user !== null && (strcasecmp($model->user_id, $user->id) === 0 ||
$user->hasPermission('admin/media') === true));
} }
/** /**
@@ -119,6 +136,7 @@ class MediaConductor extends Conductor
*/ */
public static function destroyable(Model $model): bool public static function destroyable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && ($model->user_id === $user->id || $user->hasPermission('admin/media') === true)); return ($user !== null && ($model->user_id === $user->id || $user->hasPermission('admin/media') === true));
} }
@@ -143,6 +161,24 @@ class MediaConductor extends Conductor
*/ */
public function includeUser(Model $model) public function includeUser(Model $model)
{ {
return UserConductor::includeModel(request(), 'user', User::find($model['user_id'])); $user = Cache::remember("user:{$model['user_id']}", now()->addDays(28), function () use ($model) {
return User::find($model['user_id']);
});
return UserConductor::includeModel(request(), 'user', $user);
}
/**
* Include job models in Media
*
* @param Model $model The reference model.
* @return mixed
*/
public function includeJobs(Model $model)
{
$jobs = $model->jobs()
->select(['id','created_at','updated_at','user_id','status','status_text','progress'])
->orderBy('created_at', 'desc')->get();
return $jobs;
} }
} }

View File

@@ -0,0 +1,76 @@
<?php
namespace App\Conductors;
use App\Models\MediaJob;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
class MediaJobConductor extends Conductor
{
/**
* The Model Class
* @var string
*/
protected $class = \App\Models\MediaJob::class;
/**
* The default sorting field
* @var string
*/
protected $sort = 'created_at';
/**
* The included fields
*
* @var string[]
*/
protected $includes = ['user'];
/**
* Return if the current model is creatable.
*
* @return boolean Allow creating model.
*/
public static function creatable(): bool
{
return false;
}
/**
* Return if the current model is updatable.
*
* @param Model $model The model.
* @return boolean Allow updating model.
*/
public static function updatable(Model $model): bool
{
return false;
}
/**
* Return if the current model is destroyable.
*
* @param Model $model The model.
* @return boolean Allow deleting model.
*/
public static function destroyable(Model $model): bool
{
return false;
}
/**
* Transform the final model data
*
* @param array $data The model data to transform.
* @return array The transformed model.
*/
public function transformFinal(array $data): array
{
unset($data['user_id']);
return $data;
}
}

View File

@@ -2,9 +2,7 @@
namespace App\Conductors; namespace App\Conductors;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User;
class ShortlinkConductor extends Conductor class ShortlinkConductor extends Conductor
{ {
@@ -28,6 +26,7 @@ class ShortlinkConductor extends Conductor
*/ */
public static function creatable(): bool public static function creatable(): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/shortlinks') === true); return ($user !== null && $user->hasPermission('admin/shortlinks') === true);
} }
@@ -40,6 +39,7 @@ class ShortlinkConductor extends Conductor
*/ */
public static function updatable(Model $model): bool public static function updatable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/shortlinks') === true); return ($user !== null && $user->hasPermission('admin/shortlinks') === true);
} }
@@ -52,6 +52,7 @@ class ShortlinkConductor extends Conductor
*/ */
public static function destroyable(Model $model): bool public static function destroyable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/shortlinks') === true); return ($user !== null && $user->hasPermission('admin/shortlinks') === true);
} }

View File

@@ -21,8 +21,12 @@ class SubscriptionConductor extends Conductor
*/ */
public static function updatable(Model $model): bool public static function updatable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && ((strcasecmp($model->email, $user->email) === 0 && $user->email_verified_at !== null) || $user->hasPermission('admin/subscriptions') === true)); return ($user !== null && (
(strcasecmp($model->email, $user->email) === 0 && $user->email_verified_at !== null) ||
$user->hasPermission('admin/subscriptions') === true
));
} }
/** /**
@@ -33,7 +37,9 @@ class SubscriptionConductor extends Conductor
*/ */
public static function destroyable(Model $model): bool public static function destroyable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && ((strcasecmp($model->email, $user->email) === 0 && $user->email_verified_at !== null) || $user->hasPermission('admin/subscriptions') === true)); return ($user !== null && ((strcasecmp($model->email, $user->email) === 0 &&
$user->email_verified_at !== null) || $user->hasPermission('admin/subscriptions') === true));
} }
} }

View File

@@ -21,6 +21,7 @@ class UserConductor extends Conductor
*/ */
public function fields(Model $model): array public function fields(Model $model): array
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
if ($user === null || $user->hasPermission('admin/users') === false) { if ($user === null || $user->hasPermission('admin/users') === false) {
return ['id', 'display_name']; return ['id', 'display_name'];
@@ -37,16 +38,22 @@ class UserConductor extends Conductor
*/ */
public function transform(Model $model): array public function transform(Model $model): array
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
$data = $model->toArray(); $data = $model->toArray();
$limit = $this->fields($model);
if ($user === null || ($user->hasPermission('admin/users') === false && strcasecmp($user->id, $model->id) !== 0)) { if (
$fields = ['id', 'display_name']; $user === null || (
$data = arrayLimitKeys($data, $fields); $user->hasPermission('admin/users') === false && strcasecmp($user->id, $model->id) !== 0
)
) {
$limit = ['id', 'display_name'];
} else { } else {
$data['permissions'] = $user->permissions; $data['permissions'] = $user->permissions;
} }
$data = arrayLimitKeys($data, $limit);
return $data; return $data;
} }
@@ -58,6 +65,7 @@ class UserConductor extends Conductor
*/ */
public static function updatable(Model $model): bool public static function updatable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
if ($user !== null) { if ($user !== null) {
return ($user->hasPermission('admin/users') === true || strcasecmp($user->id, $model->id) === 0); return ($user->hasPermission('admin/users') === true || strcasecmp($user->id, $model->id) === 0);
@@ -74,6 +82,7 @@ class UserConductor extends Conductor
*/ */
public static function destroyable(Model $model): bool public static function destroyable(Model $model): bool
{ {
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
return ($user !== null && $user->hasPermission('admin/users') === true); return ($user !== null && $user->hasPermission('admin/users') === true);
} }

View File

@@ -0,0 +1,46 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
class CleanupTempFiles extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:cleanup-temp-files';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Delete temporary files that are older that 1 day';
/**
* Execute the console command.
*
* @return void
*/
public function handle(): void
{
$keepTime = (1 * 24 * 60 * 60); // 1 Day
$currentTimeStamp = time();
$deletedFileCount = 0;
foreach (glob(storage_path('app/tmp/*')) as $filename) {
$fileModifiedTimeStamp = filemtime($filename);
if (($currentTimeStamp - $fileModifiedTimeStamp) > $keepTime) {
unlink($filename);
$deletedFileCount++;
}
}
$this->comment('Deleted ' . $deletedFileCount . ' files');
}
}

View File

@@ -1,63 +0,0 @@
<?php
namespace App\Console\Commands;
use App\Jobs\StoreUploadedFileJob;
use Illuminate\Console\Command;
use App\Models\Media;
use File;
use Symfony\Component\Console\Input\InputOption;
class MediaMigrate extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'media:migrate';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrate the uploads folder to the CDN';
/**
* Configure the command options.
*/
protected function configure(): void
{
$this->addOption(
'replace',
null,
InputOption::VALUE_NONE,
'Replace existing files'
);
}
/**
* Execute the console command.
*/
public function handle(): void
{
$replace = $this->option('replace');
$files = File::allFiles(public_path('uploads'));
foreach ($files as $file) {
$filename = pathinfo($file, PATHINFO_BASENAME);
$medium = Media::where('name', $filename)->first();
if ($medium !== null) {
$medium->update(['status' => 'Processing media']);
StoreUploadedFileJob::dispatch($medium, $file, $replace)->onQueue('media');
} else {
unlink($file);
}
}
}
}

View File

@@ -1,66 +0,0 @@
<?php
namespace App\Console\Commands;
use App\Jobs\StoreUploadedFileJob;
use Illuminate\Console\Command;
use App\Models\Media;
use Symfony\Component\Console\Input\InputOption;
class MediaRebuild extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'media:rebuild';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Rebuild the media table';
/**
* Configure the command options.
*/
protected function configure(): void
{
$this->addOption(
'replace',
null,
InputOption::VALUE_NONE,
'Replace existing files'
);
$this->addOption(
'all',
null,
InputOption::VALUE_NONE,
'Rebuild all variants'
);
}
/**
* Execute the console command.
*/
public function handle(): void
{
$replace = $this->option('replace');
$all = $this->option('replace');
$media = [];
if ($all === true) {
$media = Media::all();
} else {
$media = Media::where(['variants' => ''])->orWhere(['variants' => '[]'])->orWhere(['variants' => '{}'])->get();
}
foreach ($media as $medium) {
StoreUploadedFileJob::dispatch($medium, '', $replace)->onQueue('media');
}
}
}

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Console\Commands;
use App\Models\MediaJob;
use Illuminate\Console\Command;
class RemoveStaleMediaJobs extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:remove-stale-media-jobs';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Remove media_jobs that have not been modified for 48 hours';
/**
* Execute the console command.
*
* @return void
*/
public function handle(): void
{
$threshold = now()->subHours(48);
$staleJobs = MediaJob::where('updated_at', '<=', $threshold)->get();
foreach ($staleJobs as $job) {
$job->delete();
}
$this->info(count($staleJobs) . ' stale media_jobs removed.');
}
}

View File

@@ -11,14 +11,19 @@ class Kernel extends ConsoleKernel
* Define the application's command schedule. * Define the application's command schedule.
* *
* @param \Illuminate\Console\Scheduling\Schedule $schedule The schedule. * @param \Illuminate\Console\Scheduling\Schedule $schedule The schedule.
* @return void
*/ */
protected function schedule(Schedule $schedule): void protected function schedule(Schedule $schedule): void
{ {
// $schedule->command('inspire')->hourly(); // $schedule->command('inspire')->hourly();
$schedule->command('app:cleanup-temp-files')->everyThirtyMinutes();
$schedule->command('app:remove-stale-media-jobs')->everyThirtyMinutes();
} }
/** /**
* Register the commands for the application. * Register the commands for the application.
*
* @return void
*/ */
protected function commands(): void protected function commands(): void
{ {

View File

@@ -58,6 +58,8 @@ class Enum
/** /**
* Returns a message from the enum subclass * Returns a message from the enum subclass
* *
* @param integer $messageIndex The message index to retrieve.
* @param string $defaultMessage Message to use if index does not exist.
* @return string * @return string
*/ */
public static function getMessage(int $messageIndex, string $defaultMessage = 'Unknown'): string public static function getMessage(int $messageIndex, string $defaultMessage = 'Unknown'): string

View File

@@ -2,13 +2,15 @@
namespace App\Exceptions; namespace App\Exceptions;
use App\Enum\HttpResponseCodes;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable; use Throwable;
use PDOException; use PDOException;
use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
@@ -26,6 +28,8 @@ class Handler extends ExceptionHandler
/** /**
* Register the exception handling callbacks for the application. * Register the exception handling callbacks for the application.
*
* @return void
*/ */
public function register(): void public function register(): void
{ {
@@ -59,7 +63,36 @@ class Handler extends ExceptionHandler
}); });
$this->reportable(function (Throwable $e) { $this->reportable(function (Throwable $e) {
// if ($this->shouldReport($e) === true) {
if (App::runningUnitTests() === false) {
$this->sendEmail($e);
}
}
}); });
} }
/**
* Send email
*
* @param Throwable $exception Throwable object.
* @return void
*/
public function sendEmail(Throwable $exception)
{
try {
$e = FlattenException::createFromThrowable($exception);
$handler = new HtmlErrorRenderer(true);
$css = $handler->getStylesheet();
$content = $handler->getBody($e);
Mail::send('emails.exception', compact('css', 'content'), function ($message) {
$message
->to('webmaster@stemmechanics.com.au')
->subject('Exception Generated')
;
});
} catch (Throwable $ex) {
Log::error($ex);
}
}
} }

View File

@@ -38,3 +38,41 @@ function arrayLimitKeys(array $arr, array $keys): array
{ {
return array_intersect_key($arr, array_flip($keys)); return array_intersect_key($arr, array_flip($keys));
} }
/**
* Return an array value or default value if it does not exist
*
* @param string $key The key value to return if exists.
* @param array $arr The array to check.
* @param mixed $value The value to return if key does not exist.
* @return mixed
*/
function arrayDefaultValue(string $key, array $arr, mixed $value): mixed
{
if (array_key_exists($key, $arr) === true) {
return $arr[$key];
}
return $value;
}
/**
* Return if an item exists in an array, case insensitive
*
* @param string $val The value to check.
* @param array $arr The array to check.
* @return boolean
*/
function existsInArray(string $val, array $arr): bool
{
$exists = false;
foreach ($arr as $el) {
if (strcasecmp($val, $el) === 0) {
$exists = true;
break;
}
}
return $exists;
}

View File

@@ -6,14 +6,87 @@
/** /**
* Generate a temporary file path. * Generate a temporary file path.
* *
* @return str The filtered array. * @param string $extension The file extension to use.
* @param string $part The file part number.
* @return string The filtered array.
*/ */
function generateTempFilePath(): string function generateTempFilePath(string $extension = '', string $part = ''): string
{ {
$temporaryDir = storage_path('app/tmp'); $temporaryDir = storage_path('app/tmp');
if (is_dir($temporaryDir) === false) { if (is_dir($temporaryDir) === false) {
mkdir($temporaryDir, 0777, true); mkdir($temporaryDir, 0777, true);
} }
return $temporaryDir . DIRECTORY_SEPARATOR . uniqid('upload_', true); return $temporaryDir . DIRECTORY_SEPARATOR . uniqid('upload_', true) . ($extension !== '' ? ".{$extension}" : '') .
($part !== '' ? ".part-{$part}" : '');
}
/**
* Get Temp file information
*
* @param string $filePath The temp file name.
* @return array The temp file name details.
*/
function tempFileInfo(string $filePath): array
{
$part = '';
// Extract the part if it's present
if (preg_match('/\.part-(\d+)$/', $filePath, $matches) !== false) {
$part = $matches[1];
$filePath = substr($filePath, 0, -strlen($matches[0]));
}
$info = pathinfo($filePath);
$directory = $info['dirname'];
$name = $info['filename'];
$extension = '';
// If there's an extension, separate it
if (isset($info['extension']) === true) {
$extension = $info['extension'];
}
return [
'dirname' => $directory,
'basename' => $name . ($extension !== '' ? ".{$extension}" : ''),
'filename' => $name,
'extension' => $extension,
'part' => $part,
];
}
/**
* Check a temporary file exists.
*
* @param string $dir The file parent directory.
* @param string $name The file name.
* @param string $extension The file extension to use.
* @param string $part The file part number.
* @return boolean If the file exists.
*/
function tempFileExists(string $dir, string $name, string $extension = '', string $part = ''): bool
{
$filename = constructTempFileName($dir, $name, $extension, $part);
$exists = file_exists($filename);
return $exists;
}
/**
* Construct the temp file name based on the information
*
* @param string $dir The file parent directory.
* @param string $name The file name.
* @param string $extension The file extension to use.
* @param string $part The file part number.
* @return string The file path.
*/
function constructTempFileName(string $dir, string $name, string $extension = '', string $part = ''): string
{
$filename = $dir . DIRECTORY_SEPARATOR . $name . ($extension !== '' ? ".{$extension}" : '') .
($part !== "" ? ".part-{$part}" : '');
return $filename;
} }

27
app/Helpers/TypeValue.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
/* Type Value Helper Functions */
/**
* Is value true
*
* @param mixed $value Value to check.
* @return boolean
*/
function isTrue(mixed $value): bool
{
if (is_bool($value) === true && $value === true) {
return true;
}
if (is_numeric($value) === true && intval($value) === 1) {
return true;
}
if (is_string($value) === true && in_array(strtolower($value), ['true', '1'], true) === true) {
return true;
}
return false;
}

View File

@@ -3,16 +3,10 @@
namespace App\Http\Controllers\Api; namespace App\Http\Controllers\Api;
use App\Conductors\AnalyticsConductor; use App\Conductors\AnalyticsConductor;
use App\Conductors\Conductor;
use App\Enum\HttpResponseCodes; use App\Enum\HttpResponseCodes;
use App\Http\Requests\AnalyticsRequest; use App\Http\Requests\AnalyticsRequest;
use App\Models\Media; use App\Models\AnalyticsItemRequest;
use App\Models\Analytics; use App\Models\AnalyticsSession;
use Illuminate\Http\JsonResponse;
use Carbon\Exceptions\InvalidFormatException;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Database\Eloquent\InvalidCastException;
use Illuminate\Database\Eloquent\MassAssignmentException;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class AnalyticsController extends ApiController class AnalyticsController extends ApiController
@@ -39,27 +33,17 @@ class AnalyticsController extends ApiController
public function index(Request $request) public function index(Request $request)
{ {
if ($request->user() !== null && $request->user()?->hasPermission('admin/analytics') === true) { if ($request->user() !== null && $request->user()?->hasPermission('admin/analytics') === true) {
$searchFields = ['attribute', 'type', 'useragent', 'ip']; $request->rename([
'type' => 'requests.type',
'path' => 'requests.path'
]);
$queryRequest = new Request(); list($collection, $total) = AnalyticsConductor::request($request);
$queryRequest->merge($request->only($searchFields));
foreach ($searchFields as $field) {
unset($request[$field]);
}
$query = Analytics::query()
->selectRaw('session,
MIN(created_at) as created_at,
TIMESTAMPDIFF(MINUTE, MIN(created_at), MAX(created_at)) as duration');
$query = Conductor::filterQuery($query, $queryRequest);
list($collection, $total) = AnalyticsConductor::collection($request, $query
->groupBy('session')
->get());
return $this->respondAsResource( return $this->respondAsResource(
$collection, $collection,
['isCollection' => true, ['resourceName' => 'session',
'isCollection' => true,
'appendData' => ['total' => $total] 'appendData' => ['total' => $total]
] ]
); );
@@ -71,22 +55,25 @@ class AnalyticsController extends ApiController
/** /**
* Display the specified resource. * Display the specified resource.
* *
* @param \Illuminate\Http\Request $request The endpoint request. * @param \Illuminate\Http\Request $request The endpoint request.
* @param \App\Models\Analytics $analytics The analyics model. * @param \App\Models\AnalyticsSession $session The analytics session.
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function show(Request $request, int $session) public function show(Request $request, AnalyticsSession $session)
{ {
if ($request->user() !== null && $request->user()?->hasPermission('admin/analytics') === true) { if ($request->user() !== null && $request->user()?->hasPermission('admin/analytics') === true) {
list($collection, $total) = AnalyticsConductor::collection($request, Analytics::query() $session->load(['requests' => function ($query) {
->where('session', $session) $query->select('session_id', 'type', 'path', 'created_at');
->get()); }
]);
foreach ($session->requests as $requestItem) {
$requestItem->makeHidden('session_id');
}
return $this->respondAsResource( return $this->respondAsResource(
$collection, $session,
['isCollection' => true, ['resourceName' => 'session']
'appendData' => ['total' => $total]
]
); );
} }
@@ -107,16 +94,20 @@ class AnalyticsController extends ApiController
$data = [ $data = [
'type' => $request->input('type'), 'type' => $request->input('type'),
'attribute' => $request->input('attribute', ''), 'path' => $request->input('path', ''),
'useragent' => $request->userAgent(), 'useragent' => $request->userAgent(),
'ip' => $request->ip() 'ip' => $request->ip()
]; ];
if ($user !== null && $user->hasPermission('admin/analytics') === true && $request->has('session') === true) { if (
$data['session'] = $request->input('session'); $user !== null &&
$analytics = Analytics::create($data); $user->hasPermission('admin/analytics') === true &&
$request->has('session') === true
) {
$data['session_id'] = $request->input('session_id');
$analytics = AnalyticsItemRequest::create($data);
} else { } else {
$analytics = Analytics::createWithSession($data); $analytics = AnalyticsItemRequest::create($data);
} }
return $this->respondAsResource( return $this->respondAsResource(
@@ -127,37 +118,4 @@ class AnalyticsController extends ApiController
return $this->respondForbidden(); return $this->respondForbidden();
}//end if }//end if
} }
/**
* Update the specified resource in storage.
*
* @param \App\Http\Requests\AnalyticsRequest $request The analytics update request.
* @param \App\Models\Analytics $analytics The specified analytics.
* @return \Illuminate\Http\Response
*/
public function update(AnalyticsRequest $request, Analytics $analytics)
{
if (AnalyticsConductor::updatable($analytics) === true) {
$analytics->update($request->all());
return $this->respondAsResource(AnalyticsConductor::model($request, $analytics));
}
return $this->respondForbidden();
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\Analytics $analytics The specified analytics.
* @return \Illuminate\Http\Response
*/
public function destroy(Analytics $analytics)
{
if (AnalyticsConductor::destroyable($analytics) === true) {
$analytics->delete();
return $this->respondNoContent();
} else {
return $this->respondForbidden();
}
}
} }

View File

@@ -24,9 +24,13 @@ class ApiController extends Controller
* @param array $data Response data. * @param array $data Response data.
* @param integer $respondCode Response status code. * @param integer $respondCode Response status code.
* @param array $headers Response headers. * @param array $headers Response headers.
* @return JsonResponse
*/ */
public function respondJson(array $data, int $respondCode = HttpResponseCodes::HTTP_OK, array $headers = []): JsonResponse public function respondJson(
{ array $data,
int $respondCode = HttpResponseCodes::HTTP_OK,
array $headers = []
): JsonResponse {
return response()->json($data, $respondCode, $headers); return response()->json($data, $respondCode, $headers);
} }
@@ -34,9 +38,11 @@ class ApiController extends Controller
* Return forbidden message * Return forbidden message
* *
* @param string $message Response message. * @param string $message Response message.
* @return JsonResponse
*/ */
public function respondForbidden(string $message = 'You do not have permission to access the resource.'): JsonResponse public function respondForbidden(
{ string $message = 'You do not have permission to access the resource.'
): JsonResponse {
return response()->json(['message' => $message], HttpResponseCodes::HTTP_FORBIDDEN); return response()->json(['message' => $message], HttpResponseCodes::HTTP_FORBIDDEN);
} }
@@ -44,6 +50,7 @@ class ApiController extends Controller
* Return forbidden message * Return forbidden message
* *
* @param string $message Response message. * @param string $message Response message.
* @return JsonResponse
*/ */
public function respondNotFound(string $message = 'The resource was not found.'): JsonResponse public function respondNotFound(string $message = 'The resource was not found.'): JsonResponse
{ {
@@ -54,6 +61,7 @@ class ApiController extends Controller
* Return too large message * Return too large message
* *
* @param string $message Response message. * @param string $message Response message.
* @return JsonResponse
*/ */
public function respondTooLarge(string $message = 'The request entity is too large.'): JsonResponse public function respondTooLarge(string $message = 'The request entity is too large.'): JsonResponse
{ {
@@ -61,7 +69,9 @@ class ApiController extends Controller
} }
/** /**
* Return no content * Return no content.
*
* @return JsonResponse
*/ */
public function respondNoContent(): JsonResponse public function respondNoContent(): JsonResponse
{ {
@@ -69,7 +79,19 @@ class ApiController extends Controller
} }
/** /**
* Return created * Return no content
*
* @return JsonResponse
*/
public function respondNotImplemented(): JsonResponse
{
return response()->json([], HttpResponseCodes::HTTP_NOT_IMPLEMENTED);
}
/**
* Return created.
*
* @return JsonResponse
*/ */
public function respondCreated(): JsonResponse public function respondCreated(): JsonResponse
{ {
@@ -77,21 +99,36 @@ class ApiController extends Controller
} }
/** /**
* Return accepted * Return accepted.
*
* @return JsonResponse
*/ */
public function respondAccepted(): JsonResponse public function respondAccepted(): JsonResponse
{ {
return response()->json([], HttpResponseCodes::HTTP_ACCEPTED); return response()->json([], HttpResponseCodes::HTTP_ACCEPTED);
} }
/**
* Return server error.
*
* @return JsonResponse
*/
public function respondServerError(): JsonResponse
{
return response()->json([], HttpResponseCodes::HTTP_INTERNAL_SERVER_ERROR);
}
/** /**
* Return single error message * Return single error message
* *
* @param string $message Error message. * @param string $message Error message.
* @param integer $responseCode Resource code. * @param integer $responseCode Resource code.
* @return JsonResponse
*/ */
public function respondError(string $message, int $responseCode = HttpResponseCodes::HTTP_UNPROCESSABLE_ENTITY): JsonResponse public function respondError(
{ string $message,
int $responseCode = HttpResponseCodes::HTTP_UNPROCESSABLE_ENTITY
): JsonResponse {
return response()->json([ return response()->json([
'message' => $message 'message' => $message
], $responseCode); ], $responseCode);
@@ -102,9 +139,12 @@ class ApiController extends Controller
* *
* @param array $errors Error messages. * @param array $errors Error messages.
* @param integer $responseCode Resource code. * @param integer $responseCode Resource code.
* @return JsonResponse
*/ */
public function respondWithErrors(array $errors, int $responseCode = HttpResponseCodes::HTTP_UNPROCESSABLE_ENTITY): JsonResponse public function respondWithErrors(
{ array $errors,
int $responseCode = HttpResponseCodes::HTTP_UNPROCESSABLE_ENTITY
): JsonResponse {
$keys = array_keys($errors); $keys = array_keys($errors);
$error = $errors[$keys[0]]; $error = $errors[$keys[0]];
@@ -122,17 +162,20 @@ class ApiController extends Controller
/** /**
* Return resource data * Return resource data
* *
* @param array|Model|Collection $data Resource data. * @param array|Model|Collection $data Resource data.
* @param array $options Respond options. * @param array $options Respond options.
* @param callable|null $validationFn Optional validation function to check the data before responding.
* @return JsonResponse
*/ */
protected function respondAsResource( protected function respondAsResource(
mixed $data, mixed $data,
array $options = [], array $options = [],
$validationFn = null $validationFn = null
): JsonResponse { ): JsonResponse {
$isCollection = $options['isCollection'] ?? false; $isCollection = ($options['isCollection'] ?? false);
$appendData = $options['appendData'] ?? null; $appendData = ($options['appendData'] ?? null);
$resourceName = $options['resourceName'] ?? null; $resourceName = ($options['resourceName'] ?? '');
$transformResourceName = ($options['transformResourceName'] ?? true);
$respondCode = ($options['respondCode'] ?? HttpResponseCodes::HTTP_OK); $respondCode = ($options['respondCode'] ?? HttpResponseCodes::HTTP_OK);
if ($data === null || ($data instanceof Collection && $data->count() === 0)) { if ($data === null || ($data instanceof Collection && $data->count() === 0)) {
@@ -146,11 +189,11 @@ class ApiController extends Controller
} }
} }
if (is_null($resourceName) === true || empty($resourceName) === true) { if (empty($resourceName) === true) {
$resourceName = $this->resourceName; $resourceName = $this->resourceName;
} }
if (is_null($resourceName) === true || empty($resourceName) === true) { if (empty($resourceName) === true) {
$resourceName = get_class($this); $resourceName = get_class($this);
$resourceName = substr($resourceName, (strrpos($resourceName, '\\') + 1)); $resourceName = substr($resourceName, (strrpos($resourceName, '\\') + 1));
$resourceName = substr($resourceName, 0, strpos($resourceName, 'Controller')); $resourceName = substr($resourceName, 0, strpos($resourceName, 'Controller'));
@@ -163,15 +206,14 @@ class ApiController extends Controller
} elseif (is_array($data) === true) { } elseif (is_array($data) === true) {
$dataArray = $data; $dataArray = $data;
} elseif ($data instanceof Model) { } elseif ($data instanceof Model) {
$is_multiple = false;
$dataArray = $data->toArray(); $dataArray = $data->toArray();
} }
$resource = []; $resource = [];
if ($isCollection === true) { if ($isCollection === true) {
$resource = [Str::plural($resourceName) => $dataArray]; $resource = [$transformResourceName === true ? Str::plural($resourceName) : $resourceName => $dataArray];
} else { } else {
$resource = [Str::singular($resourceName) => $dataArray]; $resource = [$transformResourceName === true ? Str::singular($resourceName) : $resourceName => $dataArray];
} }
if ($appendData !== null) { if ($appendData !== null) {
@@ -180,4 +222,22 @@ class ApiController extends Controller
return response()->json($resource, $respondCode); return response()->json($resource, $respondCode);
} }
/**
* Get the Controller Model Class name.
*
* @return string
*/
public function getModelClass(): string
{
$controllerClass = static::class;
$modelName = 'App\\Models\\' . Str::replaceLast('Controller', '', Str::afterLast($controllerClass, '\\'));
if (class_exists($modelName) === false) {
return $modelName;
}
return $modelName;
}
} }

View File

@@ -8,15 +8,17 @@ use App\Enum\HttpResponseCodes;
use App\Http\Requests\ArticleRequest; use App\Http\Requests\ArticleRequest;
use App\Models\Media; use App\Models\Media;
use App\Models\Article; use App\Models\Article;
use App\Traits\HasAttachments;
use App\Traits\HasGallery;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Carbon\Exceptions\InvalidFormatException;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Database\Eloquent\InvalidCastException;
use Illuminate\Database\Eloquent\MassAssignmentException;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class ArticleController extends ApiController class ArticleController extends ApiController
{ {
use HasAttachments;
use HasGallery;
/** /**
* ApplicationController constructor. * ApplicationController constructor.
*/ */
@@ -73,14 +75,23 @@ class ArticleController extends ApiController
public function store(ArticleRequest $request) public function store(ArticleRequest $request)
{ {
if (ArticleConductor::creatable() === true) { if (ArticleConductor::creatable() === true) {
$article = Article::create($request->all()); $article = Article::create($request->except(['attachments', 'gallery']));
if ($request->has('attachments') === true) {
$article->addAttachments($request->get('attachments'));
}
if ($request->has('gallery') === true) {
$article->galleryAddMany($request->get('gallery'));
}
return $this->respondAsResource( return $this->respondAsResource(
ArticleConductor::model($request, $article), ArticleConductor::model($request, $article),
['respondCode' => HttpResponseCodes::HTTP_CREATED] ['respondCode' => HttpResponseCodes::HTTP_CREATED]
); );
} else { } else {
return $this->respondForbidden(); return $this->respondForbidden();
} }//end if
} }
/** /**
@@ -93,7 +104,17 @@ class ArticleController extends ApiController
public function update(ArticleRequest $request, Article $article) public function update(ArticleRequest $request, Article $article)
{ {
if (ArticleConductor::updatable($article) === true) { if (ArticleConductor::updatable($article) === true) {
$article->update($request->all()); if ($request->has('attachments') === true) {
$article->deleteAttachments();
$article->addAttachments($request->get('attachments'));
}
if ($request->has('gallery') === true) {
$article->gallery()->delete();
$article->galleryAddMany($request->get('gallery'));
}
$article->update($request->except(['attachments', 'gallery']));
return $this->respondAsResource(ArticleConductor::model($request, $article)); return $this->respondAsResource(ArticleConductor::model($request, $article));
} }
@@ -115,131 +136,4 @@ class ArticleController extends ApiController
return $this->respondForbidden(); return $this->respondForbidden();
} }
} }
/**
* Get a list of attachments related to this model.
*
* @param Request $request The user request.
* @param Article $article The article model.
* @return JsonResponse Returns the article attachments.
* @throws InvalidFormatException
* @throws BindingResolutionException
* @throws InvalidCastException
*/
public function getAttachments(Request $request, Article $article): JsonResponse
{
if (ArticleConductor::viewable($article) === true) {
$medium = $article->attachments->map(function ($attachment) {
return $attachment->media;
});
return $this->respondAsResource(MediaConductor::collection($request, $medium), ['isCollection' => true, 'resourceName' => 'attachment']);
}
return $this->respondForbidden();
}
/**
* Store an attachment related to this model.
*
* @param Request $request The user request.
* @param Article $article The article model.
* @return JsonResponse The response.
* @throws BindingResolutionException
* @throws MassAssignmentException
*/
public function storeAttachment(Request $request, Article $article): JsonResponse
{
if (ArticleConductor::updatable($article) === true) {
if ($request->has("medium") && Media::find($request->medium)) {
$article->attachments()->create(['media_id' => $request->medium]);
return $this->respondCreated();
}
return $this->respondWithErrors(['media' => 'The media ID was not found']);
}
return $this->respondForbidden();
}
/**
* Update/replace attachments related to this model.
*
* @param Request $request The user request.
* @param Article $article The related model.
* @throws BindingResolutionException
* @throws MassAssignmentException
*/
public function updateAttachments(Request $request, Article $article): JsonResponse
{
if (ArticleConductor::updatable($article) === true) {
$mediaIds = $request->attachments;
if (is_array($mediaIds) === false) {
$mediaIds = explode(',', $request->attachments);
}
$mediaIds = array_map('trim', $mediaIds); // trim each media ID
$attachments = $article->attachments;
// Delete attachments that are not in $mediaIds
foreach ($attachments as $attachment) {
if (!in_array($attachment->media_id, $mediaIds)) {
$attachment->delete();
}
}
// Create new attachments for media IDs that are not already in $article->attachments()
foreach ($mediaIds as $mediaId) {
$found = false;
foreach ($attachments as $attachment) {
if ($attachment->media_id == $mediaId) {
$found = true;
break;
}
}
if (!$found) {
$article->attachments()->create(['media_id' => $mediaId]);
}
}
return $this->respondNoContent();
}//end if
return $this->respondForbidden();
}
/**
* Delete a specific related attachment.
* @param Request $request The user request.
* @param Article $article The model.
* @param Media $medium The attachment medium.
* @throws BindingResolutionException
*/
public function deleteAttachment(Request $request, Article $article, Media $medium): JsonResponse
{
if (ArticleConductor::updatable($article) === true) {
$attachments = $article->attachments;
$deleted = false;
foreach ($attachments as $attachment) {
if ($attachment->media_id === $medium->id) {
$attachment->delete();
$deleted = true;
break;
}
}
if ($deleted) {
// Attachment was deleted successfully
return $this->respondNoContent();
} else {
// Attachment with matching media ID was not found
return $this->respondNotFound();
}
}
return $this->respondForbidden();
}
} }

View File

@@ -1,84 +0,0 @@
<?php
namespace App\Http\Controllers\Api;
use App\Models\Attachment;
use Illuminate\Http\Request;
class AttachmentController extends ApiController
{
/**
* ApplicationController constructor.
*/
public function __construct()
{
$this->middleware('auth:sanctum')
->except(['store', 'destroyByEmail']);
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param \App\Models\Attachment $attachment
* @return \Illuminate\Http\Response
*/
public function show(Attachment $attachment)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Attachment $attachment
* @return \Illuminate\Http\Response
*/
public function edit(Attachment $attachment)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Attachment $attachment
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Attachment $attachment)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\Attachment $attachment
* @return \Illuminate\Http\Response
*/
public function destroy(Attachment $attachment)
{
//
}
}

View File

@@ -31,6 +31,7 @@ class AuthController extends ApiController
* Current User details * Current User details
* *
* @param Request $request Current request data. * @param Request $request Current request data.
* @return JsonResponse
*/ */
public function me(Request $request): JsonResponse public function me(Request $request): JsonResponse
{ {
@@ -48,7 +49,11 @@ class AuthController extends ApiController
{ {
$user = User::where('email', '=', $request->input('email'))->first(); $user = User::where('email', '=', $request->input('email'))->first();
if ($user !== null && strlen($user->password) > 0 && Hash::check($request->input('password'), $user->password) === true) { if (
$user !== null &&
strlen($user->password) > 0 &&
Hash::check($request->input('password'), $user->password) === true
) {
if ($user->email_verified_at === null) { if ($user->email_verified_at === null) {
return $this->respondWithErrors([ return $this->respondWithErrors([
'email' => 'Email address has not been verified.' 'email' => 'Email address has not been verified.'
@@ -86,6 +91,7 @@ class AuthController extends ApiController
* Logout current user * Logout current user
* *
* @param Request $request Current request data. * @param Request $request Current request data.
* @return JsonResponse
*/ */
public function logout(Request $request): JsonResponse public function logout(Request $request): JsonResponse
{ {

View File

@@ -10,7 +10,10 @@ use App\Conductors\UserConductor;
use App\Http\Requests\EventRequest; use App\Http\Requests\EventRequest;
use App\Models\Media; use App\Models\Media;
use App\Models\User; use App\Models\User;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Response;
class EventController extends ApiController class EventController extends ApiController
{ {
@@ -66,7 +69,12 @@ class EventController extends ApiController
public function store(EventRequest $request) public function store(EventRequest $request)
{ {
if (EventConductor::creatable() === true) { if (EventConductor::creatable() === true) {
$event = Event::create($request->all()); $event = Event::create($request->except(['attachments']));
if ($request->has('attachments') === true) {
$event->addAttachments($request->get('attachments'));
}
return $this->respondAsResource( return $this->respondAsResource(
EventConductor::model($request, $event), EventConductor::model($request, $event),
['respondCode' => HttpResponseCodes::HTTP_CREATED] ['respondCode' => HttpResponseCodes::HTTP_CREATED]
@@ -86,7 +94,12 @@ class EventController extends ApiController
public function update(EventRequest $request, Event $event) public function update(EventRequest $request, Event $event)
{ {
if (EventConductor::updatable($event) === true) { if (EventConductor::updatable($event) === true) {
$event->update($request->all()); if ($request->has('attachments') === true) {
$event->deleteAttachments();
$event->addAttachments($request->get('attachments'));
}
$event->update($request->except(['attachments']));
return $this->respondAsResource(EventConductor::model($request, $event)); return $this->respondAsResource(EventConductor::model($request, $event));
} }
@@ -110,126 +123,12 @@ class EventController extends ApiController
} }
/** /**
* Get a list of attachments related to this model. * List users of Event
* * @param Request $request The HTTP request.
* @param Request $request The user request. * @param Event $event Event model.
* @param Event $event The event model. * @return JsonResponse
* @return JsonResponse Returns the event attachments.
*/ */
public function getAttachments(Request $request, Event $event): JsonResponse public function userList(Request $request, Event $event): JsonResponse
{
if (EventConductor::viewable($event) === true) {
$medium = $event->attachments->map(function ($attachment) {
return $attachment->media;
});
return $this->respondAsResource(MediaConductor::collection($request, $medium), ['isCollection' => true, 'resourceName' => 'attachment']);
}
return $this->respondForbidden();
}
/**
* Store an attachment related to this model.
*
* @param Request $request The user request.
* @param Event $event The event model.
* @return JsonResponse The response.
*/
public function storeAttachment(Request $request, Event $event): JsonResponse
{
if (EventConductor::updatable($event) === true) {
if ($request->has("medium") === true && Media::find($request->medium) !== null) {
$event->attachments()->create(['media_id' => $request->medium]);
return $this->respondCreated();
}
return $this->respondWithErrors(['media' => 'The media ID was not found']);
}
return $this->respondForbidden();
}
/**
* Update/replace attachments related to this model.
*
* @param Request $request The user request.
* @param Event $event The related model.
*/
public function updateAttachments(Request $request, Event $event): JsonResponse
{
if (EventConductor::updatable($event) === true) {
$mediaIds = $request->attachments;
if (is_array($mediaIds) === false) {
$mediaIds = explode(',', $request->attachments);
}
$mediaIds = array_map('trim', $mediaIds); // trim each media ID
$attachments = $event->attachments;
// Delete attachments that are not in $mediaIds
foreach ($attachments as $attachment) {
if (in_array($attachment->media_id, $mediaIds) === false) {
$attachment->delete();
}
}
// Create new attachments for media IDs that are not already in $article->attachments()
foreach ($mediaIds as $mediaId) {
$found = false;
foreach ($attachments as $attachment) {
if ($attachment->media_id === $mediaId) {
$found = true;
break;
}
}
if ($found === false) {
$event->attachments()->create(['media_id' => $mediaId]);
}
}
return $this->respondNoContent();
}//end if
return $this->respondForbidden();
}
/**
* Delete a specific related attachment.
*
* @param Request $request The user request.
* @param Event $event The model.
* @param Media $medium The attachment medium.
*/
public function deleteAttachment(Request $request, Event $event, Media $medium): JsonResponse
{
if (EventConductor::updatable($event) === true) {
$attachments = $event->attachments;
$deleted = false;
foreach ($attachments as $attachment) {
if ($attachment->media_id === $medium->id) {
$attachment->delete();
$deleted = true;
break;
}
}
if ($deleted === true) {
// Attachment was deleted successfully
return $this->respondNoContent();
} else {
// Attachment with matching media ID was not found
return $this->respondNotFound();
}
}
return $this->respondForbidden();
}
public function userList(Request $request, Event $event)
{ {
$authUser = $request->user(); $authUser = $request->user();
$eventUsers = $event->users; $eventUsers = $event->users;
@@ -245,16 +144,28 @@ class EventController extends ApiController
}); });
} }
return $this->respondAsResource(UserConductor::collection($request, $eventUsers), ['isCollection' => true, 'resourceName' => 'users']); return $this->respondAsResource(
UserConductor::collection($request, $eventUsers),
[
'isCollection' => true,
'resourceName' => 'users'
]
);
} }
return $this->respondNotFound(); return $this->respondNotFound();
} }//end if
return $this->respondForbidden(); return $this->respondForbidden();
} }
public function userAdd(Request $request, Event $event) /**
* Add user to Event
* @param Request $request The HTTP request.
* @param Event $event Event model.
* @return JsonResponse
*/
public function userAdd(Request $request, Event $event): JsonResponse
{ {
$authUser = $request->user(); $authUser = $request->user();
if ($authUser !== null && $authUser->hasPermission('admin/events') === true) { if ($authUser !== null && $authUser->hasPermission('admin/events') === true) {
@@ -286,12 +197,26 @@ class EventController extends ApiController
return $this->respondForbidden(); return $this->respondForbidden();
} }
public function userUpdate(Request $request, Event $event) /**
* Update user
* @param Request $request The HTTP request.
* @param Event $event Event model.
* @return void
*/
public function userUpdate(Request $request, Event $event): void
{ {
// only admin/events permitted // only admin/events permitted
} }
public function userDelete(Request $request, Event $event, User $user) /**
* Delete user from event
*
* @param Request $request The HTTP request.
* @param Event $event Event model.
* @param User $user User model.
* @return JsonResponse
*/
public function userDelete(Request $request, Event $event, User $user): JsonResponse
{ {
$authUser = $request->user(); $authUser = $request->user();
if ($authUser !== null && $authUser->hasPermission('admin/events') === true) { if ($authUser !== null && $authUser->hasPermission('admin/events') === true) {

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Http\Controllers\Api;
use App\Enum\HttpResponseCodes;
use App\Models\Media;
use Illuminate\Http\Request;
class InfoController extends ApiController
{
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request The endpoint request.
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
$info = [
"version" => "1.0.0",
"max_upload_size" => Media::getMaxUploadSize()
];
return $this->respondJson($info);
}
}

View File

@@ -45,7 +45,12 @@ class LogController extends ApiController
$before = $request->get('before'); $before = $request->get('before');
if ($before !== null) { if ($before !== null) {
$before = preg_split("/([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/", $before, -1, (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)); $before = preg_split(
"/([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/",
$before,
-1,
(PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)
);
if (count($before) !== 6) { if (count($before) !== 6) {
$before = null; $before = null;
} }
@@ -53,7 +58,12 @@ class LogController extends ApiController
$after = $request->get('after'); $after = $request->get('after');
if ($after !== null) { if ($after !== null) {
$after = preg_split("/([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/", $after, -1, (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)); $after = preg_split(
"/([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/",
$after,
-1,
(PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)
);
if (count($after) !== 6) { if (count($after) !== 6) {
$after = null; $after = null;
} }
@@ -77,30 +87,59 @@ class LogController extends ApiController
$logContent = file_get_contents($logFile['path']); $logContent = file_get_contents($logFile['path']);
} }
$logArray = preg_split("/(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}: (?:(?!\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}: )[\s\S])*)/", $logContent, -1, (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)); $logArray = preg_split(
// phpcs:ignore Generic.Files.LineLength.TooLong
"/(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}: (?:(?!\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}: )[\s\S])*)/",
$logContent,
-1,
(PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)
);
$logContent = ''; $logContent = '';
$logLineCount = 0; $logLineCount = 0;
$logLineSkip = false; $logLineSkip = false;
foreach (array_reverse($logArray) as $logLine) { foreach (array_reverse($logArray) as $logLine) {
$lineDate = preg_split("/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2}): /", $logLine, -1, (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)); $lineDate = preg_split(
"/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2}): /",
$logLine,
-1,
(PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)
);
if (count($lineDate) >= 6) { if (count($lineDate) >= 6) {
$logLineSkip = false; $logLineSkip = false;
// Is line before // Is line before
if ($before !== null && ($lineDate[0] > $before[0] || $lineDate[1] > $before[1] || $lineDate[2] > $before[2] || $lineDate[3] > $before[3] || $lineDate[4] > $before[4] || $lineDate[5] > $before[5])) { if (
$before !== null && (
$lineDate[0] > $before[0] ||
$lineDate[1] > $before[1] ||
$lineDate[2] > $before[2] ||
$lineDate[3] > $before[3] ||
$lineDate[4] > $before[4] ||
$lineDate[5] > $before[5]
)
) {
$logLineSkip = true; $logLineSkip = true;
continue; continue;
} }
// Is line after // Is line after
if ($after !== null && ($after[0] > $lineDate[0] || $after[1] > $lineDate[1] || $after[2] > $lineDate[2] || $after[3] > $lineDate[3] || $after[4] > $lineDate[4] || $after[5] > $lineDate[5])) { if (
$after !== null && (
$after[0] > $lineDate[0] ||
$after[1] > $lineDate[1] ||
$after[2] > $lineDate[2] ||
$after[3] > $lineDate[3] ||
$after[4] > $lineDate[4] ||
$after[5] > $lineDate[5]
)
) {
$logLineSkip = true; $logLineSkip = true;
continue; continue;
} }
$logLineCount += 1; $logLineCount += 1;
} }//end if
if ($logLineCount > $lines) { if ($logLineCount > $lines) {
break; break;

View File

@@ -3,12 +3,18 @@
namespace App\Http\Controllers\Api; namespace App\Http\Controllers\Api;
use App\Conductors\MediaConductor; use App\Conductors\MediaConductor;
use App\Conductors\MediaJobConductor;
use App\Enum\HttpResponseCodes; use App\Enum\HttpResponseCodes;
use App\Http\Requests\MediaRequest; use App\Http\Requests\MediaRequest;
use App\Models\Media; use App\Models\Media;
use App\Models\MediaJob;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use Laravel\Sanctum\PersonalAccessToken; use Laravel\Sanctum\PersonalAccessToken;
class MediaController extends ApiController class MediaController extends ApiController
@@ -67,45 +73,18 @@ class MediaController extends ApiController
*/ */
public function store(MediaRequest $request) public function store(MediaRequest $request)
{ {
if (MediaConductor::creatable() === true) { // allowed to create a media item
$file = $request->file('file'); if (MediaConductor::creatable() === false) {
if ($file === null) { return $this->respondForbidden();
return $this->respondWithErrors(['file' => 'The browser did not upload the file correctly to the server.']); }
}
if ($file->isValid() !== true) { // check for file
switch ($file->getError()) { $file = $request->file('file');
case UPLOAD_ERR_INI_SIZE: if ($file === null) {
case UPLOAD_ERR_FORM_SIZE: return $this->respondWithErrors(['file' => 'The browser did not upload the file correctly to the server.']);
return $this->respondTooLarge(); }
case UPLOAD_ERR_PARTIAL:
return $this->respondWithErrors(['file' => 'The file upload was interrupted.']);
default:
return $this->respondWithErrors(['file' => 'An error occurred uploading the file to the server.']);
}
}
if ($file->getSize() > Media::getMaxUploadSize()) { return $this->storeOrUpdate($request, null);
return $this->respondTooLarge();
}
try {
$media = Media::createFromUploadedFile($request, $file);
} catch (\Exception $e) {
if ($e->getCode() === Media::FILE_SIZE_EXCEEDED_ERROR) {
return $this->respondTooLarge();
} else {
return $this->respondWithErrors(['file' => $e->getMessage()]);
}
}
return $this->respondAsResource(
MediaConductor::model($request, $media),
['respondCode' => HttpResponseCodes::HTTP_ACCEPTED]
);
}//end if
return $this->respondForbidden();
} }
/** /**
@@ -117,43 +96,202 @@ class MediaController extends ApiController
*/ */
public function update(MediaRequest $request, Media $medium) public function update(MediaRequest $request, Media $medium)
{ {
if (MediaConductor::updatable($medium) === true) { // allowed to update a media item
$file = $request->file('file'); if (MediaConductor::updatable($medium) === false) {
return $this->respondForbidden();
}
return $this->storeOrUpdate($request, $medium);
}
/**
* Store a new media resource
*
* @param \App\Http\Requests\MediaRequest $request The uploaded media.
* @param \App\Models\Media|null $medium The specified media.
* @return \Illuminate\Http\Response
*/
public function storeOrUpdate(MediaRequest $request, Media|null $medium)
{
$file = $request->file('file');
if ($file !== null) {
// validate file object
if ($file->isValid() !== true) {
switch ($file->getError()) {
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
return $this->respondTooLarge();
case UPLOAD_ERR_PARTIAL:
return $this->respondWithErrors([$file => 'The file upload was interrupted.']);
default:
return $this->respondWithErrors(
[$file => 'An error occurred uploading the file to the server.']
);
}
}
if ($file->getSize() > Media::getMaxUploadSize()) {
return $this->respondTooLarge();
}
}
// create/get media job
$mediaJob = null;
$data = [];
if ($request->missing('job_id') === true) {
/** @var \App\Models\User */
$user = auth()->user();
$mediaJob = new MediaJob();
$mediaJob->user_id = $user->id;
if ($medium !== null) {
$mediaJob->media_id = $medium->id;
}
if ($request->has('title') === true || $file !== null) {
$data['title'] = $request->get('title', '');
}
if ($request->has('name') === true || $file !== null) {
$data['name'] = (
$request->has('chunk') === true ? $request->get('name', '') : $file->getClientOriginalName()
);
}
if ($file !== null) { if ($file !== null) {
if ($file->isValid() !== true) { $data['size'] = $request->has('chunk') === true ? intval($request->get('size', 0)) : $file->getSize();
switch ($file->getError()) { $data['mime_type'] = (
case UPLOAD_ERR_INI_SIZE: $request->has('chunk') === true ? $request->get('mime_type', '') : $file->getMimeType()
case UPLOAD_ERR_FORM_SIZE: );
return $this->respondTooLarge(); }
case UPLOAD_ERR_PARTIAL:
return $this->respondWithErrors(['file' => 'The file upload was interrupted.']); if ($request->has('storage') === true || $file !== null) {
default: $data['storage'] = $request->get('storage', '');
return $this->respondWithErrors(['file' => 'An error occurred uploading the file to the server.']); }
if ($request->has('security_type') === true || $file !== null) {
$data['security']['type'] = $request->get('security_type', '');
$data['security']['data'] = $request->get('security_data', '');
if ($data['security']['type'] === '') {
$data['security']['data'] = '';
}
if ($medium === null || strcasecmp($data['security']['type'], $medium->security_type) !== 0) {
if ($request->has('storage') === false) {
$mime_type = $request->get('mime_type', $medium === null ? '' : $medium->mime_type);
$data['storage'] = Media::recommendedStorage($mime_type, $data['security']['type']);
}
}
}
if (
array_key_exists('storage', $data) === true && (
array_key_exists('security', $data) === true &&
array_key_exists('type', $data['security']) === true
) &&
array_key_exists('mime_type', $data) === true &&
$data['mime_type'] !== ""
) {
$error = Media::verifyStorage($data['mime_type'], $data['security']['type'], $data['storage']);
// Log::error($data['mime_type'] . ' - ' . $data['security']['type'] . ' - ' . $data['storage']);
switch ($error) {
case Media::STORAGE_VALID:
break;
case Media::STORAGE_MIME_MISSING:
return $this->respondWithErrors(['mime_type' => 'The file type is required.']);
case Media::STORAGE_NOT_FOUND:
return $this->respondWithErrors(['storage' => 'Storage was not found.']);
case Media::STORAGE_INVALID_SECURITY:
return $this->respondWithErrors(
['storage' => 'Storage invalid for this security requirement.']
);
default:
return $this->respondWithErrors(['storage' => 'Storage verification error occurred.']);
}
}
if ($request->has('transform') === true) {
$transform = [];
foreach (explode(',', $request->get('transform', '')) as $value) {
if (is_string($value) === true) {
if (preg_match('/^rotate-(-?\d+)$/', $value, $matches) !== false) {
$transform['rotate'] = $matches[1];
} elseif (preg_match('/^flip-([vh]|vh|hv)$/', $value, $matches) !== false) {
$transform['flip'] = $matches[1];
} elseif (preg_match('/^crop-(\d+)-(\d+)$/', $value, $matches) !== false) {
$transform['crop'] = ['width' => $matches[1], 'height' => $matches[2]];
} elseif (preg_match('/^crop-(\d+)-(\d+)-(\d+)-(\d+)$/', $value, $matches) !== false) {
$transform['crop'] = [
'width' => $matches[1],
'height' => $matches[2],
'x' => $matches[3],
'y' => $matches[4]
];
}
} }
} }
if ($file->getSize() > Media::getMaxUploadSize()) { if (count($transform) > 0) {
return $this->respondTooLarge(); $data['transform'] = $transform;
} }
}//end if
$mediaJob->setStatusWaiting();
} else {
$mediaJob = MediaJob::find($request->get('job_id'));
if ($mediaJob === null || $mediaJob->exists() === false) {
$this->respondNotFound();
} }
$medium->update($request->all()); $data = json_decode($mediaJob->data, true);
if ($data === null) {
if ($file !== null) { Log::error(`{$mediaJob->id} contains no data`);
try { return $this->respondServerError();
$medium->updateWithUploadedFile($file);
} catch (\Exception $e) {
return $this->respondWithErrors(
['file' => $e->getMessage()],
HttpResponseCodes::HTTP_INTERNAL_SERVER_ERROR
);
}
} }
return $this->respondAsResource(MediaConductor::model($request, $medium)); if (array_key_exists('name', $data) === false) {
Log::error(`{$mediaJob->id} data does not contain the name key`);
return $this->respondServerError();
}
}//end if }//end if
return $this->respondForbidden(); if ($mediaJob === null) {
Log::error(`media job does not exist`);
return $this->respondServerError();
}
// save uploaded file
if ($file !== null) {
if ($data['name'] === '') {
Log::error(`filename does not exist`);
return $this->respondServerError();
}
$temporaryFilePath = generateTempFilePath(
pathinfo($data['name'], PATHINFO_EXTENSION),
$request->get('chunk', '')
);
copy($file->path(), $temporaryFilePath);
if ($request->has('chunk') === true) {
$data['chunks'][$request->get('chunk', '1')] = $temporaryFilePath;
$data['chunk_count'] = $request->get('chunk_count', 1);
} else {
$data['file'] = $temporaryFilePath;
}
}
$mediaJob->data = json_encode($data, true);
$mediaJob->save();
$mediaJob->process();
return $this->respondAsResource(
MediaJobConductor::model($request, $mediaJob),
['resourceName' => 'media_job', 'respondCode' => HttpResponseCodes::HTTP_ACCEPTED]
);
} }
/** /**
@@ -176,52 +314,59 @@ class MediaController extends ApiController
* Display the specified resource. * Display the specified resource.
* *
* @param \Illuminate\Http\Request $request The endpoint request. * @param \Illuminate\Http\Request $request The endpoint request.
* @param \App\Models\Media $medium Specified media. * @param \App\Models\Media $media Specified media.
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function download(Request $request, Media $medium) public function download(Request $request, Media $media): Response
{ {
$respondJson = in_array('application/json', explode(',', $request->header('Accept', 'application/json')));
$headers = []; $headers = [];
$path = $medium->path();
/* File exists */ /* Check file exists */
if (file_exists($path) === false) { if (Storage::disk($media->storage)->exists($media->name) === false) {
if ($respondJson === false) { return $this->respondNotFound();
return redirect('/not-found');
} else {
return $this->respondNotFound();
}
} }
$updated_at = Carbon::parse(filemtime($path)); $updated_at = Carbon::parse(Storage::disk($media->storage)->lastModified($media->name));
$headerPragma = 'no-cache'; $headerPragma = 'no-cache';
$headerCacheControl = 'max-age=0, must-revalidate'; $headerCacheControl = 'max-age=0, must-revalidate';
$headerExpires = $updated_at->toRfc2822String(); $headerExpires = $updated_at->toRfc2822String();
if (empty($medium->permission) === true) { /* construct user if can */
if ($request->user() === null && $request->has('token') === true) { $user = $request->user();
$accessToken = PersonalAccessToken::findToken(urldecode($request->input('token'))); if ($user === null && $request->has('token') === true) {
$accessToken = PersonalAccessToken::findToken(urldecode($request->input('token')));
if ( if (
$accessToken !== null && (config('sanctum.expiration') === null || $accessToken !== null && (config('sanctum.expiration') === null ||
$accessToken->created_at->lte(now()->subMinutes(config('sanctum.expiration'))) === false) $accessToken->created_at->lte(now()->subMinutes(config('sanctum.expiration'))) === false)
) { ) {
$user = $accessToken->tokenable; $user = $accessToken->tokenable;
}
} }
if ($request->user() === null || $user->hasPermission($medium->permission) === false) { }
if ($respondJson === false) {
return redirect('/login?redirect=' . $request->path()); if ($media->security_type === '') {
} else { /* no security */
return $this->respondForbidden();
}
}
} else {
$headerPragma = 'public'; $headerPragma = 'public';
$headerExpires = $updated_at->addMonth()->toRfc2822String(); $headerExpires = $updated_at->addMonth()->toRfc2822String();
} elseif (strcasecmp('password', $media->security_type) === 0) {
/* password */
if (
($user === null || $user->hasPermission('admin/media') === false) &&
($request->has('password') === false || $request->get('password') !== $media->security_data)
) {
return $this->respondForbidden();
}
} elseif (strcasecmp('permission', $media->security_type) === 0) {
/* permission */
if (
$user === null || (
$user->hasPermission('admin/media') === false &&
$user->hasPermission($media->security_data) === false
)
) {
return $this->respondForbidden();
}
}//end if }//end if
// deepcode ignore InsecureHash: Browsers expect Etag to be a md5 hash // deepcode ignore InsecureHash: Browsers expect Etag to be a md5 hash
@@ -230,7 +375,7 @@ class MediaController extends ApiController
$headers = [ $headers = [
'Cache-Control' => $headerCacheControl, 'Cache-Control' => $headerCacheControl,
'Content-Disposition' => sprintf('inline; filename="%s"', basename($path)), 'Content-Disposition' => sprintf('inline; filename="%s"', basename($media->name)),
'Etag' => $headerEtag, 'Etag' => $headerEtag,
'Expires' => $headerExpires, 'Expires' => $headerExpires,
'Last-Modified' => $headerLastModified, 'Last-Modified' => $headerLastModified,
@@ -249,6 +394,50 @@ class MediaController extends ApiController
return response()->make('', 304, $headers); return response()->make('', 304, $headers);
} }
return response()->file($path, $headers); $headers['Content-Type'] = Storage::disk($media->storage)->mimeType($media->name);
$headers['Content-Length'] = Storage::disk($media->storage)->size($media->name);
$headers['Content-Disposition'] = 'attachment; filename="' . basename($media->name) . '"';
$stream = Storage::disk($media->storage)->readStream($media->name);
return response()->stream(
function () use ($stream) {
while (ob_get_level() > 0) {
ob_end_flush();
}
fpassthru($stream);
},
200,
$headers
);
}
/**
* Validate a File item in a request is valid
*
* @param UploadedFile $file The file to validate.
* @param string $errorKey The error key to use.
* @return JsonResponse|null
*/
private function validateFileObject(UploadedFile $file, string $errorKey = 'file'): JsonResponse|null
{
if ($file->isValid() !== true) {
switch ($file->getError()) {
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
return $this->respondTooLarge();
case UPLOAD_ERR_PARTIAL:
return $this->respondWithErrors([$errorKey => 'The file upload was interrupted.']);
default:
return $this->respondWithErrors(
[$errorKey => 'An error occurred uploading the file to the server.']
);
}
}
if ($file->getSize() > Media::getMaxUploadSize()) {
return $this->respondTooLarge();
}
return null;
} }
} }

View File

@@ -0,0 +1,52 @@
<?php
namespace App\Http\Controllers\Api;
use App\Conductors\MediaJobConductor;
use App\Http\Controllers\Api\ApiController;
use App\Models\MediaJob;
use Illuminate\Http\Request;
class MediaJobController extends ApiController
{
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request The endpoint request.
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
list($collection, $total) = MediaJobConductor::request($request);
return $this->respondAsResource(
$collection,
['isCollection' => true,
'appendData' => ['total' => $total],
'resourceName' => 'media_job'
],
function ($options) {
return $options['total'] === 0;
}
);
}
/**
* Display the specified resource.
*
* @param \Illuminate\Http\Request $request The endpoint request.
* @param \App\Models\MediaJob $mediaJob The request media job.
* @return \Illuminate\Http\Response
*/
public function show(Request $request, MediaJob $mediaJob)
{
if (MediaJobConductor::viewable($mediaJob) === true) {
return $this->respondAsResource(
MediaJobConductor::model($request, $mediaJob),
['resourceName' => 'media_job']
);
}
return $this->respondForbidden();
}
}

View File

@@ -101,7 +101,10 @@ class OCRController extends ApiController
$tesseractImageFilterFunc = function ($filter, $options = null) use ($curlResult, $curlSize, $ocr) { $tesseractImageFilterFunc = function ($filter, $options = null) use ($curlResult, $curlSize, $ocr) {
$result = ''; $result = '';
$img = imagecreatefromstring($curlResult); $img = imagecreatefromstring($curlResult);
if ($img !== false && (($options !== null && imagefilter($img, $filter, $options) === true) || ($options === null && imagefilter($img, $filter) === true))) { if (
$img !== false && (($options !== null && imagefilter($img, $filter, $options) === true) ||
($options === null && imagefilter($img, $filter) === true))
) {
ob_start(); ob_start();
imagepng($img); imagepng($img);
$imgData = ob_get_contents(); $imgData = ob_get_contents();

View File

@@ -2,17 +2,11 @@
namespace App\Http\Controllers\Api; namespace App\Http\Controllers\Api;
use App\Conductors\MediaConductor;
use App\Conductors\ShortlinkConductor; use App\Conductors\ShortlinkConductor;
use App\Enum\HttpResponseCodes; use App\Enum\HttpResponseCodes;
use App\Http\Requests\MediaRequest;
use App\Http\Requests\ShortlinkRequest; use App\Http\Requests\ShortlinkRequest;
use App\Models\Media;
use App\Models\Shortlink; use App\Models\Shortlink;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Log;
use Laravel\Sanctum\PersonalAccessToken;
class ShortlinkController extends ApiController class ShortlinkController extends ApiController
{ {
@@ -85,8 +79,8 @@ class ShortlinkController extends ApiController
/** /**
* Update the media resource in storage. * Update the media resource in storage.
* *
* @param \App\Http\Requests\ShortlinkRequest $request The update request. * @param \App\Http\Requests\ShortlinkRequest $request The update request.
* @param \App\Models\Shortlink $medium The specified shortlink. * @param \App\Models\Shortlink $shortlink The specified shortlink.
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function update(ShortlinkRequest $request, Shortlink $shortlink) public function update(ShortlinkRequest $request, Shortlink $shortlink)
@@ -102,7 +96,7 @@ class ShortlinkController extends ApiController
/** /**
* Remove the specified resource from storage. * Remove the specified resource from storage.
* *
* @param \App\Models\Shortlink $medium Specified shortlink. * @param \App\Models\Shortlink $shortlink Specified shortlink.
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function destroy(Shortlink $shortlink) public function destroy(Shortlink $shortlink)

View File

@@ -1,146 +0,0 @@
<?php
namespace App\Http\Controllers\Api;
use App\Conductors\SubscriptionConductor;
use App\Enum\HttpResponseCodes;
use App\Models\Subscription;
use App\Http\Requests\SubscriptionRequest;
use App\Jobs\SendEmailJob;
use App\Mail\SubscriptionConfirm;
use App\Mail\SubscriptionUnsubscribed;
use Illuminate\Http\Request;
class SubscriptionController extends ApiController
{
/**
* ApplicationController constructor.
*/
public function __construct()
{
$this->middleware('auth:sanctum')
->except(['store', 'destroyByEmail']);
}
/**
* Display a listing of subscribers.
*
* @param \Illuminate\Http\Request $request The endpoint request.
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
list($collection, $total) = SubscriptionConductor::request($request);
return $this->respondAsResource(
$collection,
['isCollection' => true,
'appendData' => ['total' => $total]
]
);
}
/**
* Display the specified user.
*
* @param \Illuminate\Http\Request $request The endpoint request.
* @param \App\Models\Subscription $subscription The subscription model.
* @return \Illuminate\Http\Response
*/
public function show(Request $request, Subscription $subscription)
{
if (SubscriptionConductor::viewable($subscription) === true) {
return $this->respondAsResource(SubscriptionConductor::model($request, $subscription));
}
return $this->respondForbidden();
}
/**
* Store a subscriber email in the database.
*
* @param \App\Http\Requests\SubscriptionRequest $request The subscriber update request.
* @return \Illuminate\Http\Response
*/
public function store(SubscriptionRequest $request)
{
if (SubscriptionConductor::creatable() === true) {
Subscription::create($request->all());
dispatch((new SendEmailJob($request->email, new SubscriptionConfirm($request->email))))->onQueue('mail');
return $this->respondCreated();
} else {
return $this->respondForbidden();
}
}
/**
* Update the specified resource in storage.
*
* @param \App\Http\Requests\SubscriptionRequest $request The subscription update request.
* @param \App\Models\Subscription $subscription The specified subscription.
* @return \Illuminate\Http\Response
*/
public function update(SubscriptionRequest $request, Subscription $subscription)
{
// if (EventConductor::updatable($event) === true) {
// $event->update($request->all());
// return $this->respondAsResource(EventConductor::model($request, $event));
// }
// return $this->respondForbidden();
// $input = [];
// $updatable = ['username', 'first_name', 'last_name', 'email', 'phone', 'password'];
// if ($request->user()->hasPermission('admin/user') === true) {
// $updatable = array_merge($updatable, ['email_verified_at']);
// } elseif ($request->user()->is($user) !== true) {
// return $this->respondForbidden();
// }
// $input = $request->only($updatable);
// if (array_key_exists('password', $input) === true) {
// $input['password'] = Hash::make($request->input('password'));
// }
// $user->update($input);
// return $this->respondAsResource((new UserFilter($request))->filter($user));
}
/**
* Remove the user from the database.
*
* @param Subscription $subscription The specified subscription.
* @return \Illuminate\Http\Response
*/
public function destroy(Subscription $subscription)
{
if (SubscriptionConductor::destroyable($subscription) === true) {
$subscription->delete();
return $this->respondNoContent();
} else {
return $this->respondForbidden();
}
}
/**
* Remove the user from the database.
*
* @param SubscriptionRequest $request The specified subscription.
* @return \Illuminate\Http\Response
*/
public function destroyByEmail(SubscriptionRequest $request)
{
$subscription = Subscription::where('email', $request->email)->first();
if ($subscription !== null) {
$subscription->delete();
dispatch((new SendEmailJob($request->email, new SubscriptionUnsubscribed($request->email))))->onQueue('mail');
}
return $this->respondNoContent();
}
}

View File

@@ -73,7 +73,10 @@ class UserController extends ApiController
{ {
if (UserConductor::creatable() === true) { if (UserConductor::creatable() === true) {
$user = User::create($request->all()); $user = User::create($request->all());
return $this->respondAsResource(UserConductor::model($request, $user), ['respondCode' => HttpResponseCodes::HTTP_CREATED]); return $this->respondAsResource(
UserConductor::model($request, $user),
['respondCode' => HttpResponseCodes::HTTP_CREATED]
);
} else { } else {
return $this->respondForbidden(); return $this->respondForbidden();
} }
@@ -145,6 +148,7 @@ class UserController extends ApiController
* Register a new user * Register a new user
* *
* @param \App\Http\Requests\UserRegisterRequest $request The register user request. * @param \App\Http\Requests\UserRegisterRequest $request The register user request.
* @return JsonResponse
*/ */
public function register(UserRegisterRequest $request): JsonResponse public function register(UserRegisterRequest $request): JsonResponse
{ {
@@ -285,6 +289,7 @@ class UserController extends ApiController
* Resend a new verify email * Resend a new verify email
* *
* @param \App\Http\Requests\UserResendVerifyEmailRequest $request The resend verify email request. * @param \App\Http\Requests\UserResendVerifyEmailRequest $request The resend verify email request.
* @return JsonResponse
*/ */
public function resendVerifyEmail(UserResendVerifyEmailRequest $request): JsonResponse public function resendVerifyEmail(UserResendVerifyEmailRequest $request): JsonResponse
{ {
@@ -338,10 +343,15 @@ class UserController extends ApiController
* *
* @param Request $request The http request. * @param Request $request The http request.
* @param User $user The specified user. * @param User $user The specified user.
* @return JsonResponse
*/ */
public function eventList(Request $request, User $user): JsonResponse public function eventList(Request $request, User $user): JsonResponse
{ {
if ($request->user() !== null && ($request->user() === $user || $request->user()->hasPermission('admin/events') === true)) { if (
$request->user() !== null && (
$request->user() === $user || $request->user()->hasPermission('admin/events') === true
)
) {
$collection = $user->events; $collection = $user->events;
$total = $collection->count(); $total = $collection->count();

View File

@@ -43,6 +43,7 @@ class Kernel extends HttpKernel
\Illuminate\Routing\Middleware\ThrottleRequests::class . ':api', \Illuminate\Routing\Middleware\ThrottleRequests::class . ':api',
\Illuminate\Routing\Middleware\SubstituteBindings::class, \Illuminate\Routing\Middleware\SubstituteBindings::class,
// \App\Http\Middleware\ForceJsonResponse::class, // \App\Http\Middleware\ForceJsonResponse::class,
\App\Http\Middleware\UnmangleRequest::class,
'useSanctumGuard', 'useSanctumGuard',
\App\Http\Middleware\LogRequest::class, \App\Http\Middleware\LogRequest::class,
], ],
@@ -62,6 +63,7 @@ class Kernel extends HttpKernel
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'unmangle' => \App\Http\Middleware\UnmangleRequest::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'signed' => \App\Http\Middleware\ValidateSignature::class, 'signed' => \App\Http\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,

View File

@@ -10,11 +10,14 @@ class Authenticate extends Middleware
* Get the path the user should be redirected to when they are not authenticated. * Get the path the user should be redirected to when they are not authenticated.
* *
* @param mixed $request Request. * @param mixed $request Request.
* @return ?string
*/ */
protected function redirectTo(mixed $request): ?string protected function redirectTo(mixed $request): ?string
{ {
if ($request->expectsJson() === false) { if ($request->expectsJson() === false) {
return route('login'); return route('login');
} }
return null;
} }
} }

View File

@@ -2,17 +2,19 @@
namespace App\Http\Middleware; namespace App\Http\Middleware;
use App\Models\AnalyticsItemRequest;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Closure; use Closure;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Models\Analytics;
class LogRequest class LogRequest
{ {
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next * @param Illuminate\Http\Request $request HTTP Request.
* @param \Closure $next Closure.
* @return Symfony\Component\HttpFoundation\Response
*/ */
public function handle(Request $request, Closure $next): Response public function handle(Request $request, Closure $next): Response
{ {
@@ -20,11 +22,9 @@ class LogRequest
$response = $next($request); $response = $next($request);
try { try {
Analytics::createWithSession([ AnalyticsItemRequest::create([
'type' => 'apirequest', 'type' => 'apirequest',
'attribute' => $request->path(), 'path' => $request->path(),
'useragent' => $request->userAgent(),
'ip' => $request->ip(),
]); ]);
return $response; return $response;

View File

@@ -13,9 +13,10 @@ class RedirectIfAuthenticated
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
* @param Request $request Request. * @param Request $request Request.
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next * @param \Closure $next Closure.
* @param string|null ...$guards Guards. * @param string|null ...$guards Guards.
* @return Response
*/ */
public function handle(Request $request, Closure $next, string ...$guards): Response public function handle(Request $request, Closure $next, string ...$guards): Response
{ {

View File

@@ -0,0 +1,47 @@
<?php
namespace App\Http\Middleware;
use Symfony\Component\HttpFoundation\Response;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class UnmangleRequest
{
/**
* Handle an incoming request.
*
* @param Request $request Request.
* @param \Closure $next Next.
* @param string|null ...$guards Guards.
* @return Response response.
*/
public function handle(Request $request, Closure $next, string ...$guards): Response
{
if (isset($_SERVER['QUERY_STRING']) === true) {
$params = $request->all();
$string = $_SERVER['QUERY_STRING'];
$parts = explode('&', $string);
foreach ($parts as $part) {
$key = $part;
$splitPos = strpos($key, '=');
if ($splitPos !== false) {
$key = urldecode(substr($key, 0, $splitPos));
}
$replace_key = str_replace('.', '_', $key);
if (strpos($key, '.') !== false && array_key_exists($replace_key, $params) === true) {
$params[$key] = $params[$replace_key];
unset($params[$replace_key]);
}
}
$request->replace($params);
}//end if
return $next($request);
}
}

View File

@@ -12,7 +12,9 @@ class UseSanctumGuard
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next * @param Request $request Request object.
* @param \Closure $next Closure object.
* @return Response
*/ */
public function handle(Request $request, Closure $next): Response public function handle(Request $request, Closure $next): Response
{ {

View File

@@ -9,12 +9,18 @@ class BaseRequest extends FormRequest
{ {
/** /**
* Determine if the user is authorized to make this request. * Determine if the user is authorized to make this request.
*
* @return boolean
*/ */
public function authorize(): bool public function authorize(): bool
{ {
if (request()->isMethod('post') === true && method_exists($this, 'postAuthorize') === true) { if (request()->isMethod('post') === true && method_exists($this, 'postAuthorize') === true) {
return $this->postAuthorize(); return $this->postAuthorize();
} elseif ((request()->isMethod('put') === true || request()->isMethod('patch') === true) && method_exists($this, 'putAuthorize') === true) { } elseif (
(
request()->isMethod('put') === true || request()->isMethod('patch') === true
) && method_exists($this, 'putAuthorize') === true
) {
return $this->putAuthorize(); return $this->putAuthorize();
} elseif (request()->isMethod('delete') === true && method_exists($this, 'destroyAuthorize') === true) { } elseif (request()->isMethod('delete') === true && method_exists($this, 'destroyAuthorize') === true) {
return $this->deleteAuthorize(); return $this->deleteAuthorize();
@@ -38,7 +44,11 @@ class BaseRequest extends FormRequest
if (method_exists($this, 'postRules') === true && request()->isMethod('post') === true) { if (method_exists($this, 'postRules') === true && request()->isMethod('post') === true) {
$rules = $this->mergeRules($rules, $this->postRules()); $rules = $this->mergeRules($rules, $this->postRules());
} elseif (method_exists($this, 'putRules') === true && (request()->isMethod('put') === true || request()->isMethod('patch') === true)) { } elseif (
method_exists($this, 'putRules') === true && (
request()->isMethod('put') === true || request()->isMethod('patch') === true
)
) {
$rules = $this->mergeRules($rules, $this->putRules()); $rules = $this->mergeRules($rules, $this->putRules());
} elseif (method_exists($this, 'destroyRules') === true && request()->isMethod('delete') === true) { } elseif (method_exists($this, 'destroyRules') === true && request()->isMethod('delete') === true) {
$rules = $this->mergeRules($rules, $this->destroyRules()); $rules = $this->mergeRules($rules, $this->destroyRules());
@@ -52,6 +62,7 @@ class BaseRequest extends FormRequest
* *
* @param array $collection1 The first collection of rules. * @param array $collection1 The first collection of rules.
* @param array $collection2 The second collection of rules to merge. * @param array $collection2 The second collection of rules to merge.
* @return array
*/ */
private function mergeRules(array $collection1, array $collection2): array private function mergeRules(array $collection1, array $collection2): array
{ {

View File

@@ -23,7 +23,7 @@ class EventRequest extends BaseRequest
'end_at' => 'date|after:start_date', 'end_at' => 'date|after:start_date',
'publish_at' => 'date|nullable', 'publish_at' => 'date|nullable',
'status' => [ 'status' => [
Rule::in(['draft', 'soon', 'open', 'closed', 'cancelled']), Rule::in(['draft', 'soon', 'open', 'closed', 'cancelled', 'scheduled', 'full']),
], ],
'registration_type' => [ 'registration_type' => [
Rule::in(['none', 'email', 'link', 'message']), Rule::in(['none', 'email', 'link', 'message']),
@@ -34,6 +34,7 @@ class EventRequest extends BaseRequest
Rule::when(strcasecmp('message', $this->attributes->get('registration_type')) == 0, 'required|message'), Rule::when(strcasecmp('message', $this->attributes->get('registration_type')) == 0, 'required|message'),
], ],
'hero' => 'uuid|exists:media,id', 'hero' => 'uuid|exists:media,id',
'location_url' => 'sometimes|string|max:255',
]; ];
} }

View File

@@ -2,7 +2,32 @@
namespace App\Http\Requests; namespace App\Http\Requests;
use Illuminate\Validation\Rule;
class MediaRequest extends BaseRequest class MediaRequest extends BaseRequest
{ {
/* empty */ /**
* POST request rules
*
* @return array
*/
public function postRules(): array
{
return [
'job_id' => [
Rule::requiredIf(function () {
return request()->has('chunk') && request('chunk') != 1;
}),
'string',
],
'name' => [
Rule::requiredIf(function () {
return request()->has('chunk') && request('chunk') == 1;
}),
'string',
],
'chunk' => 'required_with:chunk_count|integer|min:1|max:999|lte:chunk_count',
'chunk_count' => 'required_with:chunk|integer|min:1',
];
}
} }

View File

@@ -34,6 +34,8 @@ class SubscriptionRequest extends BaseRequest
/** /**
* Get the custom error messages. * Get the custom error messages.
*
* @return array
*/ */
public function messages(): array public function messages(): array
{ {

View File

@@ -21,8 +21,12 @@ class UserRequest extends BaseRequest
$isAdminUser = $user->hasPermission('admin/users'); $isAdminUser = $user->hasPermission('admin/users');
return [ return [
'first_name' => ($isAdminUser === true ? 'required_with:last_name,display_name,phone' : 'required') . '|string|max:255|min:2', 'first_name' => (
'last_name' => ($isAdminUser === true ? 'required_with:first_name,display_name,phone' : 'required') . '|string|max:255|min:2', $isAdminUser === true ? 'required_with:last_name,display_name,phone' : 'required'
) . '|string|max:255|min:2',
'last_name' => (
$isAdminUser === true ? 'required_with:first_name,display_name,phone' : 'required'
) . '|string|max:255|min:2',
'display_name' => [ 'display_name' => [
$isAdminUser === true ? 'required_with:first_name,last_name,phone' : 'required', $isAdminUser === true ? 'required_with:first_name,last_name,phone' : 'required',
'string', 'string',

393
app/Jobs/MediaWorkerJob.php Normal file
View File

@@ -0,0 +1,393 @@
<?php
namespace App\Jobs;
use App\Models\Media;
use App\Models\MediaJob;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use FFMpeg;
use FFMpeg\Coordinate\Dimension;
use FFMpeg\FFProbe;
use FFMpeg\Format\VideoInterface;
use Intervention\Image\Facades\Image;
/** @property on $format */
class MediaWorkerJob implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/**
* MediaJob item
*
* @var MediaJob
*/
protected $mediaJob;
/**
* Create a new job instance.
*
* @param MediaJob $mediaJob The mediaJob model.
* @return void
*/
public function __construct(MediaJob $mediaJob)
{
$this->mediaJob = $mediaJob;
}
/**
* Execute the job.
*
* @return void
*/
public function handle(): void
{
$media = $this->mediaJob->media()->first();
$newMedia = false;
$data = json_decode($this->mediaJob->data, true);
try {
// FILE
if (array_key_exists('file', $data) === true) {
if (file_exists($data['file']) === false) {
$this->throwMediaJobFailure('temporary upload file no longer exists');
}
// convert HEIC files to JPG
$fileExtension = File::extension($data['file']);
if ($fileExtension === 'heic') {
$this->mediaJob->setStatusProcessing(0, 0, 'converting image');
// Get the path without the file name
$uploadedFileDirectory = dirname($data['file']);
// Convert the HEIC file to JPG
$jpgFileName = pathinfo($data['file'], PATHINFO_FILENAME) . '.jpg';
$jpgFilePath = $uploadedFileDirectory . '/' . $jpgFileName;
if (file_exists($jpgFilePath) === true) {
$this->throwMediaJobFailure('file already exists on server');
}
Image::make($data['file'])->save($jpgFilePath);
// Update the uploaded file path and file name
unlink($data['file']);
$data['file'] = $jpgFileName;
}//end if
// get security
$security = [];
if ($media === null) {
if (array_key_exists('security', $data) === true) {
$security = $data['security'];
}
} else {
$security['type'] = $media->security_type;
$security['data'] = $media->security_data;
}
// get storage
$storage = '';
if ($media === null) {
if (array_key_exists('storage', $data) === true) {
$storage = $data['storage'];
}
} else {
$storage = $media->storage;
}
if ($storage === '') {
if (count($security) === 0 || $security['type'] === '') {
if (strpos($data['mime_type'], 'image/') === 0) {
$storage = 'local';
} else {
$storage = 'cdn';
}
} else {
$storage = 'private';
}
}
// Check if file already exists
$exists = Storage::disk($storage)->exists($data['name']);
if ($exists === true) {
if (array_key_exists('noreplace', $data) === true && isTrue($data['noreplace']) === true) {
$this->throwMediaJobFailure('file already exists on server');
}
}
if ($exists === true) {
$pathInfo = pathinfo($data['name']);
$basename = $pathInfo['filename'];
$extension = $pathInfo['extension'];
$index = 0;
do {
$index++;
$data['name'] = $basename . '-' . $index . '.' . $extension;
} while (Storage::disk($storage)->exists($data['name']) === true);
}
if ($media === null) {
$newMedia = true;
$media = new Media([
'user_id' => $this->mediaJob->user_id,
'title' => $data['title'],
'name' => $data['name'],
'mime_type' => $data['mime_type'],
'size' => $data['size'],
'security_type' => $data['security']['type'],
'security_data' => $data['security']['data'],
'storage' => $storage,
]);
}//end if
$media->setStagingFile($data['file']);
} else {
if ($media === null) {
$this->throwMediaJobFailure('The media item no longer exists');
}
}//end if
if (array_key_exists('transform', $data) === true) {
$media->createStagingFile();
// Modifications
if (strpos($media->mime_type, 'image/') === 0) {
$modified = false;
$image = Image::make($media->getStagingFilePath());
// ROTATE
if (array_key_exists("rotate", $data['transform']) === true) {
$rotate = intval($data['transform']['rotate']);
if ($rotate !== 0) {
$this->mediaJob->setStatusProcessing(0, 0, 'rotating image');
$image = $image->rotate($rotate);
$modified = true;
}
}
// FLIP-H/V
if (array_key_exists('flip', $data['transform']) === true) {
if (stripos($data['transform']['flip'], 'h') !== false) {
$this->mediaJob->setStatusProcessing(0, 0, 'flipping image');
$image = $image->flip('h');
$modified = true;
}
if (stripos($data['transform']['flip'], 'v') !== false) {
$this->mediaJob->setStatusProcessing(0, 0, 'flipping image');
$image = $image->flip('v');
$modified = true;
}
}
// CROP
if (array_key_exists("crop", $data['transform']) === true) {
$cropData = $data['transform']['crop'];
$width = intval(arrayDefaultValue("width", $cropData, $image->getWidth()));
$height = intval(arrayDefaultValue("height", $cropData, $image->getHeight()));
$x = intval(arrayDefaultValue("x", $cropData, 0));
$y = intval(arrayDefaultValue("y", $cropData, 0));
$this->mediaJob->setStatusProcessing(0, 0, 'cropping image');
$image = $image->crop($width, $height, $x, $y);
$modified = true;
}//end if
if ($modified === true) {
$image->save();
}
} elseif (strpos($data['mime_type'], 'video/') === 0) {
$stagingFilePath = $media->getStagingFilePath();
$ffmpeg = FFMpeg\FFMpeg::create();
$video = $ffmpeg->open($stagingFilePath);
$format = $this->detectVideoFormat($stagingFilePath);
$modified = false;
if ($format === null) {
$this->mediaJob->setStatusFailed('Unsupported video format');
return;
}
/** @var FFMpeg\Media\Video::filters */
$filters = $video->filters();
// ROTATE
if (array_key_exists("rotate", $data['transform']) === true) {
$rotate = intval($data['transform']['rotate']);
$rotate = (($rotate % 360 + 360) % 360); // remove excess rotations
$rotate = intval(round($rotate / 90) * 90); // round to nearest 90%
if ($rotate > 0) {
$this->mediaJob->setStatusProcessing(0, 0, 'rotating video');
if ($rotate === 90) {
$filters->rotate(FFMpeg\Filters\Video\RotateFilter::ROTATE_270);
$modified = true;
} elseif ($rotate === 180) {
$filters->rotate(FFMpeg\Filters\Video\RotateFilter::ROTATE_180);
$modified = true;
} elseif ($rotate === 270) {
$filters->rotate(FFMpeg\Filters\Video\RotateFilter::ROTATE_90);
$modified = true;
}
}
}
// FLIP-H/V
if (array_key_exists('flip', $data['transform']) === true) {
if (stripos($data['transform']['flip'], 'h') !== false) {
$this->mediaJob->setStatusProcessing(0, 0, 'flipping video');
$filters->hflip()->synchronize();
$modified = true;
}
if (stripos($data['transform']['flip'], 'v') !== false) {
$this->mediaJob->setStatusProcessing(0, 0, 'flipping video');
$filters->vflip()->synchronize();
$modified = true;
}
}
// CROP
if (array_key_exists("crop", $data['transform']) === true) {
$cropData = $data['transform']['crop'];
$videoStream = $video->getStreams()->videos()->first();
$width = intval(arrayDefaultValue("width", $cropData, $videoStream->get('width')));
$height = intval(arrayDefaultValue("height", $cropData, $videoStream->get('height')));
$x = intval(arrayDefaultValue("x", $cropData, 0));
$y = intval(arrayDefaultValue("y", $cropData, 0));
$cropDimension = new Dimension($width, $height);
$this->mediaJob->setStatusProcessing(0, 0, 'cropping video');
$filters->crop($cropDimension, $x, $y)->synchronize();
$modified = true;
}//end if
$tempFilePath = generateTempFilePath(pathinfo($stagingFilePath, PATHINFO_EXTENSION));
if (method_exists($format, 'on') === true) {
$mediaJob = $this->mediaJob;
$format->on('progress', function ($video, $format, $percentage) use ($mediaJob) {
$mediaJob->setStatusProcessing($percentage, 100, 'transcoded');
});
}
if ($modified === true) {
$video->save($format, $tempFilePath);
$media->changeStagingFile($tempFilePath);
}
}//end if
}//end if
// Update attributes
if (array_key_exists('title', $data) === true) {
$media->title = $data['title'];
}
// Relocate file (if requested)
if (array_key_exists('security', $data) === true && array_key_exists('type', $data['security']) === true) {
$media->security_type = $data['security']['type'];
$media->security_data = $data['security']['data'];
}
if (array_key_exists('storage', $data) === true) {
if ($media->storage !== $data['storage']) {
$media->createStagingFile();
Storage::disk($media->storage)->delete($media->name);
$media->storage = $data['storage'];
}
}
// Finish media object
if ($media->hasStagingFile() === true) {
$this->mediaJob->setStatusProcessing(0, 0, 'transferring to cdn');
$media->deleteFile();
$media->saveStagingFile(true);
}
$media->save();
$this->mediaJob->media_id = $media->id;
$this->mediaJob->setStatusComplete();
} catch (\Exception $e) {
if ($this->mediaJob->status !== 'failed') {
$this->mediaJob->setStatusFailed('Unexpected server error occurred');
}
if ($media !== null) {
$media->deleteStagingFile();
if ($newMedia === true) {
$media->delete();
}
}
Log::error($e->getMessage() . "\n" . $e->getFile() . " - " . $e->getLine() . "\n" . $e->getTraceAsString());
$this->fail($e);
}//end try
}
/**
* Detects the format of a video using FFProbe
*
* @param string $videoPath The video file path.
* @return VideoInterface | null
*/
public function detectVideoFormat(string $videoPath): VideoInterface | null
{
$ffprobe = FFProbe::create();
$videoStream = $ffprobe
->streams($videoPath) // Provide the path to the video file
->videos() // Filter video streams
->first();
$codecName = $videoStream->get('codec_name');
$codecToFormatClass = [
'h264' => 'FFMpeg\Format\Video\X264',
'wmv2' => 'FFMpeg\Format\Video\WMV',
'vp9' => 'FFMpeg\Format\Video\WebM',
'theora' => 'FFMpeg\Format\Video\Ogg',
'mpeg4' => 'FFMpeg\Format\Video\Mpeg4',
// Add more mappings as needed
];
if (isset($codecToFormatClass[$codecName]) === false) {
Log::info("Unsupported codec: $codecName");
return null;
}
$formatClassName = $codecToFormatClass[$codecName];
if (class_exists($formatClassName) === false) {
Log::info("Format class does not exist: $formatClassName");
return null;
}
return new $formatClassName();
}
/**
* Set failure status of MediaJob and throw exception.
*
* @param string $error The failure message.
* @return void
*/
private function throwMediaJobFailure(string $error): void
{
$this->mediaJob->setStatusFailed($error);
throw new \Exception($error);
}
}

View File

@@ -1,82 +0,0 @@
<?php
namespace App\Jobs;
use App\Models\Media;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Storage;
class MoveMediaJob implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/**
* Media item
*
* @var Media
*/
public $media;
/**
* New storage ID
*
* @var string
*/
protected $newStorage;
/**
* Create a new job instance.
*
* @param Media $media The media model.
* @param string $newStorage The new storage ID.
* @return void
*/
public function __construct(Media $media, string $newStorage)
{
$this->media = $media;
$this->newStorage = $newStorage;
}
/**
* Execute the job.
*/
public function handle(): void
{
// Don't continue if the media is already on the new storage disk
if ($this->media->storage === $this->newStorage) {
return;
}
$this->media->status = 'Moving file';
$this->media->save();
$files = ["/{$this->media->name}"];
if (empty($this->media->variants) === false) {
foreach ($this->media->variants as $variant => $name) {
$files[] = "/{$name}";
}
}
$this->media->invalidateCFCache();
// Move the files from the old storage disk to the new storage disk
foreach ($files as $file) {
Storage::disk($this->newStorage)->put($file, Storage::disk($this->media->storage)->get($file));
Storage::disk($this->media->storage)->delete($file);
}
// Update the media model with the new storage and save it to the database
$this->media->storage = $this->newStorage;
$this->media->status = 'OK';
$this->media->save();
}
}

View File

@@ -47,6 +47,8 @@ class SendEmailJob implements ShouldQueue
/** /**
* Execute the job. * Execute the job.
*
* @return void
*/ */
public function handle(): void public function handle(): void
{ {

View File

@@ -1,177 +0,0 @@
<?php
namespace App\Jobs;
use App\Models\Media;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use SplFileInfo;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Intervention\Image\Facades\Image;
use Spatie\ImageOptimizer\OptimizerChainFactory;
class StoreUploadedFileJob implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/**
* Media item
*
* @var Media
*/
protected $media;
/**
* Uploaded file item
*
* @var string
*/
protected $uploadedFilePath;
/**
* Replace existing files
*
* @var string
*/
protected $replaceExisting;
/**
* Create a new job instance.
*
* @param Media $media The media model.
* @param string $filePath The uploaded file.
* @param boolean $replaceExisting Replace existing files.
* @return void
*/
public function __construct(Media $media, string $filePath, bool $replaceExisting = true)
{
$this->media = $media;
$this->uploadedFilePath = $filePath;
$this->replaceExisting = $replaceExisting;
}
/**
* Execute the job.
*/
public function handle(): void
{
$storageDisk = $this->media->storage;
$fileName = $this->media->name;
try {
$this->media->status = "Uploading to CDN";
$this->media->save();
if (strlen($this->uploadedFilePath) > 0) {
if (Storage::disk($storageDisk)->exists($fileName) === false || $this->replaceExisting === true) {
Storage::disk($storageDisk)->putFileAs('/', new SplFileInfo($this->uploadedFilePath), $fileName);
Log::info("uploading file {$storageDisk} / {$fileName} / {$this->uploadedFilePath}");
} else {
Log::info("file {$fileName} already exists in {$storageDisk} / {$this->uploadedFilePath}. Not replacing file and using local {$fileName} for variants.");
}
} else {
if (Storage::disk($storageDisk)->exists($fileName) === true) {
Log::info("file {$fileName} already exists in {$storageDisk} / {$this->uploadedFilePath}. No local {$fileName} for variants, downloading from CDN.");
$readStream = Storage::disk($storageDisk)->readStream($fileName);
$tempFilePath = tempnam(sys_get_temp_dir(), 'download-');
$writeStream = fopen($tempFilePath, 'w');
while (feof($readStream) !== true) {
fwrite($writeStream, fread($readStream, 8192));
}
fclose($readStream);
fclose($writeStream);
$this->uploadedFilePath = $tempFilePath;
} else {
$errorStr = "cannot upload file {$storageDisk} / {$fileName} / {$this->uploadedFilePath} as temp file is empty";
Log::info($errorStr);
throw new \Exception($errorStr);
}
}//end if
if (strpos($this->media->mime_type, 'image/') === 0) {
$this->media->status = "Optimizing image";
$this->media->save();
// Generate additional image sizes
$sizes = Media::getTypeVariants('image');
$originalImage = Image::make($this->uploadedFilePath);
$dimensions = [$originalImage->getWidth(), $originalImage->getHeight()];
$this->media->dimensions = implode('x', $dimensions);
foreach ($sizes as $variantName => $size) {
$postfix = "{$size['width']}x{$size['height']}";
if ($variantName === 'scaled') {
$postfix = 'scaled';
}
if (is_array($this->media->variants) === true && array_key_exists($postfix, $this->media->variants) === true && Storage::disk($storageDisk)->exists($this->media->variants[$postfix]) === true && $this->replaceExisting === true) {
Storage::disk($storageDisk)->delete($this->media->variants[$postfix]);
}
$newFilename = pathinfo($this->media->name, PATHINFO_FILENAME) . "-$postfix.webp";
if (Storage::disk($storageDisk)->exists($newFilename) === false || $this->replaceExisting === true) {
// Get the largest available variant
if ($dimensions[0] >= $size['width'] && $dimensions[1] >= $size['height']) {
// Store the variant in the variants array
$variants[$variantName] = $newFilename;
// Resize the image to the variant size if its dimensions are greater than the specified size
$image = clone $originalImage;
$imageSize = $image->getSize();
if ($imageSize->getWidth() > $size['width'] || $imageSize->getHeight() > $size['height']) {
$image->resize($size['width'], $size['height'], function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
});
$image->resizeCanvas($size['width'], $size['height'], 'center', false, '#FFFFFF');
}
// Optimize and store image
$tempImagePath = tempnam(sys_get_temp_dir(), 'optimize');
$image->encode('webp', 75)->save($tempImagePath);
Storage::disk($storageDisk)->putFileAs('/', new SplFileInfo($tempImagePath), $newFilename);
unlink($tempImagePath);
}//end if
} else {
Log::info("variant {$variantName} already exists for file {$fileName}");
}//end if
}//end foreach
// Set missing variants to the largest available variant
foreach ($sizes as $variantName => $size) {
if (isset($variants[$variantName]) === false) {
$variants[$variantName] = $this->media->name;
}
}
$this->media->variants = $variants;
}//end if
if (strlen($this->uploadedFilePath) > 0) {
unlink($this->uploadedFilePath);
}
$this->media->status = 'OK';
$this->media->save();
} catch (\Exception $e) {
Log::error($e->getMessage());
$this->media->status = "Failed";
$this->media->save();
$this->fail($e);
}//end try
}
}

View File

@@ -54,6 +54,8 @@ class ChangeEmailVerify extends Mailable
/** /**
* Get the message envelope. * Get the message envelope.
*
* @return Illuminate\Mail\Mailables\Envelope
*/ */
public function envelope(): Envelope public function envelope(): Envelope
{ {
@@ -64,6 +66,8 @@ class ChangeEmailVerify extends Mailable
/** /**
* Get the message content definition. * Get the message content definition.
*
* @return Illuminate\Mail\Mailables\Content
*/ */
public function content(): Content public function content(): Content
{ {

View File

@@ -54,6 +54,8 @@ class ChangedEmail extends Mailable
/** /**
* Get the message envelope. * Get the message envelope.
*
* @return Illuminate\Mail\Mailables\Envelope
*/ */
public function envelope(): Envelope public function envelope(): Envelope
{ {
@@ -64,6 +66,8 @@ class ChangedEmail extends Mailable
/** /**
* Get the message content definition. * Get the message content definition.
*
* @return Illuminate\Mail\Mailables\Content
*/ */
public function content(): Content public function content(): Content
{ {

View File

@@ -36,6 +36,8 @@ class ChangedPassword extends Mailable
/** /**
* Get the message envelope. * Get the message envelope.
*
* @return Illuminate\Mail\Mailables\Envelope
*/ */
public function envelope(): Envelope public function envelope(): Envelope
{ {
@@ -46,6 +48,8 @@ class ChangedPassword extends Mailable
/** /**
* Get the message content definition. * Get the message content definition.
*
* @return Illuminate\Mail\Mailables\Content
*/ */
public function content(): Content public function content(): Content
{ {

View File

@@ -53,6 +53,8 @@ class Contact extends Mailable
/** /**
* Get the message envelope. * Get the message envelope.
*
* @return Illuminate\Mail\Mailables\Envelope
*/ */
public function envelope(): Envelope public function envelope(): Envelope
{ {
@@ -63,6 +65,8 @@ class Contact extends Mailable
/** /**
* Get the message content definition. * Get the message content definition.
*
* @return Illuminate\Mail\Mailables\Content
*/ */
public function content(): Content public function content(): Content
{ {

View File

@@ -45,6 +45,8 @@ class EmailVerify extends Mailable
/** /**
* Get the message envelope. * Get the message envelope.
*
* @return Illuminate\Mail\Mailables\Envelope
*/ */
public function envelope(): Envelope public function envelope(): Envelope
{ {
@@ -55,6 +57,8 @@ class EmailVerify extends Mailable
/** /**
* Get the message content definition. * Get the message content definition.
*
* @return Illuminate\Mail\Mailables\Content
*/ */
public function content(): Content public function content(): Content
{ {

View File

@@ -0,0 +1,59 @@
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class ExceptionMail extends Mailable
{
use Queueable;
use SerializesModels;
/**
* Create a new message instance.
*/
public function __construct()
{
//
}
/**
* Get the message envelope.
*
* @return Illuminate\Mail\Mailables\Envelope
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Exception Mail',
);
}
/**
* Get the message content definition.
*
* @return Illuminate\Mail\Mailables\Content
*/
public function content(): Content
{
return new Content(
view: 'view.name',
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}

View File

@@ -45,6 +45,8 @@ class ForgotPassword extends Mailable
/** /**
* Get the message envelope. * Get the message envelope.
*
* @return Illuminate\Mail\Mailables\Envelope
*/ */
public function envelope(): Envelope public function envelope(): Envelope
{ {
@@ -55,6 +57,8 @@ class ForgotPassword extends Mailable
/** /**
* Get the message content definition. * Get the message content definition.
*
* @return Illuminate\Mail\Mailables\Content
*/ */
public function content(): Content public function content(): Content
{ {

View File

@@ -36,6 +36,8 @@ class SubscriptionConfirm extends Mailable
/** /**
* Get the message envelope. * Get the message envelope.
*
* @return Illuminate\Mail\Mailables\Envelope
*/ */
public function envelope(): Envelope public function envelope(): Envelope
{ {
@@ -46,6 +48,8 @@ class SubscriptionConfirm extends Mailable
/** /**
* Get the message content definition. * Get the message content definition.
*
* @return Illuminate\Mail\Mailables\Content
*/ */
public function content(): Content public function content(): Content
{ {

View File

@@ -36,6 +36,8 @@ class SubscriptionUnsubscribed extends Mailable
/** /**
* Get the message envelope. * Get the message envelope.
*
* @return Illuminate\Mail\Mailables\Envelope
*/ */
public function envelope(): Envelope public function envelope(): Envelope
{ {
@@ -46,6 +48,8 @@ class SubscriptionUnsubscribed extends Mailable
/** /**
* Get the message content definition. * Get the message content definition.
*
* @return Illuminate\Mail\Mailables\Content
*/ */
public function content(): Content public function content(): Content
{ {

View File

@@ -1,44 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Analytics extends Model
{
use HasFactory;
/**
* The attributes that aren't mass assignable.
*
* @var array
*/
protected $guarded = [];
/**
* Create a new row in the analytics table with the given attributes,
* automatically assigning a session value based on previous rows.
*
* @param array $attributes Model attributes.
*/
public static function createWithSession(array $attributes): static
{
$previousRow = self::where('useragent', $attributes['useragent'])
->where('ip', $attributes['ip'])
->where('created_at', '>=', now()->subMinutes(30))
->whereNotNull('session')
->orderBy('created_at', 'desc')
->first();
if ($previousRow !== null) {
$attributes['session'] = $previousRow->session;
} else {
$lastSession = self::max('session');
$attributes['session'] = ($lastSession + 1);
}
return static::create($attributes);
}
}

View File

@@ -0,0 +1,73 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class AnalyticsItemRequest extends Model
{
use HasFactory;
/**
* The table name
*
* @var string
*/
protected $table = 'analytics_requests';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'type',
'path'
];
/**
* Model Boot.
*
* @return void
*/
protected static function boot()
{
parent::boot();
static::creating(function (AnalyticsItemRequest $analytics) {
if (isset($analytics->session_id) !== true) {
$request = request();
if ($request !== null) {
$session = AnalyticsSession::where('ip', $request->ip())
->where('useragent', $request->userAgent())
->where('ended_at', '>=', now()->subMinutes(30))
->first();
if ($session === null) {
$session = AnalyticsSession::create([
'ip' => $request->ip(),
'useragent' => $request->userAgent(),
'ended_at' => now()
]);
} else {
$session->update(['ended_at' => now()]);
}
$analytics->session_id = $session->id;
}
}//end if
});
}
/**
* Return the Analytics Session model.
*
* @return BelongsTo
*/
public function session(): BelongsTo
{
return $this->belongsTo(AnalyticsSession::class, 'id', 'session_id');
}
}

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class AnalyticsSession extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'ip',
'useragent',
'ended_at'
];
/**
* Set the "useragent" attribute.
*
* @param mixed $value
* @return void
*/
public function setUseragentAttribute($value)
{
$this->attributes['useragent'] = $value !== null ? $value : '';
}
/**
* Returns the related requests for this session.
*
* @return Illuminate\Database\Eloquent\Relations\HasMany
*/
public function requests(): HasMany {
return $this->hasMany(AnalyticsItemRequest::class, 'session_id', 'id');
}
}

View File

@@ -2,15 +2,19 @@
namespace App\Models; namespace App\Models;
use App\Traits\HasAttachments;
use App\Traits\HasGallery;
use App\Traits\Uuids; use App\Traits\Uuids;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Article extends Model class Article extends Model
{ {
use HasFactory; use HasFactory;
use Uuids; use Uuids;
use HasGallery;
use HasAttachments;
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
@@ -29,17 +33,11 @@ class Article extends Model
/** /**
* Get the article user * Get the article user
*
* @return Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */
public function user(): BelongsTo public function user(): BelongsTo
{ {
return $this->belongsTo(User::class); return $this->belongsTo(User::class);
} }
/**
* Get all of the article's attachments.
*/
public function attachments(): MorphMany
{
return $this->morphMany(\App\Models\Attachment::class, 'attachable');
}
} }

View File

@@ -5,7 +5,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Support\Facades\Cache;
class Attachment extends Model class Attachment extends Model
{ {
@@ -27,23 +27,60 @@ class Attachment extends Model
* @var string[] * @var string[]
*/ */
protected $attributes = [ protected $attributes = [
'private' => 'false', 'private' => false,
]; ];
/**
* Get attachments attachable
*/
public function attachable(): MorphTo
{
return $this->morphTo();
}
/** /**
* Get the media for this attachment. * Get the media for this attachment.
*
* @return BelongsTo
*/ */
public function media(): BelongsTo public function media(): BelongsTo
{ {
return $this->belongsTo(Media::class); return $this->belongsTo(Media::class);
} }
/**
* Get associated Media object.
*
* @return null|Media
*/
public function getMediaAttribute(): ?Media
{
$mediaId = '0';
$media = null;
if (Cache::has("attachment:{$this->id}:media") === true) {
$mediaId = Cache::get("attachment:{$this->id}:media");
} else {
$media = $this->media()->first();
if ($media === null) {
return null;
}
$mediaId = $media->id;
Cache::put("attachment:{$this->id}:media", $mediaId, now()->addDays(28));
}
return Cache::remember("media:{$mediaId}", now()->addDays(28), function () use ($media) {
if ($media !== null) {
return $media;
}
return $this->media()->first();
});
}
/**
* Set the media for this item.
*
* @param Media $media The media model.
* @return void
*/
public function setMediaAttribute(Media $media): void
{
$this->media()->associate($media)->save();
Cache::put("attachment:{$this->id}:media", $media->id, now()->addDays(28));
}
} }

View File

@@ -2,6 +2,7 @@
namespace App\Models; namespace App\Models;
use App\Traits\HasAttachments;
use App\Traits\Uuids; use App\Traits\Uuids;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
@@ -10,6 +11,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
class Event extends Model class Event extends Model
{ {
use HasAttachments;
use HasFactory; use HasFactory;
use Uuids; use Uuids;
@@ -33,19 +35,14 @@ class Event extends Model
'content', 'content',
'price', 'price',
'ages', 'ages',
'open_at',
]; ];
/**
* Get all of the article's attachments.
*/
public function attachments(): MorphMany
{
return $this->morphMany(\App\Models\Attachment::class, 'attachable');
}
/** /**
* Get all the associated users. * Get all the associated users.
*
* @return BelongsToMany
*/ */
public function users(): BelongsToMany public function users(): BelongsToMany
{ {

View File

@@ -5,6 +5,7 @@ namespace App\Models;
use App\Traits\Uuids; use App\Traits\Uuids;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class EventUser extends Model class EventUser extends Model
{ {
@@ -24,6 +25,8 @@ class EventUser extends Model
/** /**
* Get the event for this attachment. * Get the event for this attachment.
*
* @return Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */
public function event(): BelongsTo public function event(): BelongsTo
{ {
@@ -32,6 +35,8 @@ class EventUser extends Model
/** /**
* Get the user for this attachment. * Get the user for this attachment.
*
* @return Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */
public function user(): BelongsTo public function user(): BelongsTo
{ {

107
app/Models/Gallery.php Normal file
View File

@@ -0,0 +1,107 @@
<?php
namespace App\Models;
use App\Traits\Uuids;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Support\Facades\Cache;
class Gallery extends Model
{
use HasFactory;
use Uuids;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'media_id',
];
/**
* Boot the model.
*
* @return void
*/
protected static function boot(): void
{
parent::boot();
$clearCache = function ($gallery) {
Cache::forget("gallery:{$gallery->id}:media");
};
static::saving($clearCache);
static::deleting($clearCache);
}
/**
* Get gallery addendum model.
*
* @return Illuminate\Database\Eloquent\Relations\MorphTo Addenum model.
*/
public function addendum(): MorphTo
{
return $this->morphTo();
}
/**
* Get the media for this item.
*
* @return Illuminate\Database\Eloquent\Relations\BelongsTo The media model.
*/
public function media(): BelongsTo
{
return $this->belongsTo(Media::class);
}
/**
* Get the media for this item.
*
* @return null|Media The media model.
*/
public function getMediaAttribute(): ?Media
{
$mediaId = '0';
$media = null;
if (Cache::has("gallery:{$this->id}:media") === true) {
$mediaId = Cache::get("gallery:{$this->id}:media");
} else {
$media = $this->media()->first();
if ($media === null) {
return null;
}
$mediaId = $media->id;
Cache::put("gallery:{$this->id}:media", $mediaId, now()->addDays(28));
}
return Cache::remember("media:{$mediaId}", now()->addDays(28), function () use ($media) {
if ($media !== null) {
return $media;
}
return $this->media()->first();
});
}
/**
* Set the media for this item.
*
* @param Media $media The media model.
* @return void
*/
public function setMediaAttribute(Media $media): void
{
$this->media()->associate($media)->save();
Cache::put("gallery:{$this->id}:media", $media->id, now()->addDays(28));
}
}

File diff suppressed because it is too large Load Diff

239
app/Models/MediaJob.php Normal file
View File

@@ -0,0 +1,239 @@
<?php
namespace App\Models;
use App\Jobs\MediaWorkerJob;
use App\Traits\Uuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class MediaJob extends Model
{
use HasFactory;
use Uuids;
/**
* The default attributes.
*
* @var string[]
*/
protected $attributes = [
'user_id' => null,
'media_id' => null,
'status' => '',
'status_text' => '',
'progress' => 0,
'progress_max' => 0,
'data' => '',
];
/**
* Set MediaJob status to failed.
*
* @param string $statusText The failed reason.
* @return void
*/
public function setStatusFailed(string $statusText = ''): void
{
$this->setStatus('failed', $statusText, 0);
}
/**
* Set MediaJob status to queued.
*
* @return void
*/
public function setStatusQueued(): void
{
$this->setStatus('queued', '', 0);
}
/**
* Set MediaJob status to waiting.
*
* @return void
*/
public function setStatusWaiting(): void
{
$this->setStatus('waiting', '', 0);
}
/**
* Set MediaJob status to processing.
*
* @param integer $progress The processing progress value.
* @param integer $progressMax The processing progress maximum value.
* @param string $statusText The processing status text.
* @return void
*/
public function setStatusProcessing(int $progress = 0, int $progressMax = 0, string $statusText = ''): void
{
if ($statusText === '') {
$statusText = $this->status_text;
}
$this->setStatus('processing', $statusText, $progress, $progressMax);
}
/**
* Set MediaJob status to complete.
*
* @return void
*/
public function setStatusComplete(): void
{
$this->setStatus('complete');
}
/**
* Set MediaJon status to invalid.
*
* @param string $text The status text.
* @return void
*/
public function setStatusInvalid(string $text = ''): void
{
$this->setStatus('invalid', $text);
}
/**
* Set MediaJob status details.
*
* @param string $status The status string.
* @param string $text The status text.
* @param integer $progress The status progress value.
* @param integer $progress_max The status progress maximum value.
* @return void
*/
protected function setStatus(string $status, string $text = '', int $progress = 0, int $progress_max = 0): void
{
$this->status = $status;
$this->status_text = $text;
$this->progress = $progress;
$this->progress_max = $progress_max;
$this->save();
}
/**
* Process the MediaJob.
*
* @return void
*/
public function process(): void
{
$data = json_decode($this->data, true);
if ($data !== null) {
if (array_key_exists('chunks', $data) === true) {
if (array_key_exists('chunk_count', $data) === false) {
$this->setStatusInvalid('chunk_count is missing');
return;
}
if (array_key_exists('name', $data) === false) {
$this->setStatusInvalid('name is missing');
return;
}
$numChunks = count($data['chunks']);
$maxChunks = intval($data['chunk_count']);
if ($numChunks >= $maxChunks) {
// merge file and dispatch
$this->setStatusProcessing(0, $maxChunks, 'combining chunks');
$newFile = generateTempFilePath(pathinfo($data['name'], PATHINFO_EXTENSION));
$failed = false;
for ($index = 1; $index <= $maxChunks; $index++) {
if (array_key_exists($index, $data['chunks']) === false) {
$failed = `{$index} chunk is missing`;
} else {
$tempFileName = $data['chunks'][$index];
if ($failed === false) {
$chunkContents = file_get_contents($tempFileName);
if ($chunkContents === false) {
$failed = `{$index} chunk is empty`;
} else {
file_put_contents($newFile, $chunkContents, FILE_APPEND);
}
}
unlink($tempFileName);
$this->setStatusProcessing($index, $maxChunks);
}
}
unset($data['chunks']);
$this->data = json_encode($data);
if ($failed !== false) {
$this->setStatusInvalid($failed);
} else {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($finfo, $newFile);
finfo_close($finfo);
$data['file'] = $newFile;
$data['size'] = filesize($newFile);
$data['mime_type'] = $mime;
if (
array_key_exists('storage', $data) === true &&
array_key_exists('security_type', $data) === true &&
array_key_exists('mime_type', $data) === true &&
$data['mime_type'] !== ""
) {
$error = Media::verifyStorage($data['mime_type'], $data['security_type'], $data['storage']);
switch ($error) {
case Media::STORAGE_VALID:
break;
case Media::STORAGE_MIME_MISSING:
$this->setStatusInvalid('The file type cannot be determined.');
return;
case Media::STORAGE_NOT_FOUND:
$this->setStatusInvalid('Storage was not found.');
return;
case Media::STORAGE_INVALID_SECURITY:
$this->setStatusInvalid('Storage invalid for security value.');
return;
default:
$this->setStatusInvalid('Storage verification error occurred.');
return;
}
}
$this->data = json_encode($data);
$this->setStatusQueued();
MediaWorkerJob::dispatch($this)->onQueue('media');
}//end if
}//end if
} else {
$this->setStatusQueued();
MediaWorkerJob::dispatch($this)->onQueue('media');
}//end if
}//end if
}
/**
* Return the job owner
*
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* Return the media item
*
* @return BelongsTo
*/
public function media(): BelongsTo
{
return $this->belongsTo(Media::class);
}
}

View File

@@ -5,6 +5,7 @@ namespace App\Models;
use App\Traits\Uuids; use App\Traits\Uuids;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Permission extends Model class Permission extends Model
{ {
@@ -24,6 +25,8 @@ class Permission extends Model
/** /**
* Get the User associated with this model * Get the User associated with this model
*
* @return Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */
public function user(): BelongsTo public function user(): BelongsTo
{ {

View File

@@ -3,9 +3,7 @@
namespace App\Models; namespace App\Models;
use App\Enum\HttpResponseCodes; use App\Enum\HttpResponseCodes;
use App\Jobs\MoveMediaJob;
use App\Jobs\OptimizeMediaJob; use App\Jobs\OptimizeMediaJob;
use App\Jobs\StoreUploadedFileJob;
use App\Traits\Uuids; use App\Traits\Uuids;
use Illuminate\Contracts\Container\BindingResolutionException; use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;

View File

@@ -5,10 +5,13 @@ namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail; // use Illuminate\Contracts\Auth\MustVerifyEmail;
use App\Traits\Uuids; use App\Traits\Uuids;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Cache;
use Laravel\Sanctum\HasApiTokens; use Laravel\Sanctum\HasApiTokens;
use OwenIt\Auditing\Contracts\Auditable; use OwenIt\Auditing\Contracts\Auditable;
@@ -78,7 +81,29 @@ class User extends Authenticatable implements Auditable
/** /**
* Get the list of files of the user * Boot the model.
*
* @return void
*/
protected static function boot(): void
{
parent::boot();
$clearCache = function ($user) {
Cache::forget(
"user:{$user->id}",
"user:{$user->id}:permissions"
);
};
static::saving($clearCache);
static::deleting($clearCache);
}
/**
* Get the list of permissions of the user
*
* @return Illuminate\Database\Eloquent\Relations\HasMany
*/ */
public function permissions(): HasMany public function permissions(): HasMany
{ {
@@ -87,26 +112,50 @@ class User extends Authenticatable implements Auditable
/** /**
* Get the permission attribute * Get the permission attribute
*
* @return array
*/ */
public function getPermissionsAttribute(): array public function getPermissionsAttribute(): array
{ {
return $this->permissions()->pluck('permission')->toArray(); $cacheKey = "user:{$this->id}:permissions";
return Cache::remember($cacheKey, now()->addDays(28), function () {
return $this->permissions()->pluck('permission')->toArray();
});
}
/**
* Set the permission attribute
*
* @param array $newPermissions The new permissions to set to the user.
* @return void
*/
public function setPermissionsAttribute(array $newPermissions): void
{
$existingPermissions = $this->permissions->pluck('permission')->toArray();
$this->revokePermission(array_diff($this->permissions, $newPermissions));
$this->givePermission(array_diff($newPermissions, $this->permissions));
$cacheKey = "user:{$this->id}:permissions";
Cache::delete($cacheKey);
} }
/** /**
* Test if user has permission * Test if user has permission
* *
* @param string $permission Permission to test. * @param string $permission Permission to test.
* @return boolean
*/ */
public function hasPermission(string $permission): bool public function hasPermission(string $permission): bool
{ {
return ($this->permissions()->where('permission', $permission)->first() !== null); return in_array($permission, $this->permissions);
} }
/** /**
* Give permissions to the user * Give permissions to the user
* *
* @param string|array $permissions The permission(s) to give. * @param string|array $permissions The permission(s) to give.
* @return Illuminate\Database\Eloquent\Collection
*/ */
public function givePermission($permissions): Collection public function givePermission($permissions): Collection
{ {
@@ -114,16 +163,14 @@ class User extends Authenticatable implements Auditable
$permissions = [$permissions]; $permissions = [$permissions];
} }
$permissions = collect($permissions)->map(function ($permission) { $newPermissions = array_map(function ($permission) {
return ['permission' => $permission]; return ['permission' => $permission];
}); }, array_diff($permissions, $this->permissions));
$existingPermissions = $this->permissions()->whereIn('permission', $permissions->pluck('permission'))->get(); $cacheKey = "user:{$this->id}:permissions";
$newPermissions = $permissions->reject(function ($permission) use ($existingPermissions) { Cache::forget($cacheKey);
return $existingPermissions->contains('permission', $permission['permission']);
});
return $this->permissions()->createMany($newPermissions->toArray()); return $this->permissions()->createMany($newPermissions);
} }
@@ -131,6 +178,7 @@ class User extends Authenticatable implements Auditable
* Revoke permissions from the user * Revoke permissions from the user
* *
* @param string|array $permissions The permission(s) to revoke. * @param string|array $permissions The permission(s) to revoke.
* @return integer
*/ */
public function revokePermission($permissions): int public function revokePermission($permissions): int
{ {
@@ -138,6 +186,9 @@ class User extends Authenticatable implements Auditable
$permissions = [$permissions]; $permissions = [$permissions];
} }
$cacheKey = "user:{$this->id}:permissions";
Cache::forget($cacheKey);
return $this->permissions() return $this->permissions()
->whereIn('permission', $permissions) ->whereIn('permission', $permissions)
->delete(); ->delete();
@@ -145,6 +196,8 @@ class User extends Authenticatable implements Auditable
/** /**
* Get the list of files of the user * Get the list of files of the user
*
* @return HasMany
*/ */
public function media(): HasMany public function media(): HasMany
{ {
@@ -153,6 +206,8 @@ class User extends Authenticatable implements Auditable
/** /**
* Get the list of files of the user * Get the list of files of the user
*
* @return HasMany
*/ */
public function articles(): HasMany public function articles(): HasMany
{ {
@@ -161,6 +216,8 @@ class User extends Authenticatable implements Auditable
/** /**
* Get associated user codes * Get associated user codes
*
* @return HasMany
*/ */
public function codes(): HasMany public function codes(): HasMany
{ {
@@ -169,6 +226,8 @@ class User extends Authenticatable implements Auditable
/** /**
* Get the list of logins of the user * Get the list of logins of the user
*
* @return HasMany
*/ */
public function logins(): HasMany public function logins(): HasMany
{ {
@@ -177,6 +236,8 @@ class User extends Authenticatable implements Auditable
/** /**
* Get the events associated with the user. * Get the events associated with the user.
*
* @return BelongsToMany
*/ */
public function events(): BelongsToMany public function events(): BelongsToMany
{ {

View File

@@ -4,6 +4,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserCode extends Model class UserCode extends Model
{ {
@@ -23,6 +24,8 @@ class UserCode extends Model
/** /**
* Boot function from Laravel. * Boot function from Laravel.
*
* @return void
*/ */
protected static function boot(): void protected static function boot(): void
{ {
@@ -44,6 +47,8 @@ class UserCode extends Model
/** /**
* Generate new code * Generate new code
*
* @return void
*/ */
public function regenerate(): void public function regenerate(): void
{ {
@@ -58,6 +63,8 @@ class UserCode extends Model
/** /**
* Clear expired user codes * Clear expired user codes
*
* @return void
*/ */
public static function clearExpired(): void public static function clearExpired(): void
{ {
@@ -66,6 +73,8 @@ class UserCode extends Model
/** /**
* Get associated user * Get associated user
*
* @return Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */
public function user(): BelongsTo public function user(): BelongsTo
{ {

View File

@@ -5,6 +5,7 @@ namespace App\Models;
use App\Traits\Uuids; use App\Traits\Uuids;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserLogins extends Model class UserLogins extends Model
{ {
@@ -28,6 +29,8 @@ class UserLogins extends Model
/** /**
* Get the file user * Get the file user
*
* @return Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */
public function user(): BelongsTo public function user(): BelongsTo
{ {

View File

@@ -2,20 +2,16 @@
namespace App\Providers; namespace App\Providers;
use App\Rules\RequiredIfAny; use Illuminate\Http\Request;
use App\Rules\Uniqueish;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Exception;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use PDOException;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Validator;
class AppServiceProvider extends ServiceProvider class AppServiceProvider extends ServiceProvider
{ {
/** /**
* Register any application services. * Register any application services.
*
* @return void
*/ */
public function register(): void public function register(): void
{ {
@@ -24,9 +20,31 @@ class AppServiceProvider extends ServiceProvider
/** /**
* Bootstrap any application services. * Bootstrap any application services.
*
* @return void
*/ */
public function boot(): void public function boot(): void
{ {
Request::macro('rename', function ($param, $newParam = null) {
if (is_array($param) === false) {
if ($newParam === null) {
return;
}
$param = [$param => $newParam];
}
$paramArray = $this->all();
foreach ($param as $oldParam => $newParam) {
if (isset($paramArray[$oldParam]) === true) {
$paramArray[$newParam] = $paramArray[$oldParam];
unset($paramArray[$oldParam]);
}
}
$this->replace($paramArray);
});
Storage::macro('public', function ($diskName) { Storage::macro('public', function ($diskName) {
$public = config("filesystems.disks.{$diskName}.public", false); $public = config("filesystems.disks.{$diskName}.public", false);
return $public; return $public;

View File

@@ -19,6 +19,8 @@ class AuthServiceProvider extends ServiceProvider
/** /**
* Register any authentication / authorization services. * Register any authentication / authorization services.
*
* @return void
*/ */
public function boot(): void public function boot(): void
{ {

View File

@@ -9,6 +9,8 @@ class BroadcastServiceProvider extends ServiceProvider
{ {
/** /**
* Bootstrap any application services. * Bootstrap any application services.
*
* @return void
*/ */
public function boot(): void public function boot(): void
{ {

View File

@@ -26,6 +26,8 @@ class EventServiceProvider extends ServiceProvider
/** /**
* Register any events for your application. * Register any events for your application.
*
* @return void
*/ */
public function boot(): void public function boot(): void
{ {
@@ -34,6 +36,8 @@ class EventServiceProvider extends ServiceProvider
/** /**
* Determine if events and listeners should be automatically discovered. * Determine if events and listeners should be automatically discovered.
*
* @return boolean
*/ */
public function shouldDiscoverEvents(): bool public function shouldDiscoverEvents(): bool
{ {

View File

@@ -23,6 +23,8 @@ class RouteServiceProvider extends ServiceProvider
/** /**
* Define your route model bindings, pattern filters, and other route configuration. * Define your route model bindings, pattern filters, and other route configuration.
*
* @return void
*/ */
public function boot(): void public function boot(): void
{ {
@@ -31,9 +33,10 @@ class RouteServiceProvider extends ServiceProvider
// }); // });
$rateLimitEnabled = true; $rateLimitEnabled = true;
/** @var \App\Models\User */
$user = auth()->user(); $user = auth()->user();
if (app()->environment('testing')) { if (app()->environment('testing') === true) {
$rateLimitEnabled = false; $rateLimitEnabled = false;
} elseif ($user !== null && $user->hasPermission('admin/ratelimit') === true) { } elseif ($user !== null && $user->hasPermission('admin/ratelimit') === true) {
// Admin users with the "admin/ratelimit" permission are not rate limited // Admin users with the "admin/ratelimit" permission are not rate limited
@@ -42,7 +45,7 @@ class RouteServiceProvider extends ServiceProvider
if ($rateLimitEnabled === true) { if ($rateLimitEnabled === true) {
RateLimiter::for('api', function (Request $request) { RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(180)->by($request->user()?->id ?: $request->ip()); return Limit::perMinute(800)->by(isset($request->user()->id) === true ?: $request->ip());
}); });
} else { } else {
RateLimiter::for('api', function () { RateLimiter::for('api', function () {
@@ -59,20 +62,29 @@ class RouteServiceProvider extends ServiceProvider
->group(base_path('routes/web.php')); ->group(base_path('routes/web.php'));
}); });
Route::macro('apiAttachmentResource', function ($uri, $controller) { Route::macro('apiAddendumResource', function ($addendum, $uri, $controller) {
$singularUri = Str::singular($uri); $singularUri = Str::singular($uri);
$signularAddendum = Str::singular((strtolower($addendum)));
$pluralAddendum = Str::plural($signularAddendum);
Route::get("$uri/{{$singularUri}}/attachments", [$controller, 'getAttachments']) Route::get("{$uri}/{{$singularUri}}/{$pluralAddendum}", [$controller, "{$signularAddendum}Index"])
->name("{{$singularUri}}.attachments.index"); ->name("{$singularUri}.{$signularAddendum}.index");
Route::post("$uri/{{$singularUri}}/attachments", [$controller, 'storeAttachment']) Route::post("{$uri}/{{$singularUri}}/{$pluralAddendum}", [$controller, "{$signularAddendum}Store"])
->name("{{$singularUri}}.attachments.store"); ->name("{$singularUri}.{$signularAddendum}.store");
Route::match(['put', 'patch'], "$uri/{{$singularUri}}/attachments", [$controller, 'updateAttachments']) Route::match(
->name("{{$singularUri}}.attachments.update"); ['put', 'patch'],
"{$uri}/{{$singularUri}}/{$pluralAddendum}",
[$controller, "{$signularAddendum}Update"]
)
->name("{$singularUri}.{$signularAddendum}.update");
Route::delete("$uri/{{$singularUri}}/attachments/{medium}", [$controller, 'deleteAttachment']) Route::delete(
->name("{{$singularUri}}.attachments.destroy"); "{$uri}/{{$singularUri}}/{$pluralAddendum}/{medium}",
[$controller,"{$signularAddendum}Delete"]
)
->name("{$singularUri}.{$signularAddendum}.destroy");
}); });
} }
} }

View File

@@ -22,6 +22,7 @@ class Recaptcha implements Rule
* *
* @param mixed $attribute Attribute name. * @param mixed $attribute Attribute name.
* @param mixed $value Attribute value. * @param mixed $value Attribute value.
* @return boolean
*/ */
public function passes(mixed $attribute, mixed $value): bool public function passes(mixed $attribute, mixed $value): bool
{ {
@@ -41,6 +42,8 @@ class Recaptcha implements Rule
/** /**
* Get the validation error message. * Get the validation error message.
*
* @return string
*/ */
public function message(): string public function message(): string
{ {

View File

@@ -20,15 +20,19 @@ class UniqueFileName implements Rule
/** /**
* Determine if the validation rule passes. * Determine if the validation rule passes.
* *
* @param mixed $value * @param mixed $attribute Attribute name.
* @param mixed $value Attribute value.
* @return boolean
*/ */
public function passes(string $attribute, $value): bool public function passes(mixed $attribute, mixed $value): bool
{ {
return (Media::fileExists($value) === false); return (Media::fileExists($value) === false);
} }
/** /**
* Get the validation error message. * Get the validation error message.
*
* @return string
*/ */
public function message(): string public function message(): string
{ {

View File

@@ -47,6 +47,7 @@ class Uniqueish implements Rule
* Set the ID of the record to be ignored. * Set the ID of the record to be ignored.
* *
* @param mixed $id The ID to ignore. * @param mixed $id The ID to ignore.
* @return App\Rules\Uniqueish
*/ */
public function ignore(mixed $id): static public function ignore(mixed $id): static
{ {
@@ -59,6 +60,7 @@ class Uniqueish implements Rule
* *
* @param mixed $attribute Not used. * @param mixed $attribute Not used.
* @param mixed $value The value to compare. * @param mixed $value The value to compare.
* @return boolean
*/ */
public function passes(mixed $attribute, mixed $value): bool public function passes(mixed $attribute, mixed $value): bool
{ {
@@ -83,7 +85,7 @@ class Uniqueish implements Rule
foreach ($results as $result) { foreach ($results as $result) {
$resultValue = preg_replace('/[^A-Za-z0-9]/', '', strtolower($result->{$columnName})); $resultValue = preg_replace('/[^A-Za-z0-9]/', '', strtolower($result->{$columnName}));
if ($resultValue === $similarValue && $result->id != $this->ignoreId) { if ($resultValue === $similarValue && $result->id !== $this->ignoreId) {
return false; // Value already exists in the table return false; // Value already exists in the table
} }
} }
@@ -95,6 +97,8 @@ class Uniqueish implements Rule
/** /**
* Get the validation error message. * Get the validation error message.
*
* @return string
*/ */
public function message(): string public function message(): string
{ {

View File

@@ -1,630 +0,0 @@
<?php
namespace App\Services;
class AnimatedGifService
{
/**
* Check if a GIF file at a path is animated or not
*
* @param string $filenameOrBlob GIF file path or data blob if dataSize > 0.
* @param integer $dataSize GIF blob size.
* @return boolean GIF file/blob is animated.
*/
public static function isAnimatedGif(string $filenameOrBlob, int $dataSize = 0): bool
{
$regex = '#\x00\x21\xF9\x04.{4}\x00(\x2C|\x21)#s';
$count = 0;
if ($dataSize > 0) {
if (($fh = @fopen($filenameOrBlob, 'rb')) === false) {
return false;
}
$chunk = false;
while (feof($fh) === false && $count < 2) {
$chunk = ($chunk !== '' ? substr($chunk, -20) : "") . fread($fh, (1024 * 100)); //read 100kb at a time
$count += preg_match_all($regex, $chunk, $matches);
}
fclose($fh);
} else {
$count = preg_match_all($regex, $filenameOrBlob, $matches);
}
return $count > 1;
}
/**
* Extract frames of a GIF
*
* @param string $filenameOrBlob GIF filename path
* @param integer $dataSize GIF blob size.
* @param boolean $originalFrames Get original frames (with transparent background)
*/
public function extract(string $filenameOrBlob, int $dataSize = 0, bool $originalFrames = false): array
{
if (self::isAnimatedGif($filenameOrBlob) === false) {
return [];
}
$this->reset();
$this->parseFramesInfo($filename);
$prevImg = null;
for ($i = 0; $i < count($this->frameSources); $i++) {
$this->frames[$i] = [];
$this->frameDurations[$i] = $this->frames[$i]['duration'] = $this->frameSources[$i]['delay_time'];
$img = imagecreatefromstring($this->fileHeader["gifheader"] . $this->frameSources[$i]["graphicsextension"] . $this->frameSources[$i]["imagedata"] . chr(0x3b));
if (!$originalFrames) {
if ($i > 0) {
$prevImg = $this->frames[($i - 1)]['image'];
} else {
$prevImg = $img;
}
$sprite = imagecreate($this->gifMaxWidth, $this->gifMaxHeight);
imagesavealpha($sprite, true);
$transparent = imagecolortransparent($prevImg);
if ($transparent > -1 && imagecolorstotal($prevImg) > $transparent) {
$actualTrans = imagecolorsforindex($prevImg, $transparent);
imagecolortransparent($sprite, imagecolorallocate($sprite, $actualTrans['red'], $actualTrans['green'], $actualTrans['blue']));
}
if ((int) $this->frameSources[$i]['disposal_method'] == 1 && $i > 0) {
imagecopy($sprite, $prevImg, 0, 0, 0, 0, $this->gifMaxWidth, $this->gifMaxHeight);
}
imagecopyresampled($sprite, $img, $this->frameSources[$i]["offset_left"], $this->frameSources[$i]["offset_top"], 0, 0, $this->gifMaxWidth, $this->gifMaxHeight, $this->gifMaxWidth, $this->gifMaxHeight);
$img = $sprite;
}//end if
$this->frameImages[$i] = $this->frames[$i]['image'] = $img;
}//end for
return $this->frames;
}
}
class GifFrameExtractor
{
// Properties
// ===================================================================================
/**
* @var resource
*/
private $gif;
/**
* @var array
*/
private $frames;
/**
* @var array
*/
private $frameDurations;
/**
* @var array
*/
private $frameImages;
/**
* @var array
*/
private $framePositions;
/**
* @var array
*/
private $frameDimensions;
/**
* @var integer
*
* (old: $this->index)
*/
private $frameNumber;
/**
* @var array
*
* (old: $this->imagedata)
*/
private $frameSources;
/**
* @var array
*
* (old: $this->fileHeader)
*/
private $fileHeader;
/**
* @var integer The reader pointer in the file source
*
* (old: $this->pointer)
*/
private $pointer;
/**
* @var integer
*/
private $gifMaxWidth;
/**
* @var integer
*/
private $gifMaxHeight;
/**
* @var integer
*/
private $totalDuration;
/**
* @var integer
*/
private $handle;
/**
* @var array
*
* (old: globaldata)
*/
private $globaldata;
/**
* @var array
*
* (old: orgvars)
*/
private $orgvars;
// Methods
// ===================================================================================
/**
* Parse the frame informations contained in the GIF file
*
* @param string $filename GIF filename path
*/
private function parseFramesInfo(string $filename)
{
$this->openFile($filename);
$this->parseGifHeader();
$this->parseGraphicsExtension(0);
$this->getApplicationData();
$this->getApplicationData();
$this->getFrameString(0);
$this->parseGraphicsExtension(1);
$this->getCommentData();
$this->getApplicationData();
$this->getFrameString(1);
while (!$this->checkByte(0x3b) && !$this->checkEOF()) {
$this->getCommentData(1);
$this->parseGraphicsExtension(2);
$this->getFrameString(2);
$this->getApplicationData();
}
}
/**
* Parse the gif header (old: get_gif_header)
*/
private function parseGifHeader()
{
$this->pointerForward(10);
if ($this->readBits(($mybyte = $this->readByteInt()), 0, 1) == 1) {
$this->pointerForward(2);
$this->pointerForward(pow(2, ($this->readBits($mybyte, 5, 3) + 1)) * 3);
} else {
$this->pointerForward(2);
}
$this->fileHeader["gifheader"] = $this->dataPart(0, $this->pointer);
// Decoding
$this->orgvars["gifheader"] = $this->fileHeader["gifheader"];
$this->orgvars["background_color"] = $this->orgvars["gifheader"][11];
}
/**
* Parse the application data of the frames (old: get_application_data)
*/
private function getApplicationData()
{
$startdata = $this->readByte(2);
if ($startdata == chr(0x21) . chr(0xff)) {
$start = ($this->pointer - 2);
$this->pointerForward($this->readByteInt());
$this->readDataStream($this->readByteInt());
$this->fileHeader["applicationdata"] = $this->dataPart($start, ($this->pointer - $start));
} else {
$this->pointerRewind(2);
}
}
/**
* Parse the comment data of the frames (old: get_comment_data)
*/
private function getCommentData()
{
$startdata = $this->readByte(2);
if ($startdata == chr(0x21) . chr(0xfe)) {
$start = ($this->pointer - 2);
$this->readDataStream($this->readByteInt());
$this->fileHeader["commentdata"] = $this->dataPart($start, ($this->pointer - $start));
} else {
$this->pointerRewind(2);
}
}
/**
* Parse the graphic extension of the frames (old: get_graphics_extension)
*/
private function parseGraphicsExtension(int $type)
{
$startdata = $this->readByte(2);
if ($startdata == chr(0x21) . chr(0xf9)) {
$start = ($this->pointer - 2);
$this->pointerForward($this->readByteInt());
$this->pointerForward(1);
if ($type == 2) {
$this->frameSources[$this->frameNumber]["graphicsextension"] = $this->dataPart($start, ($this->pointer - $start));
} elseif ($type == 1) {
$this->orgvars["hasgx_type_1"] = 1;
$this->globaldata["graphicsextension"] = $this->dataPart($start, ($this->pointer - $start));
} elseif ($type == 0) {
$this->orgvars["hasgx_type_0"] = 1;
$this->globaldata["graphicsextension_0"] = $this->dataPart($start, ($this->pointer - $start));
}
} else {
$this->pointerRewind(2);
}//end if
}
/**
* Get the full frame string block (old: get_image_block)
*/
private function getFrameString(int $type)
{
if ($this->checkByte(0x2c)) {
$start = $this->pointer;
$this->pointerForward(9);
if ($this->readBits(($mybyte = $this->readByteInt()), 0, 1) == 1) {
$this->pointerForward(pow(2, ($this->readBits($mybyte, 5, 3) + 1)) * 3);
}
$this->pointerForward(1);
$this->readDataStream($this->readByteInt());
$this->frameSources[$this->frameNumber]["imagedata"] = $this->dataPart($start, ($this->pointer - $start));
if ($type == 0) {
$this->orgvars["hasgx_type_0"] = 0;
if (isset($this->globaldata["graphicsextension_0"])) {
$this->frameSources[$this->frameNumber]["graphicsextension"] = $this->globaldata["graphicsextension_0"];
} else {
$this->frameSources[$this->frameNumber]["graphicsextension"] = null;
}
unset($this->globaldata["graphicsextension_0"]);
} elseif ($type == 1) {
if (isset($this->orgvars["hasgx_type_1"]) && $this->orgvars["hasgx_type_1"] == 1) {
$this->orgvars["hasgx_type_1"] = 0;
$this->frameSources[$this->frameNumber]["graphicsextension"] = $this->globaldata["graphicsextension"];
unset($this->globaldata["graphicsextension"]);
} else {
$this->orgvars["hasgx_type_0"] = 0;
$this->frameSources[$this->frameNumber]["graphicsextension"] = $this->globaldata["graphicsextension_0"];
unset($this->globaldata["graphicsextension_0"]);
}
}//end if
$this->parseFrameData();
$this->frameNumber++;
}//end if
}
/**
* Parse frame data string into an array (old: parse_image_data)
*/
private function parseFrameData()
{
$this->frameSources[$this->frameNumber]["disposal_method"] = $this->getImageDataBit("ext", 3, 3, 3);
$this->frameSources[$this->frameNumber]["user_input_flag"] = $this->getImageDataBit("ext", 3, 6, 1);
$this->frameSources[$this->frameNumber]["transparent_color_flag"] = $this->getImageDataBit("ext", 3, 7, 1);
$this->frameSources[$this->frameNumber]["delay_time"] = $this->dualByteVal($this->getImageDataByte("ext", 4, 2));
$this->totalDuration += (int) $this->frameSources[$this->frameNumber]["delay_time"];
$this->frameSources[$this->frameNumber]["transparent_color_index"] = ord($this->getImageDataByte("ext", 6, 1));
$this->frameSources[$this->frameNumber]["offset_left"] = $this->dualByteVal($this->getImageDataByte("dat", 1, 2));
$this->frameSources[$this->frameNumber]["offset_top"] = $this->dualByteVal($this->getImageDataByte("dat", 3, 2));
$this->frameSources[$this->frameNumber]["width"] = $this->dualByteVal($this->getImageDataByte("dat", 5, 2));
$this->frameSources[$this->frameNumber]["height"] = $this->dualByteVal($this->getImageDataByte("dat", 7, 2));
$this->frameSources[$this->frameNumber]["local_color_table_flag"] = $this->getImageDataBit("dat", 9, 0, 1);
$this->frameSources[$this->frameNumber]["interlace_flag"] = $this->getImageDataBit("dat", 9, 1, 1);
$this->frameSources[$this->frameNumber]["sort_flag"] = $this->getImageDataBit("dat", 9, 2, 1);
$this->frameSources[$this->frameNumber]["color_table_size"] = (pow(2, ($this->getImageDataBit("dat", 9, 5, 3) + 1)) * 3);
$this->frameSources[$this->frameNumber]["color_table"] = substr($this->frameSources[$this->frameNumber]["imagedata"], 10, $this->frameSources[$this->frameNumber]["color_table_size"]);
$this->frameSources[$this->frameNumber]["lzw_code_size"] = ord($this->getImageDataByte("dat", 10, 1));
$this->framePositions[$this->frameNumber] = [
'x' => $this->frameSources[$this->frameNumber]["offset_left"],
'y' => $this->frameSources[$this->frameNumber]["offset_top"],
];
$this->frameDimensions[$this->frameNumber] = [
'width' => $this->frameSources[$this->frameNumber]["width"],
'height' => $this->frameSources[$this->frameNumber]["height"],
];
// Decoding
$this->orgvars[$this->frameNumber]["transparent_color_flag"] = $this->frameSources[$this->frameNumber]["transparent_color_flag"];
$this->orgvars[$this->frameNumber]["transparent_color_index"] = $this->frameSources[$this->frameNumber]["transparent_color_index"];
$this->orgvars[$this->frameNumber]["delay_time"] = $this->frameSources[$this->frameNumber]["delay_time"];
$this->orgvars[$this->frameNumber]["disposal_method"] = $this->frameSources[$this->frameNumber]["disposal_method"];
$this->orgvars[$this->frameNumber]["offset_left"] = $this->frameSources[$this->frameNumber]["offset_left"];
$this->orgvars[$this->frameNumber]["offset_top"] = $this->frameSources[$this->frameNumber]["offset_top"];
// Updating the max width
if ($this->gifMaxWidth < $this->frameSources[$this->frameNumber]["width"]) {
$this->gifMaxWidth = $this->frameSources[$this->frameNumber]["width"];
}
// Updating the max height
if ($this->gifMaxHeight < $this->frameSources[$this->frameNumber]["height"]) {
$this->gifMaxHeight = $this->frameSources[$this->frameNumber]["height"];
}
}
/**
* Get the image data byte (old: get_imagedata_byte)
*/
private function getImageDataByte(string $type, int $start, int $length): string
{
if ($type == "ext") {
return substr($this->frameSources[$this->frameNumber]["graphicsextension"], $start, $length);
}
// "dat"
return substr($this->frameSources[$this->frameNumber]["imagedata"], $start, $length);
}
/**
* Get the image data bit (old: get_imagedata_bit)
*/
private function getImageDataBit(string $type, int $byteIndex, int $bitStart, int $bitLength): number
{
if ($type == "ext") {
return $this->readBits(ord(substr($this->frameSources[$this->frameNumber]["graphicsextension"], $byteIndex, 1)), $bitStart, $bitLength);
}
// "dat"
return $this->readBits(ord(substr($this->frameSources[$this->frameNumber]["imagedata"], $byteIndex, 1)), $bitStart, $bitLength);
}
/**
* Return the value of 2 ASCII chars (old: dualbyteval)
*/
private function dualByteVal(string $s): int
{
$i = (ord($s[1]) * 256 + ord($s[0]));
return $i;
}
/**
* Read the data stream (old: read_data_stream)
*/
private function readDataStream(int $firstLength)
{
$this->pointerForward($firstLength);
$length = $this->readByteInt();
if ($length != 0) {
while ($length != 0) {
$this->pointerForward($length);
$length = $this->readByteInt();
}
}
}
/**
* Open the gif file (old: loadfile)
*/
private function openFile(string $filename)
{
$this->handle = fopen($filename, "rb");
$this->pointer = 0;
$imageSize = getimagesize($filename);
$this->gifWidth = $imageSize[0];
$this->gifHeight = $imageSize[1];
}
/**
* Close the read gif file (old: closefile)
*/
private function closeFile()
{
fclose($this->handle);
$this->handle = 0;
}
/**
* Read the file from the beginning to $byteCount in binary (old: readbyte)
*/
private function readByte(int $byteCount): string
{
$data = fread($this->handle, $byteCount);
$this->pointer += $byteCount;
return $data;
}
/**
* Read a byte and return ASCII value (old: readbyte_int)
*/
private function readByteInt(): int
{
$data = fread($this->handle, 1);
$this->pointer++;
return ord($data);
}
/**
* Convert a $byte to decimal (old: readbits)
*/
private function readBits(string $byte, int $start, int $length): number
{
$bin = str_pad(decbin($byte), 8, "0", STR_PAD_LEFT);
$data = substr($bin, $start, $length);
return bindec($data);
}
/**
* Rewind the file pointer reader (old: p_rewind)
*/
private function pointerRewind(int $length)
{
$this->pointer -= $length;
fseek($this->handle, $this->pointer);
}
/**
* Forward the file pointer reader (old: p_forward)
*/
private function pointerForward(int $length)
{
$this->pointer += $length;
fseek($this->handle, $this->pointer);
}
/**
* Get a section of the data from $start to $start + $length (old: datapart)
*/
private function dataPart(int $start, int $length): string
{
fseek($this->handle, $start);
$data = fread($this->handle, $length);
fseek($this->handle, $this->pointer);
return $data;
}
/**
* Check if a character if a byte (old: checkbyte)
*/
private function checkByte(int $byte): bool
{
if (fgetc($this->handle) == chr($byte)) {
fseek($this->handle, $this->pointer);
return true;
}
fseek($this->handle, $this->pointer);
return false;
}
/**
* Check the end of the file (old: checkEOF)
*/
private function checkEOF(): bool
{
if (fgetc($this->handle) === false) {
return true;
}
fseek($this->handle, $this->pointer);
return false;
}
/**
* Reset and clear this current object
*/
private function reset()
{
$this->gif = null;
$this->totalDuration = $this->gifMaxHeight = $this->gifMaxWidth = $this->handle = $this->pointer = $this->frameNumber = 0;
$this->frameDimensions = $this->framePositions = $this->frameImages = $this->frameDurations = $this->globaldata = $this->orgvars = $this->frames = $this->fileHeader = $this->frameSources = [];
}
// Getter / Setter
// ===================================================================================
/**
* Get the total of all added frame duration
*/
public function getTotalDuration(): int
{
return $this->totalDuration;
}
/**
* Get the number of extracted frames
*/
public function getFrameNumber(): int
{
return $this->frameNumber;
}
/**
* Get the extracted frames (images and durations)
*/
public function getFrames(): array
{
return $this->frames;
}
/**
* Get the extracted frame positions
*/
public function getFramePositions(): array
{
return $this->framePositions;
}
/**
* Get the extracted frame dimensions
*/
public function getFrameDimensions(): array
{
return $this->frameDimensions;
}
/**
* Get the extracted frame images
*/
public function getFrameImages(): array
{
return $this->frameImages;
}
/**
* Get the extracted frame durations
*/
public function getFrameDurations(): array
{
return $this->frameDurations;
}
}

View File

@@ -0,0 +1,98 @@
<?php
namespace App\Traits;
use App\Models\Media;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Support\Facades\Cache;
trait HasAttachments
{
/**
* Boot function from Laravel.
*
* @return void
*/
protected static function bootHasAttachments(): void
{
static::deleting(function ($model) {
$model->deleteAttachments();
});
}
/**
* Get the attachments associated to this item.
*
* @return Collection
*/
public function getAttachments(): Collection
{
return Cache::remember($this->attachmentsCacheKey(), now()->addDays(28), function () {
return $this->attachments()->get();
});
}
/**
* Add multiple attachments items to the model.
*
* @param array|string $ids The media ids to add.
* @param string $delimiter The split delimiter if $ids is a string.
* @param boolean $allowDuplicates Whether to allow duplicate media IDs or not.
* @return void
*/
public function addAttachments(array|string $ids, string $delimiter = ',', bool $allowDuplicates = false): void
{
if (is_array($ids) === false) {
$ids = explode($delimiter, $ids);
}
$ids = array_map('trim', $ids);
$existingIds = $this->getAttachments()->pluck('media_id')->toArray();
$attachmentItems = [];
foreach ($ids as $id) {
if ($allowDuplicates === false && in_array($id, $existingIds) === true) {
continue;
}
if (Media::where('id', $id)->exists() === true) {
$attachmentItems[] = ['media_id' => $id];
}
}
Cache::forget($this->attachmentsCacheKey());
$this->attachments()->createMany($attachmentItems);
}
/**
* Delete associated attachments.
*
* @return void
*/
public function deleteAttachments(): void
{
Cache::forget($this->attachmentsCacheKey());
$this->morphMany(\App\Models\Attachment::class, 'addendum')->delete();
}
/**
* Get the article's attachments.
*
* @return Illuminate\Database\Eloquent\Relations\MorphMany The attachments items
*/
public function attachments(): MorphMany
{
return $this->morphMany(\App\Models\Attachment::class, 'addendum');
}
/**
* Return the attachment cache key.
*
* @return string
*/
private function attachmentsCacheKey(): string
{
return "attachments:{$this->getTable()}:{$this->id}";
}
}

88
app/Traits/HasGallery.php Normal file
View File

@@ -0,0 +1,88 @@
<?php
namespace App\Traits;
use App\Models\Media;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Support\Facades\Cache;
trait HasGallery
{
/**
* Boot function from Laravel.
*
* @return void
*/
protected static function bootHasGallery(): void
{
static::deleting(function ($model) {
$model->gallery()->delete();
});
}
/**
* Add multiple gallery items to the model.
*
* @param array|string $ids The media ids to add.
* @param string $delimiter The split delimiter if $ids is a string.
* @param boolean $allowDuplicates Whether to allow duplicate media IDs or not.
* @return void
*/
public function galleryAddMany(array|string $ids, string $delimiter = ',', bool $allowDuplicates = false): void
{
if (is_array($ids) === false) {
$ids = explode($delimiter, $ids);
}
$ids = array_map('trim', $ids);
$existingIds = $this->gallery()->pluck('media_id')->toArray();
$galleryItems = [];
foreach ($ids as $id) {
if ($allowDuplicates === false && in_array($id, $existingIds) === true) {
continue;
}
$media = Media::find($id);
if ($media !== null) {
$galleryItems[] = ['media_id' => $id];
}
}
Cache::forget($this->galleryCacheKey());
$this->gallery()->createMany($galleryItems);
}
/**
* Get the article's gallery.
*
* @return Illuminate\Database\Eloquent\Relations\MorphMany The gallery items
*/
public function gallery(): MorphMany
{
return $this->morphMany(\App\Models\Gallery::class, 'addendum');
}
/**
* Get the article's gallery collection.
*
* @return Illuminate\Database\Eloquent\Collection The gallery collection
*/
public function getGallery(): Collection
{
return Cache::remember($this->galleryCacheKey(), now()->addDays(28), function () {
return $this->gallery()->get();
});
}
/**
* Return the attachment cache key.
*
* @return string
*/
private function galleryCacheKey(): string
{
return "gallery:{$this->getTable()}:{$this->id}";
}
}

View File

@@ -8,6 +8,8 @@ trait Uuids
{ {
/** /**
* Boot function from Laravel. * Boot function from Laravel.
*
* @return void
*/ */
protected static function bootUuids(): void protected static function bootUuids(): void
{ {
@@ -20,6 +22,8 @@ trait Uuids
/** /**
* Get the value indicating whether the IDs are incrementing. * Get the value indicating whether the IDs are incrementing.
*
* @return boolean
*/ */
public function getIncrementing(): bool public function getIncrementing(): bool
{ {
@@ -28,6 +32,8 @@ trait Uuids
/** /**
* Get the auto-incrementing key type. * Get the auto-incrementing key type.
*
* @return string
*/ */
public function getKeyType(): string public function getKeyType(): string
{ {

View File

@@ -11,19 +11,22 @@
"php": "^8.1", "php": "^8.1",
"doctrine/dbal": "^3.5", "doctrine/dbal": "^3.5",
"guzzlehttp/guzzle": "^7.2", "guzzlehttp/guzzle": "^7.2",
"intervention/image": "^2.7", "intervention/image": "*",
"laravel/framework": "^10.12", "laravel/framework": "^10.12",
"laravel/sanctum": "^3.2", "laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8", "laravel/tinker": "^2.8",
"league/flysystem-aws-s3-v3": "^3.12", "league/flysystem-aws-s3-v3": "^3.12",
"owen-it/laravel-auditing": "^13.1", "owen-it/laravel-auditing": "^13.1",
"php-ffmpeg/php-ffmpeg": "^1.1", "php-ffmpeg/php-ffmpeg": "^1.1",
"square/square": "34.0.1.20240118",
"sunspikes/clamav-validator": "*", "sunspikes/clamav-validator": "*",
"thiagoalessio/tesseract_ocr": "^2.12", "thiagoalessio/tesseract_ocr": "^2.12",
"vlucas/phpdotenv": "^5.5" "vlucas/phpdotenv": "^5.5"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-ide-helper": "^2.13",
"fakerphp/faker": "^1.9.1", "fakerphp/faker": "^1.9.1",
"itsgoingd/clockwork": "^5.1",
"laravel/pint": "^1.0", "laravel/pint": "^1.0",
"laravel/sail": "^1.18", "laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4", "mockery/mockery": "^1.4.4",
@@ -34,7 +37,8 @@
"autoload": { "autoload": {
"files": [ "files": [
"app/Helpers/Array.php", "app/Helpers/Array.php",
"app/Helpers/Temp.php" "app/Helpers/Temp.php",
"app/Helpers/TypeValue.php"
], ],
"psr-4": { "psr-4": {
"App\\": "app/", "App\\": "app/",

3343
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -159,7 +159,7 @@ return [
/* /*
* Package Service Providers... * Package Service Providers...
*/ */
Intervention\Image\ImageServiceProvider::class, // Intervention\Image\ImageServiceProvider::class,
OwenIt\Auditing\AuditingServiceProvider::class, OwenIt\Auditing\AuditingServiceProvider::class,
/* /*

View File

@@ -36,7 +36,7 @@ return [
'secret' => env('PUSHER_APP_SECRET'), 'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'), 'app_id' => env('PUSHER_APP_ID'),
'options' => [ 'options' => [
'host' => env('PUSHER_HOST') ?: 'api-' . env('PUSHER_APP_CLUSTER', 'mt1') . '.pusher.com', 'host' => env('PUSHER_HOST') === null ?: 'api-' . env('PUSHER_APP_CLUSTER', 'mt1') . '.pusher.com',
'port' => env('PUSHER_PORT', 443), 'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'), 'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true, 'encrypted' => true,

View File

@@ -34,7 +34,8 @@ return [
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Socket connect timeout | Socket connect timeout
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| This option defines the maximum time to wait in seconds for socket connection attempts before failure or timeout, default null = no limit. | This option defines the maximum time to wait in seconds for socket connection attempts before failure or timeout,
| default null = no limit.
*/ */
'socket_connect_timeout' => env('CLAMAV_SOCKET_CONNECT_TIMEOUT', null), 'socket_connect_timeout' => env('CLAMAV_SOCKET_CONNECT_TIMEOUT', null),

416
config/clockwork.php Normal file
View File

@@ -0,0 +1,416 @@
<?php
return [
/*
|------------------------------------------------------------------------------------------------------------------
| Enable Clockwork
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork is enabled by default only when your application is in debug mode. Here you can explicitly enable or
| disable Clockwork. When disabled, no data is collected and the api and web ui are inactive.
|
*/
'enable' => env('CLOCKWORK_ENABLE', null),
/*
|------------------------------------------------------------------------------------------------------------------
| Features
|------------------------------------------------------------------------------------------------------------------
|
| You can enable or disable various Clockwork features here. Some features have additional settings (eg. slow query
| threshold for database queries).
|
*/
'features' => [
// Cache usage stats and cache queries including results
'cache' => [
'enabled' => env('CLOCKWORK_CACHE_ENABLED', true),
// Collect cache queries
'collect_queries' => env('CLOCKWORK_CACHE_QUERIES', true),
// Collect values from cache queries (high performance impact with a very high number of queries)
'collect_values' => env('CLOCKWORK_CACHE_COLLECT_VALUES', false)
],
// Database usage stats and queries
'database' => [
'enabled' => env('CLOCKWORK_DATABASE_ENABLED', true),
// Collect database queries (high performance impact with a very high number of queries)
'collect_queries' => env('CLOCKWORK_DATABASE_COLLECT_QUERIES', true),
// Collect details of models updates (high performance impact with a lot of model updates)
'collect_models_actions' => env('CLOCKWORK_DATABASE_COLLECT_MODELS_ACTIONS', true),
// Collect details of retrieved models (very high performance impact with a lot of models retrieved)
'collect_models_retrieved' => env('CLOCKWORK_DATABASE_COLLECT_MODELS_RETRIEVED', false),
// Query execution time threshold in milliseconds after which the query will be marked as slow
'slow_threshold' => env('CLOCKWORK_DATABASE_SLOW_THRESHOLD'),
// Collect only slow database queries
'slow_only' => env('CLOCKWORK_DATABASE_SLOW_ONLY', false),
// Detect and report duplicate queries
'detect_duplicate_queries' => env('CLOCKWORK_DATABASE_DETECT_DUPLICATE_QUERIES', false)
],
// Dispatched events
'events' => [
'enabled' => env('CLOCKWORK_EVENTS_ENABLED', true),
// Ignored events (framework events are ignored by default)
'ignored_events' => [
// App\Events\UserRegistered::class,
// 'user.registered'
],
],
// Laravel log (you can still log directly to Clockwork with laravel log disabled)
'log' => [
'enabled' => env('CLOCKWORK_LOG_ENABLED', true)
],
// Sent notifications
'notifications' => [
'enabled' => env('CLOCKWORK_NOTIFICATIONS_ENABLED', true),
],
// Performance metrics
'performance' => [
// Allow collecting of client metrics. Requires separate clockwork-browser npm package.
'client_metrics' => env('CLOCKWORK_PERFORMANCE_CLIENT_METRICS', true)
],
// Dispatched queue jobs
'queue' => [
'enabled' => env('CLOCKWORK_QUEUE_ENABLED', true)
],
// Redis commands
'redis' => [
'enabled' => env('CLOCKWORK_REDIS_ENABLED', true)
],
// Routes list
'routes' => [
'enabled' => env('CLOCKWORK_ROUTES_ENABLED', false),
// Collect only routes from particular namespaces (only application routes by default)
'only_namespaces' => [ 'App' ]
],
// Rendered views
'views' => [
'enabled' => env('CLOCKWORK_VIEWS_ENABLED', true),
// Collect views including view data (high performance impact with a high number of views)
'collect_data' => env('CLOCKWORK_VIEWS_COLLECT_DATA', false),
// Use Twig profiler instead of Laravel events for apps using laravel-twigbridge (more precise, but does
// not support collecting view data)
'use_twig_profiler' => env('CLOCKWORK_VIEWS_USE_TWIG_PROFILER', false)
]
],
/*
|------------------------------------------------------------------------------------------------------------------
| Enable web UI
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork comes with a web UI accessible via http://your.app/clockwork. Here you can enable or disable this
| feature. You can also set a custom path for the web UI.
|
*/
'web' => env('CLOCKWORK_WEB', true),
/*
|------------------------------------------------------------------------------------------------------------------
| Enable toolbar
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork can show a toolbar with basic metrics on all responses. Here you can enable or disable this feature.
| Requires a separate clockwork-browser npm library.
| For installation instructions see https://underground.works/clockwork/#docs-viewing-data
|
*/
'toolbar' => env('CLOCKWORK_TOOLBAR', true),
/*
|------------------------------------------------------------------------------------------------------------------
| HTTP requests collection
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork collects data about HTTP requests to your app. Here you can choose which requests should be collected.
|
*/
'requests' => [
// With on-demand mode enabled, Clockwork will only profile requests when the browser extension is open or you
// manually pass a "clockwork-profile" cookie or get/post data key.
// Optionally you can specify a "secret" that has to be passed as the value to enable profiling.
'on_demand' => env('CLOCKWORK_REQUESTS_ON_DEMAND', false),
// Collect only errors (requests with HTTP 4xx and 5xx responses)
'errors_only' => env('CLOCKWORK_REQUESTS_ERRORS_ONLY', false),
// Response time threshold in milliseconds after which the request will be marked as slow
'slow_threshold' => env('CLOCKWORK_REQUESTS_SLOW_THRESHOLD'),
// Collect only slow requests
'slow_only' => env('CLOCKWORK_REQUESTS_SLOW_ONLY', false),
// Sample the collected requests (e.g. set to 100 to collect only 1 in 100 requests)
'sample' => env('CLOCKWORK_REQUESTS_SAMPLE', false),
// List of URIs that should not be collected
'except' => [
'/horizon/.*', // Laravel Horizon requests
'/telescope/.*', // Laravel Telescope requests
'/_debugbar/.*', // Laravel DebugBar requests
],
// List of URIs that should be collected, any other URI will not be collected if not empty
'only' => [
// '/api/.*'
],
// Don't collect OPTIONS requests, mostly used in the CSRF pre-flight requests and are rarely of interest
'except_preflight' => env('CLOCKWORK_REQUESTS_EXCEPT_PREFLIGHT', true)
],
/*
|------------------------------------------------------------------------------------------------------------------
| Artisan commands collection
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork can collect data about executed artisan commands. Here you can enable and configure which commands
| should be collected.
|
*/
'artisan' => [
// Enable or disable collection of executed Artisan commands
'collect' => env('CLOCKWORK_ARTISAN_COLLECT', false),
// List of commands that should not be collected (built-in commands are not collected by default)
'except' => [
// 'inspire'
],
// List of commands that should be collected, any other command will not be collected if not empty
'only' => [
// 'inspire'
],
// Enable or disable collection of command output
'collect_output' => env('CLOCKWORK_ARTISAN_COLLECT_OUTPUT', false),
// Enable or disable collection of built-in Laravel commands
'except_laravel_commands' => env('CLOCKWORK_ARTISAN_EXCEPT_LARAVEL_COMMANDS', true)
],
/*
|------------------------------------------------------------------------------------------------------------------
| Queue jobs collection
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork can collect data about executed queue jobs. Here you can enable and configure which queue jobs should
| be collected.
|
*/
'queue' => [
// Enable or disable collection of executed queue jobs
'collect' => env('CLOCKWORK_QUEUE_COLLECT', false),
// List of queue jobs that should not be collected
'except' => [
// App\Jobs\ExpensiveJob::class
],
// List of queue jobs that should be collected, any other queue job will not be collected if not empty
'only' => [
// App\Jobs\BuggyJob::class
]
],
/*
|------------------------------------------------------------------------------------------------------------------
| Tests collection
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork can collect data about executed tests. Here you can enable and configure which tests should be
| collected.
|
*/
'tests' => [
// Enable or disable collection of ran tests
'collect' => env('CLOCKWORK_TESTS_COLLECT', false),
// List of tests that should not be collected
'except' => [
// Tests\Unit\ExampleTest::class
]
],
/*
|------------------------------------------------------------------------------------------------------------------
| Enable data collection when Clockwork is disabled
|------------------------------------------------------------------------------------------------------------------
|
| You can enable this setting to collect data even when Clockwork is disabled, e.g. for future analysis.
|
*/
'collect_data_always' => env('CLOCKWORK_COLLECT_DATA_ALWAYS', false),
/*
|------------------------------------------------------------------------------------------------------------------
| Metadata storage
|------------------------------------------------------------------------------------------------------------------
|
| Configure how is the metadata collected by Clockwork stored. Two options are available:
| - files - A simple fast storage implementation storing data in one-per-request files.
| - sql - Stores requests in a sql database. Supports MySQL, PostgreSQL and SQLite. Requires PDO.
|
*/
'storage' => env('CLOCKWORK_STORAGE', 'files'),
// Path where the Clockwork metadata is stored
'storage_files_path' => env('CLOCKWORK_STORAGE_FILES_PATH', storage_path('clockwork')),
// Compress the metadata files using gzip, trading a little bit of performance for lower disk usage
'storage_files_compress' => env('CLOCKWORK_STORAGE_FILES_COMPRESS', false),
// SQL database to use, can be a name of database configured in database.php or a path to a SQLite file
'storage_sql_database' => env('CLOCKWORK_STORAGE_SQL_DATABASE', storage_path('clockwork.sqlite')),
// SQL table name to use, the table is automatically created and updated when needed
'storage_sql_table' => env('CLOCKWORK_STORAGE_SQL_TABLE', 'clockwork'),
// Maximum lifetime of collected metadata in minutes, older requests will automatically be deleted, false to disable
'storage_expiration' => env('CLOCKWORK_STORAGE_EXPIRATION', (60 * 24 * 7)),
/*
|------------------------------------------------------------------------------------------------------------------
| Authentication
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork can be configured to require authentication before allowing access to the collected data. This might be
| useful when the application is publicly accessible. Setting to true will enable a simple authentication with a
| pre-configured password. You can also pass a class name of a custom implementation.
|
*/
'authentication' => env('CLOCKWORK_AUTHENTICATION', false),
// Password for the simple authentication
'authentication_password' => env('CLOCKWORK_AUTHENTICATION_PASSWORD', 'VerySecretPassword'),
/*
|------------------------------------------------------------------------------------------------------------------
| Stack traces collection
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork can collect stack traces for log messages and certain data like database queries. Here you can set
| whether to collect stack traces, limit the number of collected frames and set further configuration. Collecting
| long stack traces considerably increases metadata size.
|
*/
'stack_traces' => [
// Enable or disable collecting of stack traces
'enabled' => env('CLOCKWORK_STACK_TRACES_ENABLED', true),
// Limit the number of frames to be collected
'limit' => env('CLOCKWORK_STACK_TRACES_LIMIT', 10),
// List of vendor names to skip when determining caller, common vendors are automatically added
'skip_vendors' => [
// 'phpunit'
],
// List of namespaces to skip when determining caller
'skip_namespaces' => [
// 'Laravel'
],
// List of class names to skip when determining caller
'skip_classes' => [
// App\CustomLog::class
]
],
/*
|------------------------------------------------------------------------------------------------------------------
| Serialization
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork serializes the collected data to json for storage and transfer. Here you can configure certain aspects
| of serialization. Serialization has a large effect on the cpu time and memory usage.
|
*/
// Maximum depth of serialized multi-level arrays and objects
'serialization_depth' => env('CLOCKWORK_SERIALIZATION_DEPTH', 10),
// A list of classes that will never be serialized (e.g. a common service container class)
'serialization_blackbox' => [
\Illuminate\Container\Container::class,
\Illuminate\Foundation\Application::class,
\Laravel\Lumen\Application::class
],
/*
|------------------------------------------------------------------------------------------------------------------
| Register helpers
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork comes with a "clock" global helper function. You can use this helper to quickly log something and to
| access the Clockwork instance.
|
*/
'register_helpers' => env('CLOCKWORK_REGISTER_HELPERS', true),
/*
|------------------------------------------------------------------------------------------------------------------
| Send headers for AJAX request
|------------------------------------------------------------------------------------------------------------------
|
| When trying to collect data, the AJAX method can sometimes fail if it is missing required headers. For example, an
| API might require a version number using Accept headers to route the HTTP request to the correct codebase.
|
*/
'headers' => [
// 'Accept' => 'application/vnd.com.whatever.v1+json',
],
/*
|------------------------------------------------------------------------------------------------------------------
| Server timing
|------------------------------------------------------------------------------------------------------------------
|
| Clockwork supports the W3C Server Timing specification, which allows for collecting a simple performance metrics
| in a cross-browser way. E.g. in Chrome, your app, database and timeline event timings will be shown in the Dev
| Tools network tab. This setting specifies the max number of timeline events that will be sent. Setting to false
| will disable the feature.
|
*/
'server_timing' => env('CLOCKWORK_SERVER_TIMING', 10)
];

View File

@@ -58,7 +58,7 @@ return [
'prefix_indexes' => true, 'prefix_indexes' => true,
'strict' => true, 'strict' => true,
'engine' => null, 'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([ 'options' => extension_loaded('pdo_mysql') === true ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [], ]) : [],
], ],

View File

@@ -33,7 +33,7 @@ return [
'local' => [ 'local' => [
'driver' => 'local', 'driver' => 'local',
'root' => storage_path('app/public'), 'root' => storage_path('app/public'),
'url' => env('APP_URL') . "/storage", 'url' => env('APP_URL') . "/storage/{name}",
'public' => true, 'public' => true,
'throw' => false, 'throw' => false,
], ],
@@ -44,7 +44,7 @@ return [
'secret' => env('AWS_PUBLIC_SECRET_ACCESS_KEY'), 'secret' => env('AWS_PUBLIC_SECRET_ACCESS_KEY'),
'region' => env('AWS_PUBLIC_DEFAULT_REGION'), 'region' => env('AWS_PUBLIC_DEFAULT_REGION'),
'bucket' => env('AWS_PUBLIC_BUCKET'), 'bucket' => env('AWS_PUBLIC_BUCKET'),
'url' => env('AWS_PUBLIC_URL'), 'url' => env('AWS_PUBLIC_URL') . '/{name}',
'endpoint' => env('AWS_PUBLIC_ENDPOINT'), 'endpoint' => env('AWS_PUBLIC_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_PUBLIC_USE_PATH_STYLE_ENDPOINT', false), 'use_path_style_endpoint' => env('AWS_PUBLIC_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false, 'throw' => false,
@@ -55,41 +55,20 @@ return [
], ],
'private' => [ 'private' => [
'driver' => 's3', 'driver' => 'local',
'key' => env('AWS_PRIVATE_ACCESS_KEY_ID'), 'root' => storage_path('app/private'),
'secret' => env('AWS_PRIVATE_SECRET_ACCESS_KEY'), 'url' => env('APP_URL_API') . '/media/{id}/download',
'region' => env('AWS_PRIVATE_DEFAULT_REGION'), 'visibility' => 'private',
'bucket' => env('AWS_PRIVATE_BUCKET'),
'url' => env('AWS_PRIVATE_URL'),
'endpoint' => env('AWS_PRIVATE_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_PRIVATE_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false, 'throw' => false,
'public' => false,
'options' => [
'ACL' => '',
]
], ],
'public' => [ 'public' => [
'driver' => 'local', 'driver' => 'local',
'root' => storage_path('app/public'), 'root' => storage_path('app/public'),
'url' => env('APP_URL') . '/storage', 'url' => env('APP_URL') . '/storage/{name}',
'visibility' => 'public', 'visibility' => 'public',
'throw' => false, 'throw' => false,
], ],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],
], ],
/* /*

View File

@@ -30,14 +30,4 @@ return [
'secret' => env('AWS_SECRET_ACCESS_KEY'), 'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
], ],
<<<<<<< HEAD
'google_recaptcha' => [
'url' => 'https://www.google.com/recaptcha/api/siteverify',
'site_key' => env('GOOGLE_RECAPTCHA_SITE_KEY'),
'secret_key' => env('GOOGLE_RECAPTCHA_SECRET_SITE_KEY'),
],
=======
>>>>>>> 086cf9e (removed obsolete recaptcha)
]; ];

View File

@@ -58,39 +58,6 @@ return new class extends Migration
$lastSessionUpdate = $sameSessionRows->first()->created_at; $lastSessionUpdate = $sameSessionRows->first()->created_at;
} while(true); } while(true);
} while(true); } while(true);
// Loop through the rows and update `session` based on the logic you described
// foreach ($rows as $row) {
// // Check if this is the first row
// if ($row->created_at === $rows->first()->created_at) {
// DB::table('analytics')
// ->where('id', $row->id)
// ->update(['session' => $session]);
// } else {
// // Look for a previous row with the same useragent and ip within the last 30 minutes
// $previousRow = DB::table('analytics')
// ->where('useragent', $row->useragent)
// ->where('ip', $row->ip)
// ->where('created_at', '>=', date('Y-m-d H:i:s', strtotime('-30 minutes', strtotime($row->created_at))))
// ->whereNotNull('session')
// ->orderBy('created_at', 'desc')
// ->first();
// if ($previousRow) {
// // If a previous row is found, set the session to the same value
// DB::table('analytics')
// ->where('id', $row->id)
// ->update(['session' => $previousRow->session]);
// } else {
// // If no previous row is found, increment the session value
// $session++;
// DB::table('analytics')
// ->where('id', $row->id)
// ->update(['session' => $session]);
// }
// }
// }
} }
/** /**

Some files were not shown because too many files have changed in this diff Show More