The app function returns the service container instance:
$container app();
        try {

            
$content StoreBuilder::createWithNoNames()

                ->
addPath(app()->environmentPath())

                ->
addName(app()->environmentFile())

                ->
make()

                ->
read();
        try {

            
$content StoreBuilder::createWithNoNames()

                ->
addPath(app()->environmentPath())

                ->
addName(app()->environmentFile())

                ->
make()

                ->
read();
    public function updateEnvironmentFile($server)

    {

        if (
File::exists($env app()->environmentFile())) {

            
$contents File::get($env);



            if (! 
Str::contains($contents'OCTANE_SERVER=')) {
    protected function reloadSwooleServer()

    {

        
$inspector app(SwooleServerProcessInspector::class);



        if (! 
$inspector->serverIsRunning()) {

            
$this->error('Octane server is not running.');
    protected function reloadRoadRunnerServer()

    {

        
$inspector app(RoadRunnerServerProcessInspector::class);



        if (! 
$inspector->serverIsRunning()) {

            
$this->error('Octane server is not running.');
            '-o''http.static.dir=public',

            
'-o''http.middleware='.config('octane.roadrunner.http_middleware''static'),

            
'-o''logs.mode=production',

            
'-o'app()->environment('local') ? 'logs.level=debug' 'logs.level=warning',

            
'-o''logs.output=stdout',

            
'-o''logs.encoding=json',

            
'serve',
            '-o''logs.encoding=json',

            
'serve',

        ]), 
base_path(), [

            
'APP_ENV' => app()->environment(),

            
'APP_BASE_PATH' => base_path(),

            
'LARAVEL_OCTANE' => 1,

        ]))->
start();
        $server tap(new Process([

            (new 
PhpExecutableFinder)->find(), 'swoole-server'$serverStateFile->path(),

        ], 
realpath(__DIR__.'/../../bin'), [

            
'APP_ENV' => app()->environment(),

            
'APP_BASE_PATH' => base_path(),

            
'LARAVEL_OCTANE' => 1,

        ]))->
start();
            'enable_coroutine' => false,

            
'daemonize' => false,

            
'log_file' => storage_path('logs/swoole_http.log'),

            
'log_level' => app()->environment('local') ? SWOOLE_LOG_INFO SWOOLE_LOG_ERROR,

            
'max_request' => $this->option('max-requests'),

            
'package_max_length' => 10 1024 1024,

            
'reactor_num' => $this->workerCount($extension),
    protected function isSwooleServerRunning()

    {

        return 
app(SwooleServerProcessInspector::class)

            ->
serverIsRunning();

    }
    protected function isRoadRunnerServerRunning()

    {

        return 
app(RoadRunnerServerProcessInspector::class)

            ->
serverIsRunning();

    }
    protected function stopSwooleServer()

    {

        
$inspector app(SwooleServerProcessInspector::class);



        if (! 
$inspector->serverIsRunning()) {

            
app(SwooleServerStateFile::class)->delete();
        $inspector app(SwooleServerProcessInspector::class);



        if (! 
$inspector->serverIsRunning()) {

            
app(SwooleServerStateFile::class)->delete();



            
$this->error('Swoole server is not running.');
            return 1;

        }



        
app(SwooleServerStateFile::class)->delete();



        return 
0;

    }
    protected function stopRoadRunnerServer()

    {

        
$inspector app(RoadRunnerServerProcessInspector::class);



        if (! 
$inspector->serverIsRunning()) {

            
app(RoadRunnerServerStateFile::class)->delete();