Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the beginning of a string
<?php ltrim(string $string, string $characters = " \n\r\t\v\x00"): string
<?php {
$path = dirname($this->path()).'/.meta/'.$this->basename().'.yaml';
return ltrim($path, '/');
}
public function writeMeta($meta)
<?php return $this
->fluentlyGetOrSet('path')
->getter(function ($path) {
return $path ? ltrim($path, '/') : null;
})
->args(func_get_args());
}
<?php $directory = $this->folder();
$directory = ($directory === '.') ? '/' : $directory;
$path = Path::tidy($directory.'/'.$filename.'.'.$ext);
$path = ltrim($path, '/');
if ($this->disk()->exists($path)) {
<?php private function normalizeVersion(string $version)
{
return ltrim($version, 'v');
}
<?php protected function getTranslations($path, $namespace)
{
return $this->phpFiles($path)->mapWithKeys(function ($name) use ($namespace) {
$key = ltrim($namespace.'::'.$name, ':');
$value = $this->loader->load($this->locale, $name, $namespace);
return [$key => $value];
<?php $path = str_replace($base, '', $path);
}
return ltrim($path, '/');
}
<?php $prepend = Str::ensureRight($prepend, '/');
return Str::ensureLeft(ltrim($url, '/'), $prepend);
}
<?php $path = Path::tidy(Str::removeLeft($path, $root));
return ltrim($path, '/');
}
public function isDirectory($path)
<?php $asset = Asset::make()
->container($this->config->get('container'))
->path(ltrim($path, '/'));
$asset->upload($file)->save();
<?php $this->authorize('store', [AssetContract::class, $container]);
$file = $request->file('file');
$path = ltrim($request->folder.'/'.$file->getClientOriginalName(), '/');
$asset = $container->makeAsset($path)->upload($file);
<?php 'directory' => 'required|alpha_dash',
]);
$path = ltrim(Path::assemble($request->path, $request->directory), '/');
if ($container->disk()->exists($path)) {
throw ValidationException::withMessages([
<?php $url = vsprintf('%s/%s', [
rtrim($this->site()->absoluteUrl(), '/'),
ltrim($uri, '/'),
]);
return $url === '/' ? $url : rtrim($url, '/');
<?php return ! $this->ampable() ? null : vsprintf('%s/%s/%s', [
rtrim($this->site()->absoluteUrl(), '/'),
config('statamic.amp.route'),
ltrim($this->uri(), '/'),
]);
}
}
<?php $manifest = collect($manifest)->mapWithKeys(function ($path, $key) {
return [ltrim($key, '/') => ltrim($path, '/')];
});
if (! $manifest->has($file = "{$type}/{$file}.{$type}")) {
<?php if ($this->preg_match_all($this->ignoreRegex, $text, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
$text = $this->createExtraction('noparse', $match[0], ltrim($match[0], '@'), $text);
}
}