Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the end of a string
rtrim(string $string, string $characters = " \n\r\t\v\x00"): string
$classPath = static::generatePathFromNamespace($classNamespace);
$testPath = static::generateTestPathFromNamespace($this->baseTestNamespace);
$this->baseClassPath = rtrim($classPath, DIRECTORY_SEPARATOR).'/';
$this->baseViewPath = rtrim($viewPath, DIRECTORY_SEPARATOR).'/';
$this->baseTestPath = rtrim($testPath, DIRECTORY_SEPARATOR).'/';
$testPath = static::generateTestPathFromNamespace($this->baseTestNamespace);
$this->baseClassPath = rtrim($classPath, DIRECTORY_SEPARATOR).'/';
$this->baseViewPath = rtrim($viewPath, DIRECTORY_SEPARATOR).'/';
$this->baseTestPath = rtrim($testPath, DIRECTORY_SEPARATOR).'/';
$testPath = static::generateTestPathFromNamespace($this->baseTestNamespace);
$this->baseClassPath = rtrim($classPath, DIRECTORY_SEPARATOR).'/';
$this->baseViewPath = rtrim($viewPath, DIRECTORY_SEPARATOR).'/';
$this->baseTestPath = rtrim($testPath, DIRECTORY_SEPARATOR).'/';
if(! empty($stubSubDirectory) && str($stubSubDirectory)->startsWith('..')) {
$this->baseClassPath = rtrim($classPath, DIRECTORY_SEPARATOR).'/';
$this->baseViewPath = rtrim($viewPath, DIRECTORY_SEPARATOR).'/';
$this->baseTestPath = rtrim($testPath, DIRECTORY_SEPARATOR).'/';
if(! empty($stubSubDirectory) && str($stubSubDirectory)->startsWith('..')) {
$this->baseClassPath = rtrim($classPath, DIRECTORY_SEPARATOR).'/';
$this->baseViewPath = rtrim($viewPath, DIRECTORY_SEPARATOR).'/';
$this->baseTestPath = rtrim($testPath, DIRECTORY_SEPARATOR).'/';
if(! empty($stubSubDirectory) && str($stubSubDirectory)->startsWith('..')) {
$this->stubDirectory = rtrim(str($stubSubDirectory)->replaceFirst('..' . DIRECTORY_SEPARATOR, ''), DIRECTORY_SEPARATOR).'/';
$this->baseViewPath = rtrim($viewPath, DIRECTORY_SEPARATOR).'/';
$this->baseTestPath = rtrim($testPath, DIRECTORY_SEPARATOR).'/';
if(! empty($stubSubDirectory) && str($stubSubDirectory)->startsWith('..')) {
$this->stubDirectory = rtrim(str($stubSubDirectory)->replaceFirst('..' . DIRECTORY_SEPARATOR, ''), DIRECTORY_SEPARATOR).'/';
$this->baseTestPath = rtrim($testPath, DIRECTORY_SEPARATOR).'/';
if(! empty($stubSubDirectory) && str($stubSubDirectory)->startsWith('..')) {
$this->stubDirectory = rtrim(str($stubSubDirectory)->replaceFirst('..' . DIRECTORY_SEPARATOR, ''), DIRECTORY_SEPARATOR).'/';
} else {
$this->stubDirectory = rtrim('stubs'.DIRECTORY_SEPARATOR.$stubSubDirectory, DIRECTORY_SEPARATOR).'/';
}
if(! empty($stubSubDirectory) && str($stubSubDirectory)->startsWith('..')) {
$this->stubDirectory = rtrim(str($stubSubDirectory)->replaceFirst('..' . DIRECTORY_SEPARATOR, ''), DIRECTORY_SEPARATOR).'/';
} else {
$this->stubDirectory = rtrim('stubs'.DIRECTORY_SEPARATOR.$stubSubDirectory, DIRECTORY_SEPARATOR).'/';
}
if(! empty($stubSubDirectory) && str($stubSubDirectory)->startsWith('..')) {
$this->stubDirectory = rtrim(str($stubSubDirectory)->replaceFirst('..' . DIRECTORY_SEPARATOR, ''), DIRECTORY_SEPARATOR).'/';
} else {
$this->stubDirectory = rtrim('stubs'.DIRECTORY_SEPARATOR.$stubSubDirectory, DIRECTORY_SEPARATOR).'/';
}
$directories = preg_split('/[.\/(\\\\)]+/', $rawCommand);
$this->stubDirectory = rtrim(str($stubSubDirectory)->replaceFirst('..' . DIRECTORY_SEPARATOR, ''), DIRECTORY_SEPARATOR).'/';
} else {
$this->stubDirectory = rtrim('stubs'.DIRECTORY_SEPARATOR.$stubSubDirectory, DIRECTORY_SEPARATOR).'/';
}
$directories = preg_split('/[.\/(\\\\)]+/', $rawCommand);
$classPath = static::generatePathFromNamespace($classNamespace);
$this->baseClassPath = rtrim($classPath, DIRECTORY_SEPARATOR).'/Stubs/';
$this->baseViewPath = rtrim($viewPath, DIRECTORY_SEPARATOR).'/stubs/';
$directories = preg_split('/[.\/]+/', $rawCommand);
$this->baseClassPath = rtrim($classPath, DIRECTORY_SEPARATOR).'/Stubs/';
$this->baseViewPath = rtrim($viewPath, DIRECTORY_SEPARATOR).'/stubs/';
$directories = preg_split('/[.\/]+/', $rawCommand);
$classPath = static::generatePathFromNamespace($classNamespace);
$this->baseClassPath = rtrim($classPath, DIRECTORY_SEPARATOR).'/Stubs/';
$this->baseViewPath = rtrim($viewPath, DIRECTORY_SEPARATOR).'/stubs/';
$directories = preg_split('/[.\/]+/', $rawCommand);
$this->baseClassPath = rtrim($classPath, DIRECTORY_SEPARATOR).'/Stubs/';
$this->baseViewPath = rtrim($viewPath, DIRECTORY_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 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)) {
$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)) {
$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'] ?? '', '/')
$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';
$appUrl = config('livewire.app_url')
?: rtrim($options['app_url'] ?? '', '/')
?: $assetsUrl;
$jsLivewireToken = app()->has('session.store') ? "'" . csrf_token() . "'" : 'null';
return $file;
}
$cwd = rtrim($cwd, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
return preg_replace('/^' . preg_quote($cwd, '/') . '/', '', $file);
}
}
$cwd = rtrim($cwd, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
return preg_replace('/^' . preg_quote($cwd, '/') . '/', '', $file);
}
protected function concatPathToUrl($url, $path)
{
return rtrim($url, '/').'/'.ltrim($path, '/');
}
{
return rtrim($url, '/').'/'.ltrim($path, '/');
}
public static function setFacadeNamespace($namespace)
{
static::$facadeNamespace = rtrim($namespace, '\\').'\\';
}
{
static::$facadeNamespace = rtrim($namespace, '\\').'\\';
}