PHP Class Nwidart\Modules\Repository

Inheritance: implements Nwidart\Modules\Contracts\RepositoryInterface, implements Countabl\Countable
Afficher le fichier Open project: nwidart/laravel-modules Class Usage Examples

Protected Properties

Свойство Type Description
$app Illuminate\Foundation\Application Application instance.
$path string | null The module path.
$paths array The scanned paths.
$stubPath string

Méthodes publiques

Méthode Description
__construct ( Illuminate\Foundation\Application $app, string | null $path = null ) The constructor.
active ( string $name ) : boolean Determine whether the given module is activated.
addLocation ( string $path ) Add other module location.
addPath ( string $path ) Alternative method for "addPath".
all ( ) : array Get all modules.
asset ( string $asset ) : string Get asset url from a specific module.
assetPath ( $module ) : string Get asset path for a specific module.
boot ( ) Boot the modules.
collections ( ) : Collection Get all modules as laravel collection instance.
config ( $key, null $default = null ) : mixed Get a specific config data from a configuration file.
count ( ) : integer Get count from all modules.
delete ( string $name ) : boolean Delete a specific module.
disable ( string $name ) : boolean Disabling a specific module.
disabled ( ) : array Get list of disabled modules.
enable ( string $name ) : boolean Enabling a specific module.
enabled ( ) : array Get list of enabled modules.
find ( $name ) : mixed | void Find a specific module.
findOrFail ( $name ) : Module Find a specific module, if there return that, otherwise throw exception.
get ( $name ) : mixed | void Alternative for "find" method.
getAssetsPath ( ) : string Get module assets path.
getByStatus ( $status ) : array Get modules by status.
getCached ( ) : array Get cached modules.
getFiles ( ) : Illuminate\Filesystem\Filesystem Get laravel filesystem instance.
getModulePath ( $module ) : string Get module path for a specific module.
getOrdered ( string $direction = 'asc' ) : array Get all ordered modules.
getPath ( ) : string Get a module path.
getPaths ( ) : array Get all additional paths.
getScanPaths ( ) : array Get scanned modules paths.
getStubPath ( ) : string Get stub path.
getUsed ( ) : string Get used now.
getUsedNow ( ) : string Get module used for cli session.
getUsedStoragePath ( ) : string Get storage path for module used.
has ( $name ) : boolean Determine whether the given module exist.
install ( string $name, string $version = 'dev-master', string $type = 'composer', boolean $subtree = false ) : Process Install the specified module.
notActive ( string $name ) : boolean Determine whether the given module is not activated.
register ( ) Register the modules.
scan ( ) : array Get & scan all modules.
setStubPath ( string $stubPath ) Set stub path.
setUsed ( $name ) Set module used for cli session.
toCollection ( ) : Collection Get all modules as collection instance.
update ( string $module ) Update dependencies for the specified module.

Méthodes protégées

Méthode Description
formatCached ( array $cached ) : array Format the cached data as array of modules.

Method Details

__construct() public méthode

The constructor.
public __construct ( Illuminate\Foundation\Application $app, string | null $path = null )
$app Illuminate\Foundation\Application
$path string | null

active() public méthode

Determine whether the given module is activated.
public active ( string $name ) : boolean
$name string
Résultat boolean

addLocation() public méthode

Add other module location.
public addLocation ( string $path )
$path string

addPath() public méthode

Alternative method for "addPath".
public addPath ( string $path )
$path string

all() public méthode

Get all modules.
public all ( ) : array
Résultat array

asset() public méthode

Get asset url from a specific module.
public asset ( string $asset ) : string
$asset string
Résultat string

assetPath() public méthode

Get asset path for a specific module.
public assetPath ( $module ) : string
$module
Résultat string

boot() public méthode

Boot the modules.
public boot ( )

collections() public méthode

Get all modules as laravel collection instance.
public collections ( ) : Collection
Résultat Collection

config() public méthode

