mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-16 05:50:55 +08:00
up
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
namespace Nexus\Plugin;
|
||||
|
||||
use App\Repositories\BaseRepository;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
abstract class BasePlugin extends BaseRepository
|
||||
{
|
||||
@@ -44,4 +42,14 @@ abstract class BasePlugin extends BaseRepository
|
||||
$pluginRoot = dirname($reflection->getFileName(), 2);
|
||||
return $pluginRoot . "/resources/views/" . trim($name, "/");
|
||||
}
|
||||
|
||||
public function trans($name): string
|
||||
{
|
||||
return nexus_trans(sprintf("%s::%s", static::ID, $name));
|
||||
}
|
||||
|
||||
public static function getInstance(): static
|
||||
{
|
||||
return Plugin::getById(static::ID);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user