Skip to content

Commit 432597c

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 2e0b86f + 5f4973e commit 432597c

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "code16/sharp",
33
"description": "Laravel Content Management Framework",
4+
"license": "MIT",
45
"authors": [
56
{
67
"name": "Philippe Lonchampt",
@@ -60,7 +61,7 @@
6061
}
6162
},
6263
"scripts": {
63-
"test": "vendor/bin/testbench package:test --parallel",
64+
"test": "vendor/bin/pest --parallel",
6465
"typescript:generate": "php demo/artisan ziggy:generate --types-only; php demo/artisan typescript:transform",
6566
"post-autoload-dump": [
6667
"git config core.hooksPath scripts/hooks"

demo/app/Sharp/Posts/PostForm.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use Code16\Sharp\Form\Layout\FormLayoutTab;
3131
use Code16\Sharp\Form\SharpForm;
3232
use Code16\Sharp\Utils\Fields\FieldsContainer;
33+
use Illuminate\Support\Carbon;
3334
use Illuminate\Support\Facades\Blade;
3435

3536
class PostForm extends SharpForm
@@ -130,8 +131,8 @@ public function buildFormFields(FieldsContainer $formFields): void
130131
Including {{ count($attachments) }} attachments
131132
({{ count($fileAttachments) }} files, {{ count($linkAttachments) }} links).
132133
blade, [
133-
'published_at' => \Carbon\Carbon::parse($data['published_at'])->isoFormat('LLLL'),
134-
'author' => \App\Models\User::find($data['author_id']),
134+
'published_at' => isset($data['published_at']) ? Carbon::parse($data['published_at'])->isoFormat('LLLL') : null,
135+
'author' => isset($data['author_id']) ? User::find($data['author_id']) : null,
135136
'attachments' => $data['attachments'] ?? [],
136137
'linkAttachments' => collect($data['attachments'] ?? [])->where('is_link', true),
137138
'fileAttachments' => collect($data['attachments'] ?? [])->where('is_link', false),

0 commit comments

Comments
 (0)