-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change document links attribute to text
- Loading branch information
Showing
5 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace App\Utils; | ||
|
||
class Nullable | ||
{ | ||
public static function call(mixed $value, callable $callable): mixed | ||
{ | ||
return ($value !== null) ? $callable($value) : null; | ||
} | ||
|
||
/** | ||
* @template TValue | ||
* @param TValue $first | ||
* @param TValue $other | ||
*/ | ||
public static function equals(mixed $first, mixed $other): bool | ||
{ | ||
return ($first === null) ? ($other === null) : ($other && $first->equals($other)); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
database/migrations/2024_10_08_222858_change_documents_links_to_text.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** @noinspection PhpUnusedAliasInspection */ | ||
|
||
use App\Utils\DatabaseMigrationHelper\DatabaseMigrationHelper as DMH; | ||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration { | ||
|
||
public function up(): void | ||
{ | ||
// documents links | ||
DB::table('attributes')->where('id', 'e1c14100-070d-4213-8927-6b7aed9617a4') | ||
->update(['type' => 'text']); | ||
} | ||
|
||
public function down(): void | ||
{ | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters