Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Returns trailing name component of path
basename(string $pathstring $suffix ""): string
    public function getMigrationName($path)

    {

        return 
str_replace('.php'''basename($path));

    }
        $path realpath($path) ?: $path;



        
$tempPath tempnam(dirname($path), basename($path));




        
chmod($tempPath0777 umask());
        }



        if (! 
array_key_exists('Content-Disposition'$headers)) {

            
$filename $name ?? basename($path);



            
$disposition $response->headers->makeDisposition(

                
$disposition$filename$this->fallbackName($filename)
        foreach (Finder::create()->files()->name('*.php')->in($configPath) as $file) {

            
$directory $this->getNestedDirectory($file$configPath);



            
$files[$directory.basename($file->getRealPath(), '.php')] = $file->getRealPath();

        }



        
ksort($filesSORT_NATURAL);
        $class trim(Str::replaceFirst($basePath''$file->getRealPath()), DIRECTORY_SEPARATOR);



        return 
str_replace(

            [
DIRECTORY_SEPARATORucfirst(basename(app()->path())).'\\'],

            [
'\\'app()->getNamespace()],

            
ucfirst(Str::replaceLast('.php'''$class))

        );
            )->disk($disk);



            
$attachment

                
->as($attachment->as ?? basename($path))

                ->
withMime($attachment->mime ?? $storage->mimeType($path));



            return 
$dataStrategy(fn () => $storage->get($path), $attachment);
            $message->attachData(

                
$storage->get($attachment['path']),

                
$attachment['name'] ?? basename($attachment['path']),

                
array_merge(['mime' => $storage->mimeType($attachment['path'])], $attachment['options'])

            );

        }
        $this->diskAttachments collect($this->diskAttachments)->push([

            
'disk' => $disk,

            
'path' => $path,

            
'name' => $name ?? basename($path),

            
'options' => $options,

        ])->
unique(function ($file) {

            return 
$file['name'].$file['disk'].$file['path'];
    {

        
$reflection = new ReflectionFunction($this->closure->getClosure());



        return 
'Closure ('.basename($reflection->getFileName()).':'.$reflection->getStartLine().')';

    }

}
    {

        
$class is_object($class) ? get_class($class) : $class;



        return 
basename(str_replace('\\''/'$class));

    }

}
    public function basename($suffix '')

    {

        return new static(
basename($this->value$suffix));

    }
            file_put_contents($viewFile$contents);

        }



        return 
'__components::'.basename($viewFile'.blade.php');

    }
        $filesystem = new Filesystem(

            
$this->adapter = new LocalFilesystemAdapter(dirname($this->tempDir))

        );

        
$filesystem->deleteDirectory(basename($this->tempDir));

        
m::close();



        unset(
$this->tempDir$this->filesystem$this->adapter);
        $v = new Validator($trans, ['foo' => [123]], ['foo' => 'Array|Max:2']);

        
$this->assertFalse($v->passes());



        
$file $this->getMockBuilder(UploadedFile::class)->onlyMethods(['isValid''getSize'])->setConstructorArgs([__FILE__basename(__FILE__)])->getMock();

        
$file->method('isValid')->willReturn(true);

        
$file->method('getSize')->willReturn(3072);

        
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Max:10']);
        $v = new Validator($trans, ['photo' => $file], ['photo' => 'Max:10']);

        
$this->assertTrue($v->passes());



        
$file $this->getMockBuilder(UploadedFile::class)->onlyMethods(['isValid''getSize'])->setConstructorArgs([__FILE__basename(__FILE__)])->getMock();

        
$file->method('isValid')->willReturn(true);

        
$file->method('getSize')->willReturn(4072);

        
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Max:2']);