How to get last inserted record ID in YII2

Yii2: By using following statement you can get last inserted record ID.


Yii::$app->db->getLastInsertID()