A
A
Abc Edc2015-11-05 17:53:15
MySQL
Abc Edc, 2015-11-05 17:53:15

How to take item which have the same column value in laravel?

Get all the news along with the link in the connection column. That is, the related news in the connection column should have the same value.

News::with(array( 'connections' /* Вот оно*/))->select([...]);

and trying to connect
public function connections()
    {
        return $this->hasMany('App\News',  'connection','connection');
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Ko1, 2015-11-05
@Ko1

I don't know what your database structure is, they usually use ->where('column_name', '=', value)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question