File tree 4 files changed +31
-5
lines changed
4 files changed +31
-5
lines changed Original file line number Diff line number Diff line change
1
+ coverage :
2
+ status :
3
+ project :
4
+ default :
5
+ informational : true
6
+ patch :
7
+ default :
8
+ informational : true
9
+ comment :
10
+ layout : " reach, diff, flags"
11
+ require_changes : true
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Tests \Models ;
4
+
5
+ use Illuminate \Database \Eloquent \Model ;
6
+
7
+ class BasicModel extends Model
8
+ {
9
+ protected $ table = 'hashid_test ' ;
10
+ protected static $ unguarded = true ;
11
+ }
Original file line number Diff line number Diff line change 2
2
3
3
namespace Tests \Models ;
4
4
5
- use Illuminate \Database \Eloquent \Model ;
6
5
use Veelasky \LaravelHashId \Eloquent \HashableId ;
7
6
8
- class HashModel extends Model
7
+ class HashModel extends BasicModel
9
8
{
10
9
use HashableId;
11
-
12
- protected $ table = 'hashid_test ' ;
13
- protected static $ unguarded = true ;
14
10
}
Original file line number Diff line number Diff line change 7
7
use Illuminate \Support \Facades \Validator ;
8
8
use Illuminate \Support \Str ;
9
9
use Illuminate \Validation \ValidationException ;
10
+ use Tests \Models \BasicModel ;
10
11
use Tests \Models \CustomKeyModel ;
11
12
use Tests \Models \CustomSaltModel ;
12
13
use Tests \Models \HashModel ;
@@ -181,6 +182,13 @@ public function test_route_binding()
181
182
182
183
$ resolved = $ m ->resolveRouteBinding ($ m ->hash );
183
184
$ this ->assertTrue ($ resolved ->is ($ m ));
185
+
186
+ // revert to original
187
+ $ m = new BasicModel ();
188
+ $ m ->save ();
189
+
190
+ $ resolved = $ m ->resolveRouteBinding ($ m ->getKey ());
191
+ $ this ->assertTrue ($ resolved ->is ($ m ));
184
192
}
185
193
186
194
protected function getRepository (): Repository
You can’t perform that action at this time.
0 commit comments