rtrim

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the end of a string
Alias chop
rtrim(string $stringstring $characters " \n\r\t\v\x00"): string
        $classPath = static::generatePathFromNamespace($classNamespace);

        
$testPath = static::generateTestPathFromNamespace($this->baseTestNamespace);



        
$this->baseClassPath rtrim($classPathDIRECTORY_SEPARATOR).'/';

        
$this->baseViewPath rtrim($viewPathDIRECTORY_SEPARATOR).'/';

        
$this->baseTestPath rtrim($testPathDIRECTORY_SEPARATOR).'/';
        $testPath = static::generateTestPathFromNamespace($this->baseTestNamespace);



        
$this->baseClassPath rtrim($classPathDIRECTORY_SEPARATOR).'/';

        
$this->baseViewPath rtrim($viewPathDIRECTORY_SEPARATOR).'/';

        
$this->baseTestPath rtrim($testPathDIRECTORY_SEPARATOR).'/';



        if(! empty(
$stubSubDirectory) && str($stubSubDirectory)->startsWith('..')) {
        $this->baseClassPath rtrim($classPathDIRECTORY_SEPARATOR).'/';

        
$this->baseViewPath rtrim($viewPathDIRECTORY_SEPARATOR).'/';

        
$this->baseTestPath rtrim($testPathDIRECTORY_SEPARATOR).'/';



        if(! empty(
$stubSubDirectory) && str($stubSubDirectory)->startsWith('..')) {

            
$this->stubDirectory rtrim(str($stubSubDirectory)->replaceFirst('..' DIRECTORY_SEPARATOR''), DIRECTORY_SEPARATOR).'/';
        $this->baseTestPath rtrim($testPathDIRECTORY_SEPARATOR).'/';



        if(! empty(
$stubSubDirectory) && str($stubSubDirectory)->startsWith('..')) {

            
$this->stubDirectory rtrim(str($stubSubDirectory)->replaceFirst('..' DIRECTORY_SEPARATOR''), DIRECTORY_SEPARATOR).'/';

        } else {

            
$this->stubDirectory rtrim('stubs'.DIRECTORY_SEPARATOR.$stubSubDirectoryDIRECTORY_SEPARATOR).'/';

        }
        if(! empty($stubSubDirectory) && str($stubSubDirectory)->startsWith('..')) {

            
$this->stubDirectory rtrim(str($stubSubDirectory)->replaceFirst('..' DIRECTORY_SEPARATOR''), DIRECTORY_SEPARATOR).'/';

        } else {

            
$this->stubDirectory rtrim('stubs'.DIRECTORY_SEPARATOR.$stubSubDirectoryDIRECTORY_SEPARATOR).'/';

        }



        
$directories preg_split('/[.\/(\\\\)]+/'$rawCommand);
        $classPath = static::generatePathFromNamespace($classNamespace);



        
$this->baseClassPath rtrim($classPathDIRECTORY_SEPARATOR).'/Stubs/';

        
$this->baseViewPath rtrim($viewPathDIRECTORY_SEPARATOR).'/stubs/';



        
$directories preg_split('/[.\/]+/'$rawCommand);
        $classPath = static::generatePathFromNamespace($classNamespace);



        
$this->baseClassPath rtrim($classPathDIRECTORY_SEPARATOR).'/Stubs/';

        
$this->baseViewPath rtrim($viewPathDIRECTORY_SEPARATOR).'/stubs/';



        
$directories preg_split('/[.\/]+/'$rawCommand);
    }



    public static function 
stack($name$default '') {

        
$expression rtrim("{$name}{$default}"', ');



        return 
"

            <template livewire-stack=\"<?php echo 
{$name}; ?>\"></template>
    public static function push($name$content '') {

        
$randomKey Str::random(9);

        
$expression rtrim("{$name}{$content}"', ');



        return 
"<?php

            if (isset(\$_instance)) {
    public static function prepend($name$content '') {

        
$randomKey Str::random(9);

        
$expression rtrim("{$name}{$content}"', ');



        return 
"<?php

            if (isset(\$_instance)) {
    {

        
$jsonEncodedOptions $options json_encode($options) : '';



        
$assetsUrl config('livewire.asset_url') ?: rtrim($options['asset_url'] ?? '''/');



        
$appUrl config('livewire.app_url')

            ?: 
rtrim($options['app_url'] ?? '''/')
        $assetsUrl config('livewire.asset_url') ?: rtrim($options['asset_url'] ?? '''/');



        
$appUrl config('livewire.app_url')

            ?: 
rtrim($options['app_url'] ?? '''/')

            ?: 
$assetsUrl;



        
$jsLivewireToken app()->has('session.store') ? "'" csrf_token() . "'" 'null';
            return $file;

        }



        
$cwd rtrim($cwdDIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;



        return 
preg_replace('/^' preg_quote($cwd'/') . '/'''$file);

    }
    protected function concatPathToUrl($url$path)

    {

        return 
rtrim($url'/').'/'.ltrim($path'/');

    }
    public static function setFacadeNamespace($namespace)

    {

        static::
$facadeNamespace rtrim($namespace'\\').'\\';

    }