R#
Size: a a a
R#
HM
try {
$this->container['capsule']::beginTransaction();
$item = $id ? $this->model::find($id) : new $this->model;
$item->name = $data['name'];
$item->save();
$this->container['capsule']::commit();
} catch (Exception $e) {
$this->container['capsule']::rollback();
throw new Exception($e->getMessage());
}
HM
.
SC
ВШ
try {
$this->container['capsule']::beginTransaction();
$item = $id ? $this->model::find($id) : new $this->model;
$item->name = $data['name'];
$item->save();
$this->container['capsule']::commit();
} catch (Exception $e) {
$this->container['capsule']::rollback();
throw new Exception($e->getMessage());
}
HM
use Illuminate\Database\Eloquent\SoftDeletes;
class Product extends BaseModel
{
use SoftDeletes;
public $timestamps = false;
protected $dates = ['deleted_at'];
protected $attributes = ['isTrashed'];
public function lots() {
return $this->belongsTo("Model\Lot");
}
public function getIsTrashedAttribute() {
return $this->trashed();
}
}
R#
HM
.
HM
.
R#
HM
R#
Д
HM
R#