Skip to content

Commit

Permalink
Merge pull request #7 from TheDragonCode/1.x
Browse files Browse the repository at this point in the history
Removed Laravel 5.6 support and Added column with URL decoding
  • Loading branch information
Andrey Helldar authored Nov 10, 2021
2 parents 598626a + 5a30cd1 commit eacda0d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
},
"require": {
"php": "^7.1.3|^8.0",
"illuminate/database": "^5.6|^6.0|^7.0|^8.0",
"illuminate/http": "^5.6|^6.0|^7.0|^8.0",
"illuminate/support": "^5.6|^6.0|^7.0|^8.0",
"illuminate/console": "^6.0|^7.0|^8.0",
"illuminate/database": "^6.0|^7.0|^8.0",
"illuminate/support": "^6.0|^7.0|^8.0",
"nesbot/carbon": "^1.20|^2.0"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/Services/Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function updateOrCreate(string $url, DateTimeInterface $date = null): voi

Model::query()->updateOrCreate(
compact('key'),
compact('updated_at')
compact('url', 'updated_at')
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Services/LastItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ private function rules(): array
return ['url' => 'required|url'];
}

private function messages(string $url = null)
private function messages(string $url = null): array
{
return [
'url.required' => 'The URL field is required.',
'url.url' => "URL \"{$url}\" is incorrect!",
'url.url' => "URL \"$url\" is incorrect!",
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class ChangeLastModifiedTableAddUrlColumn extends Migration
{
protected $table = 'last_modified';

public function up()
{
Schema::table($this->table, function (Blueprint $table) {
$table->text('url')->nullable()->after('key');
});
}

public function down()
{
Schema::table($this->table, function (Blueprint $table) {
$table->dropColumn('url');
});
}
}

0 comments on commit eacda0d

Please sign in to comment.