'string', 'user_id' => 'factory|User', 'class' => 'Category' ]; protected $isSubclass = true; /** * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function transactionjournals() { return $this->belongsToMany('TransactionJournal', 'component_transaction_journal', 'component_id'); } }