protected function deleteUploads()
{
$fileService = $this->app->make(\BookStack\Uploads\AttachmentService::class);
protected function deleteUploads()
{
$fileService = $this->app->make(\BookStack\Uploads\AttachmentService::class);
- 'link' => 'https://example.com',
- 'name' => 'Example Attachment Link',
- 'uploaded_to' => $page->id,
+ 'attachment_link_url' => 'https://example.com',
+ 'attachment_link_name' => 'Example Attachment Link',
+ 'attachment_link_uploaded_to' => $page->id,
'path' => 'https://example.com',
'name' => 'Example Attachment Link',
'uploaded_to' => $page->id,
'path' => 'https://example.com',
'name' => 'Example Attachment Link',
'uploaded_to' => $page->id,
$attachment = Attachment::orderBy('id', 'desc')->take(1)->first();
$pageGet = $this->get($page->getUrl());
$attachment = Attachment::orderBy('id', 'desc')->take(1)->first();
$pageGet = $this->get($page->getUrl());
- 'link' => 'https://example.com',
- 'name' => 'Example Attachment Link',
- 'uploaded_to' => $page->id,
+ 'attachment_link_url' => 'https://example.com',
+ 'attachment_link_name' => 'Example Attachment Link',
+ 'attachment_link_uploaded_to' => $page->id,
- 'uploaded_to' => $page->id,
- 'name' => 'My new attachment name',
- 'link' => 'https://test.example.com'
+ 'attachment_edit_name' => 'My new attachment name',
+ 'attachment_edit_url' => 'https://test.example.com'
'path' => 'https://test.example.com',
'name' => 'My new attachment name',
'uploaded_to' => $page->id
];
$update->assertStatus(200);
'path' => 'https://test.example.com',
'name' => 'My new attachment name',
'uploaded_to' => $page->id
];
$update->assertStatus(200);
$filePath = storage_path($attachment->path);
$this->assertTrue(file_exists($filePath), 'File at path ' . $filePath . ' does not exist');
$filePath = storage_path($attachment->path);
$this->assertTrue(file_exists($filePath), 'File at path ' . $filePath . ' does not exist');
$this->delete($attachment->getUrl());
$this->assertDatabaseMissing('attachments', [
$this->delete($attachment->getUrl());
$this->assertDatabaseMissing('attachments', [