Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php use App\Models\Song; use Illuminate\Database\Eloquent\Collection; use Illuminate\Da..
Decoded Output download
<?php
use App\Models\Song;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Migrations\Migration;
class CopyArtistToContributingArtist extends Migration
{
public function up(): void
{
/** @var Collection|array<array-key, Song> $songs */
$songs = Song::with('album', 'album.artist')->get();
$songs->each(static function (Song $song): void {
if (!$song->contributing_artist_id) {
$song->contributing_artist_id = $song->album->artist->id;
$song->save();
}
});
}
public function down(): void
{
}
}
?>
Did this file decode correctly?
Original Code
<?php
use App\Models\Song;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Migrations\Migration;
class CopyArtistToContributingArtist extends Migration
{
public function up(): void
{
/** @var Collection|array<array-key, Song> $songs */
$songs = Song::with('album', 'album.artist')->get();
$songs->each(static function (Song $song): void {
if (!$song->contributing_artist_id) {
$song->contributing_artist_id = $song->album->artist->id;
$song->save();
}
});
}
public function down(): void
{
}
}
Function Calls
None |
Stats
MD5 | 8478018e8c53490d26d59a091768dcfb |
Eval Count | 0 |
Decode Time | 101 ms |