file_get_contents

Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Reads entire file into a string
file_get_contents(    string $filename,    bool $use_include_path false,    ?resource $context null,    int $offset 0,    ?int $length null): string|false
    protected function emailOutput(Mailer $mailer$addresses$onlyIfOutputExists false)

    {

        
$text is_file($this->output) ? file_get_contents($this->output) : '';



        if (
$onlyIfOutputExists && empty($text)) {

            return;
    protected function withOutputCallback(Closure $callback$onlyIfOutputExists false)

    {

        return function (
Container $container) use ($callback$onlyIfOutputExists) {

            
$output $this->output && is_file($this->output) ? file_get_contents($this->output) : '';



            return 
$onlyIfOutputExists && empty($output)

                            ? 
null
    public function get($path$lock false)

    {

        if (
$this->isFile($path)) {

            return 
$lock $this->sharedGet($path) : file_get_contents($path);

        }



        throw new 
FileNotFoundException("File does not exist at path {$path}.");
    public function replaceInFile($search$replace$path)

    {

        
file_put_contents($pathstr_replace($search$replacefile_get_contents($path)));

    }
        }



        
file_put_contents($path$this->formatFacadeStub(

            
$aliasfile_get_contents(__DIR__.'/stubs/facade.stub')

        ));



        return 
$path;
            return $this->namespace;

        }



        
$composer json_decode(file_get_contents($this->basePath('composer.json')), true);



        foreach ((array) 
data_get($composer'autoload.psr-4') as $namespace => $path) {

            foreach ((array) 
$path as $pathChoice) {
            file_put_contents(

                
storage_path('framework/maintenance.php'),

                
file_get_contents(__DIR__.'/stubs/maintenance-mode.stub')

            );



            
$this->laravel->get('events')->dispatch(MaintenanceModeEnabled::class);
        file_put_contents($this->laravel->environmentFilePath(), preg_replace(

            
$this->keyReplacementPattern(),

            
'APP_KEY='.$key,

            
file_get_contents($this->laravel->environmentFilePath())

        ));

    }
            $this->files->makeDirectory(dirname($path), 0755true);

        }



        
$this->files->put($pathfile_get_contents(__DIR__.'/stubs/markdown.stub'));

    }
            $this->files->makeDirectory(dirname($path), 0755true);

        }



        
$this->files->put($pathfile_get_contents(__DIR__.'/stubs/markdown.stub'));

    }
        foreach ($files as $from => $to) {

            if ((! 
$this->option('existing') && (! file_exists($to) || $this->option('force')))

                || (
$this->option('existing') && file_exists($to))) {

                
file_put_contents($tofile_get_contents($from));

            }

        }
    public function data(): array

    {

        return 
json_decode(file_get_contents($this->path()), true);

    }
        }



        if (
is_file(public_path($manifestDirectory.'/hot'))) {

            
$url rtrim(file_get_contents(public_path($manifestDirectory.'/hot')));



            
$customUrl app('config')->get('app.mix_hot_proxy_url');
                throw new Exception("Mix manifest not found at: {$manifestPath}");

            }



            
$manifests[$manifestPath] = json_decode(file_get_contents($manifestPath), true);

        }



        
$manifest $manifests[$manifestPath];
            return [];

        }



        return 
json_decode(file_get_contents(

            
$this->basePath.'/composer.json'

        
), true)['extra']['laravel']['dont-discover'] ?? [];

    }