mercredi 26 décembre 2018

How do you register custom methods like those within Application.php in Laravel

I am wondering how to register custom method within:

Illuminate/Foundation/Application.php

Like:

/**
 * Get the current application name.
 *
 * @return string
 */
public function getName()
{
    return $this['config']->get('app.name');
}

Taken from:

/**
 * Get the current application locale.
 *
 * @return string
 */
public function getLocale()
{
    return $this['config']->get('app.locale');
}

Where should I put this, instead of vendor file ofc?

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire