-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add #381 Add hash ids instead of actual ID for model routes [WIP] #777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
e7ed9a7
add DB_PREFIX
turtles2 30c44c5
Update database.php
turtles2 6f8aae1
Merge pull request #1 from monicahq/master
turtles2 19039e6
Clean Up Commit
turtles2 c780dd7
Merge pull request #2 from monicahq/master
turtles2 7081fbe
Fixes #350
turtles2 d04ee9a
Merge branch 'master' into master
djaiss 08077a4
Bump version to 1.5.0 (#737)
djaiss 32a2a04
Change link to repository in the documentation (#728)
hexnet 8a803e7
Fix URL::forceSchema to forceScheme (#730)
mwalling 0d842ec
Fix an issue where February shows up as March in the date picker (#731)
mwalling ab76894
Allow searching by phone number (or contact fields in general) (#735)
turtles2 1c266d4
Merge pull request #4 from monicahq/master
turtles2 74d3251
Merge pull request #5 from monicahq/master
turtles2 68cb57e
Merge pull request #6 from monicahq/master
turtles2 6710767
Proof of Concept
turtles2 efaf6db
Support for URLs that don't use HashIDs
turtles2 dd6c55f
Merge branch 'master' into 381
turtles2 b223e31
Composer Fix
turtles2 1a7a590
Allow setting of salt
turtles2 2ce2a03
Test
turtles2 1ea2a03
Kid Fix
turtles2 ea9220a
Merge branch 'master' into 381
turtles2 c876f0d
Fix Kid Issue
turtles2 f214e74
Add tests
turtles2 cebbb37
Style Fix
turtles2 9c3615f
Style Fix 2
turtles2 519e655
Style Fix 3
turtles2 fec6ac4
POC of id hashing
turtles2 7c5c77c
Add more tests
turtles2 c6bb801
Hash IDs on Dashboard
turtles2 eaec0c6
Hash URLs for profile
turtles2 ba7e58b
Merge branch 'master' into 381
turtles2 9d367ba
Merge branch 'master' into 381
turtles2 3883879
Merge branch 'master' into 381
turtles2 248557d
Merge branch 'master' into 381
turtles2 b422563
Update ModelFactory.php
turtles2 e75133b
Update ModelFactory.php
turtles2 9d7fb9c
Merge branch 'master' into 381
turtles2 2367249
Merge branch 'master' into 381
turtles2 935fc61
Update ModelFactory.php
turtles2 1a0f526
Update ModelFactory.php
turtles2 581b64e
Merge branch 'master' into 381
turtles2 c5d7148
Merge branch 'master' into 381
turtles2 5e7fa20
Merge branch 'master' into 381
turtles2 3e61bba
Merge branch 'master' into 381
turtles2 3e41094
Merge branch 'master' into 381
djaiss f8cbf01
Merge branch 'master' into 381
turtles2 5afc84c
Update .env.example
turtles2 ea52800
Update contribute.md
turtles2 60b51aa
PSR (#11)
turtles2 4178078
Merge branch 'master' into 381
turtles2 1a6a6d7
Merge branch 'master' into 381
turtles2 71bed8c
Merge branch 'master' into 381
turtles2 77d7d3c
Delete contribute.md
turtles2 5f0e6ff
Merge branch 'master' into 381
turtles2 c71f096
Update RouteServiceProvider.php
turtles2 0aac673
Update composer.json
turtles2 69edef4
Add to emails
turtles2 aa7464f
Add HashIDs to more pages and routes
turtles2 b2d68d9
Test bug Fix
turtles2 17da9e1
Add to update and saves
turtles2 7c1cc7a
Test fix
turtles2 f803a54
Add to edit button
turtles2 e94f871
Add to add
turtles2 3d95f4f
Add hash to search
turtles2 f685331
Update ContactsController.php
turtles2 902a108
Delete app.css
turtles2 163efa5
Delete mix-manifest.json
turtles2 29a27b3
Delete stripe.js
turtles2 95f8e93
Delete app.js
turtles2 527161e
Revert "Update ContactsController.php"
turtles2 3431015
Revert "Delete app.js"
turtles2 154acfb
Revert "Delete stripe.js"
turtles2 555d30a
Revert "Revert "Delete stripe.js""
turtles2 4013774
Revert
turtles2 d0f5793
Update JS
turtles2 6524bb7
Add files via upload
turtles2 f7453c0
Update stripe.js
turtles2 b6262d4
Add files via upload
turtles2 cedb357
Add files via upload
turtles2 e893407
Merge branch 'master' into 381
turtles2 4fe72b2
Complie Assets
turtles2 f510302
Merge branch 'master' into 381
turtles2 25ffb7a
Changes
turtles2 ff4ef6c
Merge branch 'master' into 381
asbiin 74fa565
Add bcmath dependency
asbiin 4a6fd91
Merge remote-tracking branch 'origin/master' into 381
asbiin 7ed87de
Add to more views
turtles2 58f8060
Add more
turtles2 f6c7613
More hashs
turtles2 45176d8
Remove id from modal
turtles2 a84d0ce
Add a default prefix configuration
asbiin 692e42b
Use default_prefix
asbiin 1f4ac37
Add a ServiceProvider
asbiin 563368d
Fix
turtles2 9574f3a
Merge branch '381' of https://github.com/turtles2/monica into 381
turtles2 84d1fbd
Fix StyleCI
asbiin 4b5f5cd
Merge branch '381' of https://github.com/turtles2/monica into 381
turtles2 5b05f70
Fix 2
turtles2 0df3854
Bug fix and more hashs
turtles2 b6832d3
Remove unneeded id tag
turtles2 7856cbe
Add files via upload
turtles2 28aa481
Merge branch 'master' into 381
turtles2 32dd34d
Assets
turtles2 b8a66a0
Update composer.json
turtles2 f6636f0
Prep for merge
turtles2 d59e272
Delete KidsController.php
turtles2 1b297e5
Add files via upload
turtles2 07c0563
Merge branch 'master' into 381
turtles2 df44ede
Update RelationshipsController.php
turtles2 99deded
Update RelationshipsController.php
turtles2 8e16ff8
Update RelationshipsController.php
turtles2 0beea0f
Add HashID back
turtles2 f806bbf
Assets
turtles2 a01af38
Merge branch 'master' into 381
turtles2 a4eb62d
Fixes
turtles2 6f037eb
Merge branch '381' of https://github.com/turtles2/monica into 381
turtles2 a5c65c7
Merge remote-tracking branch 'origin/master' into 381
asbiin f311fe3
Update IdHasher.php
turtles2 975dd79
Merge remote-tracking branch 'origin/master' into 381
asbiin 8aadf00
Merge branch 'master' into 381
turtles2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <?php | ||
|
|
||
| namespace App\Helpers; | ||
|
|
||
| use Vinkla\Hashids\Facades\Hashids; | ||
|
|
||
| class IdHasher | ||
| { | ||
| /** | ||
| * Prefix for ids. | ||
| * | ||
| * @var string | ||
| */ | ||
| protected $prefix; | ||
|
|
||
| /** | ||
| * Create a new IdHasher. | ||
| * | ||
| * @param string|null $prefix | ||
| */ | ||
| public function __construct($prefix = null) | ||
| { | ||
| $this->prefix = $prefix ?? config('hashids.default_prefix'); | ||
| } | ||
|
|
||
| public function encodeId($id) | ||
| { | ||
| return $this->prefix.Hashids::encode($id); | ||
| } | ||
|
|
||
| public function decodeId($hash) | ||
| { | ||
| if (starts_with($hash, $this->prefix)) { | ||
| $result = Hashids::decode(str_after($hash, $this->prefix)); | ||
|
|
||
| return $result[0]; // result is always an array due to quirk in Hashids libary | ||
| } else { | ||
| return $hash; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to put those a comment above these two new parameters to explain what it does.
I suggest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done