Menu

## EnvironmentPathGenerator
in package
implements PathGenerator

EnvironmentPathGenerator.php : 24

Class EnvironmentPathGenerator

Custom path generator for Spatie Media Library.

This class customizes the storage path for media files based on the authenticated user's school context.

Responsibilities:

- Define base media storage path
- Generate paths for original media
- Generate paths for conversions
- Generate paths for responsive images

### Table of Contents

#### Interfaces

PathGenerator

#### Properties

$path : string
  Base path where media files will be stored.

#### Methods

__construct() : void
  Create a new EnvironmentPathGenerator instance.
getPath() : string
  Get the base path for the given media.
getPathForConversions() : string
  Get the path for media conversions.
getPathForResponsiveImages() : string
  Get the path for responsive images.

### Properties

#### $path

EnvironmentPathGenerator.php : 31

Base path where media files will be stored.

`protected string $path`

### Methods

#### __construct()

EnvironmentPathGenerator.php : 41

Create a new EnvironmentPathGenerator instance.

`public __construct() : void`

Initializes the media storage path using the authenticated user's school slug.

#### getPath()

EnvironmentPathGenerator.php : 61

Get the base path for the given media.

`public getPath(Media $media) : string`

##### Parameters

$media : Media

##### Return values

string

#### getPathForConversions()

EnvironmentPathGenerator.php : 72

Get the path for media conversions.

`public getPathForConversions(Media $media) : string`

##### Parameters

$media : Media

##### Return values

string

#### getPathForResponsiveImages()

EnvironmentPathGenerator.php : 83

Get the path for responsive images.

`public getPathForResponsiveImages(Media $media) : string`

##### Parameters

$media : Media

##### Return values

string

## Search results