You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+133Lines changed: 133 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,13 +49,146 @@ Once installed, you're ready to start coding with Cursor, Claude Code, or your A
49
49
| Generate Action | Generate Laravel Restify action classes for custom business logic |
50
50
| Generate Getter | Generate Laravel Restify getter classes for data transformation |
51
51
| Generate Match Filter | Generate Laravel Restify match filter classes for advanced filtering |
52
+
| Debug Application | Comprehensive debugging tool for Laravel Restify applications with health checks and diagnostics |
53
+
| Upgrade Restify | Automated tool to upgrade Laravel Restify from version 9.x to 10.x with migration assistance |
52
54
53
55
## Available Documentation
54
56
55
57
| Package | Coverage |
56
58
|---------|----------|
57
59
| Laravel Restify | Complete documentation including API methods, field types, authentication, authorization, and performance guides |
58
60
61
+
## Specialized Tools
62
+
63
+
### Debug Application Tool
64
+
65
+
The Debug Application Tool provides comprehensive diagnostics for Laravel Restify applications, helping developers identify and resolve common issues quickly.
-**Automatic Issue Detection**: Severity classification with detailed reporting
75
+
-**Safe Auto-Fixes**: Automatically resolve common configuration problems
76
+
77
+
#### Parameters
78
+
79
+
-`check_type` (optional): Target specific areas - 'all', 'config', 'database', 'restify', 'performance', 'health' (default: 'all')
80
+
-`detailed_output` (optional): Include comprehensive diagnostic details (default: true)
81
+
-`fix_issues` (optional): Automatically resolve common configuration problems (default: false)
82
+
-`export_report` (optional): Save detailed markdown reports to storage/logs (default: false)
83
+
-`include_suggestions` (optional): Provide actionable improvement recommendations (default: true)
84
+
85
+
#### Usage Examples
86
+
87
+
```bash
88
+
# Run complete diagnostic
89
+
Debug Application with check_type="all"
90
+
91
+
# Check only database health
92
+
Debug Application with check_type="database"
93
+
94
+
# Run with automatic fixes
95
+
Debug Application with fix_issues=true
96
+
97
+
# Export detailed report
98
+
Debug Application with export_report=true detailed_output=true
99
+
```
100
+
101
+
### Upgrade Restify Tool
102
+
103
+
The Upgrade Restify Tool automates the migration process from Laravel Restify 9.x to 10.x, ensuring smooth transitions with comprehensive analysis and backup creation.
104
+
105
+
#### Features
106
+
107
+
-**PHP Attributes Migration**: Converts static `$model` properties to modern `#[Model]` attributes
108
+
-**Field-Level Configuration**: Migrates static `$search`/`$sort` arrays to field-level methods
109
+
-**Configuration Compatibility**: Checks and validates config file compatibility
110
+
-**Backup Creation**: Automatically creates backups before making changes
111
+
-**Comprehensive Reporting**: Detailed analysis with migration recommendations
112
+
-**Interactive Mode**: Confirmation prompts for each repository migration
113
+
-**Complexity Scoring**: Evaluates repository complexity for prioritization
114
+
115
+
#### Parameters
116
+
117
+
-`dry_run` (optional): Preview changes without applying them (default: true)
-`check_config` (optional): Check and report config file compatibility (default: true)
121
+
-`backup_files` (optional): Create backups of modified files (default: true)
122
+
-`interactive` (optional): Prompt for confirmation before each change (default: true)
123
+
-`path` (optional): Specific path to scan for repositories (defaults to app/Restify)
124
+
125
+
#### Migration Process
126
+
127
+
1.**Repository Discovery**: Scans for Laravel Restify repositories in standard locations
128
+
2.**Analysis Phase**: Evaluates each repository for migration requirements
129
+
3.**Backup Creation**: Creates timestamped backups of files before modification
130
+
4.**Attribute Migration**: Converts `public static $model = Model::class;` to `#[Model(Model::class)]`
131
+
5.**Field Migration**: Moves search/sort configuration to field-level methods
132
+
6.**Configuration Check**: Validates config file compatibility with v10
133
+
7.**Comprehensive Reporting**: Provides detailed migration report with next steps
134
+
135
+
#### Usage Examples
136
+
137
+
```bash
138
+
# Dry run analysis (recommended first step)
139
+
Upgrade Restify with dry_run=true
140
+
141
+
# Apply migrations with backups
142
+
Upgrade Restify with dry_run=false backup_files=true
143
+
144
+
# Migrate only attributes
145
+
Upgrade Restify with dry_run=false migrate_fields=false
146
+
147
+
# Non-interactive mode
148
+
Upgrade Restify with dry_run=false interactive=false
149
+
150
+
# Custom repository path
151
+
Upgrade Restify with path="/app/Custom/Repositories"
152
+
```
153
+
154
+
#### Before & After Examples
155
+
156
+
**Before (Laravel Restify 9.x):**
157
+
```php
158
+
class PostRepository extends Repository
159
+
{
160
+
public static string $model = Post::class;
161
+
162
+
public static array $search = ['title', 'content'];
163
+
public static array $sort = ['created_at', 'title'];
164
+
165
+
public function fields(RestifyRequest $request): array
166
+
{
167
+
return [
168
+
field('title'),
169
+
field('content'),
170
+
];
171
+
}
172
+
}
173
+
```
174
+
175
+
**After (Laravel Restify 10.x):**
176
+
```php
177
+
use Binaryk\LaravelRestify\Attributes\Model;
178
+
179
+
#[Model(Post::class)]
180
+
class PostRepository extends Repository
181
+
{
182
+
public function fields(RestifyRequest $request): array
183
+
{
184
+
return [
185
+
field('title')->searchable()->sortable(),
186
+
field('content')->searchable(),
187
+
];
188
+
}
189
+
}
190
+
```
191
+
59
192
## Manually Registering the MCP Server
60
193
61
194
Sometimes you may need to manually register the Restify Boost MCP server with your editor of choice. You should register the MCP server using the following details:
Copy file name to clipboardExpand all lines: src/Docs/en/api/fields.md
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1374,6 +1374,79 @@ class AvatarStore implements Storable
1374
1374
You can use the <code>php artisan restify:store AvatarStore</code> command to generate a store file.
1375
1375
</alert>
1376
1376
1377
+
## Lazy Loading
1378
+
1379
+
Fields can be configured to lazy load relationships, which is particularly useful for computed attributes that depend on related models. This helps avoid N+1 queries by ensuring relationships are loaded only when needed.
1380
+
1381
+
### Making Fields Lazy
1382
+
1383
+
Use the `lazy()` method to mark a field for lazy loading:
1384
+
1385
+
```php
1386
+
public function fields(RestifyRequest $request)
1387
+
{
1388
+
return [
1389
+
// Lazy load the 'tags' relationship when displaying profileTagNames
0 commit comments