mirror of
https://github.com/Kovah/LinkAce.git
synced 2025-03-14 19:59:38 +01:00
Add new link field for disabling checks (#93)
This commit is contained in:
parent
eb03855c3c
commit
1d63b440d2
@ -128,8 +128,12 @@ class CheckLinksCommand extends Command
|
||||
// Get the total amount of remaining links
|
||||
$this->total = Link::count();
|
||||
|
||||
// Get a porton of the remaining links based on the limit
|
||||
return Link::orderBy('id', 'ASC')->offset($this->offset)->limit($this->limit)->get();
|
||||
// Get a portion of the remaining links based on the limit
|
||||
return Link::where('check_disabled', false)
|
||||
->orderBy('id', 'ASC')
|
||||
->offset($this->offset)
|
||||
->limit($this->limit)
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,8 +21,9 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
* @property string $title
|
||||
* @property string|null $description
|
||||
* @property string|null $icon
|
||||
* @property int $is_private
|
||||
* @property boolean $is_private
|
||||
* @property int $status
|
||||
* @property boolean $check_disabled
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $deleted_at
|
||||
@ -46,12 +47,14 @@ class Link extends Model
|
||||
'icon',
|
||||
'is_private',
|
||||
'status',
|
||||
'check_disabled',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'integer',
|
||||
'is_private' => 'boolean',
|
||||
'status' => 'integer',
|
||||
'check_disabled' => 'boolean',
|
||||
];
|
||||
|
||||
public const STATUS_OK = 1;
|
||||
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCheckDisabledToLinksTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('links', function (Blueprint $table) {
|
||||
$table->boolean('check_disabled')->default(false)->after('status');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('links', function (Blueprint $table) {
|
||||
$table->dropColumn(['check_disabled']);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user