How to check given folder contains Files in Magento 2?

Magento 2, You can check the given folder path contains the file or not using the isFile() method.

For example, You have an image inside the pub/media folder with path,
$imagePath = ‘/catalog/product/placeholder/default/coming-soon.jpg’;

You can see a placeholder image at the above location in the media folder.

How to remove all MSI modules in Magento 2?

Multi-source Inventory is a new concept launched by Magento from Magento 2.3.* Version.

Earlier version (Before Magento 2.3) of Magento doesn’t support MSI feature.

MSI is used for multi-source concept used for inventory management at a single or multiple source location.

Get Base Url in Model or Plugin file Magento 2.

You can get the base URL of the store in the controller file using Store Manager Interface.

To Retrieve the Base URL of the current store, You need to instantiate constructor in your controller file,

Check below code snippet for getting base URL,