Skip to content

Commit 49ea362

Browse files
binarykgithub-actions[bot]
authored andcommitted
Fix styling
1 parent b3c1e34 commit 49ea362

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

src/Exceptions/Solutions/OpenAiSolution.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,16 @@ public function __construct(protected Throwable $throwable)
1818
now()->addHour(),
1919
fn () => OpenAI::chat()->create([
2020
'model' => config('restify.ai_solutions.model', 'gpt-4.1-mini'),
21-
'messages' =>
21+
'messages' => [
2222
[
23-
[
24-
'role' => 'user',
25-
'content' => $this->generatePrompt($this->throwable),
26-
],
27-
[
28-
'role' => 'system',
29-
'content' => 'Provide a concise solution to the problem described, tailored for a Laravel application using the Restify framework. Avoid explanations, examples, or code snippets. Respond with only the direct answer.',
30-
],
23+
'role' => 'user',
24+
'content' => $this->generatePrompt($this->throwable),
3125
],
26+
[
27+
'role' => 'system',
28+
'content' => 'Provide a concise solution to the problem described, tailored for a Laravel application using the Restify framework. Avoid explanations, examples, or code snippets. Respond with only the direct answer.',
29+
],
30+
],
3231
'max_tokens' => config('restify.ai_solutions.max_tokens', 1000),
3332
'temperature' => 0,
3433
])->choices[0]->message->content

src/Repositories/Repository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ public function collectFields(RestifyRequest $request): FieldCollection
250250

251251
$allFields = $this->filter($this->{$method}($request));
252252

253-
$regularFields = array_filter($allFields, function($field) {
254-
return !($field instanceof EagerField);
253+
$regularFields = array_filter($allFields, function ($field) {
254+
return ! ($field instanceof EagerField);
255255
});
256256

257257
return FieldCollection::make(

src/Traits/InteractWithSearch.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public static function collectRelated(): RelatedCollection
5050
$related = static::include();
5151

5252
if (empty($related)) {
53-
$instance = new static();
53+
$instance = new static;
5454
$request = app(RestifyRequest::class);
5555
$fields = $instance->fields($request);
5656

5757
$eagerFields = collect($fields)
58-
->filter(fn($field) => $field instanceof EagerField)
59-
->mapWithKeys(fn($field) => [$field->attribute => $field])
58+
->filter(fn ($field) => $field instanceof EagerField)
59+
->mapWithKeys(fn ($field) => [$field->attribute => $field])
6060
->toArray();
6161

6262
$related = $eagerFields;

src/helpers.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ function currentRepository(): Repository
7474
}
7575
}
7676

77-
7877
if (! function_exists('belongsTo')) {
7978
function belongsTo(string $attribute, string $repository): Binaryk\LaravelRestify\Fields\BelongsTo
8079
{

0 commit comments

Comments
 (0)