# fromProject

Learn how to build a provider from the committed content.

This static method builds a provider from the content [downloaded with the CLI](/reference/cli/fallback-content), reading the configuration and content files from the project directory.

## Signature

This method has the following signature:

```php
public static function fromProject(?string $projectDirectory = null): ?self
```

This method returns a new instance, or `null` when the content files cannot be located.

## Example

Here is a basic example of how to build a provider from the project content:

```php
<?php
use Croct\Plug\Content\DefaultContentProvider;

$provider = DefaultContentProvider::fromProject();
```

## Parameters

The following list describes the supported parameters:

- `projectDirectory`: `string|null` (optional) (default: null)

  The directory to read the content files from. The default is `null`, which uses the root package's install path.
