From 917a673f0503bc16ad212d1b1852e28399bd6374 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Fri, 13 Oct 2017 13:06:51 +0100 Subject: [PATCH] Save an archive link of bookmarks --- app/Jobs/ProcessBookmark.php | 4 ++-- .../migrations/2017_10_07_163425_create_bookmarks_table.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Jobs/ProcessBookmark.php b/app/Jobs/ProcessBookmark.php index 1afcc94d..636e96a9 100644 --- a/app/Jobs/ProcessBookmark.php +++ b/app/Jobs/ProcessBookmark.php @@ -46,8 +46,8 @@ class ProcessBookmark implements ShouldQueue //get an internet archive link $response = $client->request('GET', 'https://web.archive.org/save/' . $this->bookmark->url); if ($response->hasHeader('Content-Location')) { - if (starts_with($response->getHeader('Content-Location'), '/web')) { - $this->bookmark->archive = $response->getHeader('Content-Location'); + if (starts_with($response->getHeader('Content-Location')[0], '/web')) { + $this->bookmark->archive = $response->getHeader('Content-Location')[0]; } } diff --git a/database/migrations/2017_10_07_163425_create_bookmarks_table.php b/database/migrations/2017_10_07_163425_create_bookmarks_table.php index 4e01ef20..7b5b3bdb 100644 --- a/database/migrations/2017_10_07_163425_create_bookmarks_table.php +++ b/database/migrations/2017_10_07_163425_create_bookmarks_table.php @@ -19,7 +19,7 @@ class CreateBookmarksTable extends Migration $table->string('name')->nullable(); $table->text('content')->nullable(); $table->uuid('screenshot')->nullable(); - $table->string('archve')->nullable(); + $table->string('archive')->nullable(); $table->timestamps(); }); }