User::class, ]; public $morphOne = [ 'transaction' => [Transaction::class, 'name' => 'transactable'] ]; private function createTransaction(){ $transaction = new Transaction([ 'user_id' => $this->user_id, 'amount' => 0 - $this->payed_for_request, 'description' => "Kotirowkalar (import bahalar) #{$this->id} ucin arzaƈ tutumy." ]); $this->transaction()->save($transaction); } public function afterCreate() { parent::afterCreate(); $this->createTransaction(); } }