如何在laravel查询中使用IN运算符(eloquent和raw query)?

I need to use the IN operator to get the data from the database. I tried using it as below and got an error:

$pr =DB::('select * from prstuff p where p.pid in (select pid from prdrop)'); 

I am new to Laravel and don't know exactly how to use the operators like IN, so please explain to me how to use it.

you can set the custom select in DB::raw() like this :

DB::select(DB::raw('select * from prstuff p where p.pid in (select pid from prdrop)'));

or you can use whereIn() like this:

DB::table('prstuff')
->select('*')
->whereIn('pid', function($query)
{
    $query->select('pid')
    ->from('prdrop');
})
->get();

You are not calling any funtion on your db class. You can call the select function like this DB::select ()

$pr =DB::select('select * from prstuff p where p.pid in (select pid from prdrop)');