PHPackages                             salmanbe/filename - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. salmanbe/filename

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

salmanbe/filename
=================

Laravel library to generate clean &amp; pretty file name

v1.0(2y ago)13.8k↓13.9%MITPHPPHP &gt;=5.4.0

Since Aug 13Pushed 2y ago1 watchersCompare

[ Source](https://github.com/salmanbe/filename)[ Packagist](https://packagist.org/packages/salmanbe/filename)[ Docs](https://github.com/salmanbe/filename)[ RSS](/packages/salmanbe-filename/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Pretty File Name
================

[](#pretty-file-name)

This library generates pretty, clean, user friendly, unique and well formatted file name.

[![Total Downloads](https://camo.githubusercontent.com/b062360fbc64b6716deaa63dfea92d092f75c6b84d7d5299f758008b86f5161f/687474703a2f2f706f7365722e707567782e6f72672f73616c6d616e62652f66696c656e616d652f646f776e6c6f616473)](https://packagist.org/packages/salmanbe/filename)[![License](https://camo.githubusercontent.com/0fc0f14b57e198d22fd466f3639c60c0a3437a65d68f0604e4db88849fe4c4d0/687474703a2f2f706f7365722e707567782e6f72672f73616c6d616e62652f66696c656e616d652f6c6963656e7365)](https://github.com/salmanbe/filename/blob/master/LICENSE)

Video Tutorial
--------------

[](#video-tutorial)

[![Laravel Filename](https://camo.githubusercontent.com/2fe3a17c90fc5dcc203a601c201417be2a945d93cf9585b3a026b74f934ed6ff/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f5330714b304859634c6a772f302e6a7067)](https://www.youtube.com/watch?v=S0qK0HYcLjw)

Laravel Installation
--------------------

[](#laravel-installation)

Install using composer:

```
composer require salmanbe/filename
```

There is a service provider included for integration with the Laravel framework. This service should automatically be registered else to register the service provider, add the following to the providers array in `config/app.php`:

```
Salmanbe\FileName\FileNameServiceProvider::class,
```

You can also add it as a Facade in `config/app.php`:

```
'Filename' => Salmanbe\FileName\FileName::class,
```

Basic Usage
-----------

[](#basic-usage)

Add `use Salmanbe\FileName\FileName;` or `use FileName;` at top of the class where you want to use it.

```
$filename = 'visa-_ application With fréé.PNG';
```

```
echo FileName::get($filename);  // visa-application-with-free-2021-02-16-001454.png
```

Options
-------

[](#options)

You can generate configuration file by `php artisan vendor:publish` command. Global file name generation options can be defined in it. However, you can override options by adding additional array parameter.

Timestamp
---------

[](#timestamp)

```
echo FileName::get($filename, ['timestamp' => 'Y-m-d']]);
```

You can override default timestamp format that is placed at the end of file name before extension.

Slugify
-------

[](#slugify)

```
echo FileName::get($filename, ['slugify' => true]]);
```

Removes special characters from file name.

Limit
-----

[](#limit)

```
echo FileName::get($filename, ['limit' => 200]]);
```

Limit the total number of characters in file name to avoid very long file name. Default recommended maximum limit is 240.

Separator
---------

[](#separator)

```
echo FileName::get($filename, ['separator' => '_']]);
```

You can specify the separator between file name words. Default separator is '-'.

Uppercase
---------

[](#uppercase)

```
echo FileName::get($filename, ['uppercase' => true]]);
```

File name is generated by default in lower case. However, you can use this option to generate file name in upper case.

All Options
-----------

[](#all-options)

```
echo FileName::get($filename, [
            'limit' => 200,
            'timestamp' => date('d-m-Y-His'),
            'slugify' => true,
            'separator' => '-',
            'uppercase' => true
    ]);
```

Global Configuration
--------------------

[](#global-configuration)

Run `php artisan vendor:publish --provider="Salmanbe\FileName\FileNameServiceProvider"` to publish configuration file.

```
'timestamp' => 'Y-m-d-His',
```

If set to false then no timestamp will be added at the end of file name. It is possible to change the timestamp format. This value can be overridden when calling the function.

```
'limit' => 225,
```

If set to false then by default first 225 characters will be used. This value can be overridden when calling the function.

```
'slugify' => true,
```

If set to true then special characters will be removed from the file name. This value can be overridden when calling the function.

```
'separator' => '-',
```

If set then it will be used as separator between file name words. This value can be overridden when calling the function.

```
'uppercase' => false,
```

If set to true then file name will be in uppercase else lowercase. This value can be overridden when calling the function.

Uninstall
---------

[](#uninstall)

First remove `Salmanbe\FileName\FileNameServiceProvider::class,` and `'Filename' => Salmanbe\FileName\FileName::class,` from `config/app.php` if it was added. Then Run `composer remove salmanbe/filename`

License
-------

[](#license)

Laravel Perfect Filename is licensed under THE MIT License. Please see [License File](https://github.com/salmanbe/filename/blob/master/LICENSE) for more information.

Security contact information
----------------------------

[](#security-contact-information)

To report a security vulnerability, follow [these steps](https://tidelift.com/security).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1009d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/daab7cc40bb5050b884fa06f70de7d5ba52ead28981f412c1808b0fdb531ba3d?d=identicon)[salmanbe](/maintainers/salmanbe)

---

Top Contributors

[![salmanbe](https://avatars.githubusercontent.com/u/10696759?v=4)](https://github.com/salmanbe "salmanbe (25 commits)")

---

Tags

filenamelaravelphplaravelfile name generatorpretty file name

### Embed Badge

![Health badge](/badges/salmanbe-filename/health.svg)

```
[![Health](https://phpackages.com/badges/salmanbe-filename/health.svg)](https://phpackages.com/packages/salmanbe-filename)
```

###  Alternatives

[highideas/laravel-users-online

This package will provide an online users management.

203113.2k1](/packages/highideas-laravel-users-online)[stephenjude/filament-blog

Filament Blog Builder

20317.8k](/packages/stephenjude-filament-blog)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11229.2k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