Get a specific config data from a configuration file.
public config ( $key, null $default = null ) : mixed
$key
$default null
Résultat mixed

count() public méthode

Get count from all modules.
public count ( ) : integer
Résultat integer

delete() public méthode

Delete a specific module.
public delete ( string $name ) : boolean
$name string
Résultat boolean

disable() public méthode

Disabling a specific module.
public disable ( string $name ) : boolean
$name string
Résultat boolean

disabled() public méthode

Get list of disabled modules.
public disabled ( ) : array
Résultat array

enable() public méthode

Enabling a specific module.
public enable ( string $name ) : boolean
$name string
Résultat boolean

enabled() public méthode

Get list of enabled modules.
public enabled ( ) : array
Résultat array

find() public méthode

Find a specific module.
public find ( $name ) : mixed | void
$name
Résultat mixed | void

findOrFail() public méthode

Find a specific module, if there return that, otherwise throw exception.
public findOrFail ( $name ) : Module
$name
Résultat Module

formatCached() protected méthode

Format the cached data as array of modules.
protected formatCached ( array $cached ) : array
$cached array
Résultat array

get() public méthode

Alternative for "find" method.
public get ( $name ) : mixed | void
$name
Résultat mixed | void

getAssetsPath() public méthode

Get module assets path.
public getAssetsPath ( ) : string
Résultat string

getByStatus() public méthode

Get modules by status.
public getByStatus ( $status ) : array
$status
Résultat array

getCached() public méthode

Get cached modules.
public getCached ( ) : array
Résultat array

getFiles() public méthode

Get laravel filesystem instance.
public getFiles ( ) : Illuminate\Filesystem\Filesystem
Résultat Illuminate\Filesystem\Filesystem

getModulePath() public méthode

Get module path for a specific module.
public getModulePath ( $module ) : string
$module
Résultat string

getOrdered() public méthode

Get all ordered modules.
public getOrdered ( string $direction = 'asc' ) : array
$direction string
Résultat array

getPath() public méthode

Get a module path.
public getPath ( ) : string
Résultat string

getPaths() public méthode

Get all additional paths.
public getPaths ( ) : array
Résultat array

getScanPaths() public méthode

Get scanned modules paths.
public getScanPaths ( ) : array
Résultat array

getStubPath() public méthode

Get stub path.
public getStubPath ( ) : string
Résultat string

getUsed() public méthode

Get used now.
public getUsed ( ) : string
Résultat string

getUsedNow() public méthode

Get module used for cli session.
public getUsedNow ( ) : string
Résultat string

getUsedStoragePath() public méthode

Get storage path for module used.
public getUsedStoragePath ( ) : string
Résultat string

has() public méthode

Determine whether the given module exist.
public has ( $name ) : boolean
$name
Résultat boolean

install() public méthode

Install the specified module.
public install ( string $name, string $version = 'dev-master', string $type = 'composer', boolean $subtree = false ) : Process
$name string
$version string
$type string
$subtree boolean
Résultat Symfony\Component\Process\Process

notActive() public méthode

Determine whether the given module is not activated.
public notActive ( string $name ) : boolean
$name string
Résultat boolean

register() public méthode

Register the modules.
public register ( )

scan() public méthode

Get & scan all modules.
public scan ( ) : array
Résultat array

setStubPath() public méthode

Set stub path.
public setStubPath ( string $stubPath )
$stubPath string

setUsed() public méthode

Set module used for cli session.
public setUsed ( $name )
$name

toCollection() public méthode

Get all modules as collection instance.
public toCollection ( ) : Collection
Résultat Collection

update() public méthode

Update dependencies for the specified module.
public update ( string $module )
$module string

Property Details

$app protected_oe property

Application instance.
protected Application,Illuminate\Foundation $app
Résultat Illuminate\Foundation\Application

$path protected_oe property

The module path.
protected string|null $path
Résultat string | null

$paths protected_oe property

The scanned paths.
protected array $paths
Résultat array

$stubPath protected_oe property

protected string $stubPath
Résultat string