Last active
February 2, 2023 09:01
-
-
Save Sairahcaz/a3091060661d5b14e758f56795a84361 to your computer and use it in GitHub Desktop.
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
| <?php | |
| use LaracraftTech\LaravelUsefulTraits\UsefulScopes; | |
| DB::table('scope_test_table')->insert([ | |
| 'foo' => 'foo', | |
| 'bar' => 'bar', | |
| 'quz' => 'quz', | |
| ]); | |
| $class = new class extends Model | |
| { | |
| use UsefulScopes; | |
| protected $table = 'scope_test_table'; | |
| }; | |
| $class::query()->selectAllBut(['foo'])->first()->toArray(); | |
| // return ['bar' => 'bar', 'quz' => 'quz'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment