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 namespace Illuminate\Tests\Integration\Database; use Illuminate\Database\Eloquent\..
Decoded Output download
<?php
namespace Illuminate\Tests\Integration\Database;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class EloquentModelWithoutEventsTest extends DatabaseTestCase
{
protected function afterRefreshingDatabase()
{
Schema::create('auto_filled_models', function (Blueprint $table) {
$table->increments('id');
$table->text('project')->nullable();
});
}
public function testWithoutEventsRegistersBootedListenersForLater()
{
$model = AutoFilledModel::withoutEvents(function () {
return AutoFilledModel::create();
});
$this->assertNull($model->project);
$model->save();
$this->assertSame('Laravel', $model->project);
}
}
class AutoFilledModel extends Model
{
public $table = 'auto_filled_models';
public $timestamps = false;
protected $guarded = [];
public static function boot()
{
parent::boot();
static::saving(function ($model) {
$model->project = 'Laravel';
});
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Illuminate\Tests\Integration\Database;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class EloquentModelWithoutEventsTest extends DatabaseTestCase
{
protected function afterRefreshingDatabase()
{
Schema::create('auto_filled_models', function (Blueprint $table) {
$table->increments('id');
$table->text('project')->nullable();
});
}
public function testWithoutEventsRegistersBootedListenersForLater()
{
$model = AutoFilledModel::withoutEvents(function () {
return AutoFilledModel::create();
});
$this->assertNull($model->project);
$model->save();
$this->assertSame('Laravel', $model->project);
}
}
class AutoFilledModel extends Model
{
public $table = 'auto_filled_models';
public $timestamps = false;
protected $guarded = [];
public static function boot()
{
parent::boot();
static::saving(function ($model) {
$model->project = 'Laravel';
});
}
}
Function Calls
None |
Stats
MD5 | 1f90954a1d4354b2815be26bafe6c860 |
Eval Count | 0 |
Decode Time | 98 ms |