PHPackages                             anthoz69/anter - 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. anthoz69/anter

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

anthoz69/anter
==============

This package is collage helper function and class for develop laravel

0.0.9(1y ago)0306[3 PRs](https://github.com/anthoz69/anter/pulls)MITPHP

Since Mar 20Pushed 1y ago1 watchersCompare

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

READMEChangelog (8)Dependencies (5)Versions (13)Used By (0)

Anter
=====

[](#anter)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c1d9e8d00959b35284cb94fe364c32d2376d336bccd4923f63897267f7b93201/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e74686f7a36392f616e7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anthoz69/anter)[![Total Downloads](https://camo.githubusercontent.com/857ed4aed6c54e1c99012377464aac0ef229e602216dd8f23cb6fcec792e039d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e74686f7a36392f616e7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anthoz69/anter)[![StyleCI](https://camo.githubusercontent.com/30be7a176e667e4609e66f26ffcac1c350ee9bb661102e1d64331ec1e266ce71/68747470733a2f2f7374796c6563692e696f2f7265706f732f3234383737303233302f736869656c64)](https://styleci.io/repos/248770230)

This package is collect my methods and function use frequently in laravel be careful if you are using this package it can be breaking chage anytime. Please fork it to your own repository, And send some PR for cool feature if you need to contribute it.

Installation
------------

[](#installation)

1 - Install the package via Composer:

```
composer require anthoz69/anter
```

The package will automatically register its service provider.

> **Note**: If you are using Laravel 5.5, the steps 2 and 3, for providers and aliases, are unnecessaries. Dod Package supports Laravel new [Package Discovery](https://laravel.com/docs/5.5/packages#package-discovery).

2 - You need to update your application configuration in order to register the package so it can be loaded by Laravel, just update your `config/app.php` file adding the following code at the end of your `'providers'` section:

> `config/app.php`

```
'providers' => [
    // other providers ommited
    anthoz69\anter\Providers\AntherServiceProvider::class,
],
```

Usage
-----

[](#usage)

### AnterStore Facade

[](#anterstore-facade)

Save file from frontend upload in laravel and generate unique file name before store file.

```
AnterStore::store($path, $file)->save();
AnterStore::url($path);
AnterStore::delete($path);
```

### AnterImg Facade

[](#anterimg-facade)

Save file from frontend upload in laravel and resize image.

```
// Store image in /storage/app/public/user/cover
// save() method will return full path of image.
$image = AnterStore::make('user/cover', $request->file('image'));
$image->crop(300, 450)->save(); // Crop image from center size 300px x 450px.
$image->fit(300, 300, true)->save(); // Resize and crop image to 300px x 300px and prevent up size image if set true.
$image->resize(300, true)->save(); // Resize to width 300px and prevent up size image if set true.
$image->width(); // Get width of image.
$image->height(); // Get height of image.
```

### Currency function

[](#currency-function)

2 =&gt; 2.00

4.75668 =&gt; 4.75

```
setCurrency($number, $percision = 2); // truncate and round
truncate($number, $percision = 2); // truncate and not round number
```

### Router function

[](#router-function)

**isRoutePrefix** If your url start with /admin or something will place `active class` to html attribute class it good for hierarchy menu.

```
isRouteMatch('/admin/*', $class = 'active');
```

e.g. your url `/admin/user/create`.

```

// output if url start with /admin/user

```

**isRoute** When user access to url and [laravel route name](https://laravel.com/docs/5.8/routing#named-routes) matched it will output class.

```
isRoute($routeName = '', $class = 'active');

isRoute('user.create', 'active-color-menu'); // result: active-color-menu
isRoute('user.create'); // result: active
```

### Video function

[](#video-function)

get id from url support Youtube, Vimeo if wrong format will return `null`.

```
getYoutubeId('https://www.youtube.com/watch?v=aAzUC8vNtgo'); // output: aAzUC8vNtgo
getVimeoId('https://vimeo.com/68529790'); // output: 68529790
getVideoProvider('https://www.youtube.com/watch?v=aAzUC8vNtgo'); // output: youtube
```

### Time function in Thailand country format

[](#time-function-in-thailand-country-format)

Send timestamp (created\_at, updated\_at in laravel) to function will return string time.

```
getTHMonth($index, $short = true);
getDateTH($strDate, $shortMonth = true, $time = false);
getTimeFromDate($strDate, $second = true);
```

e.g.

```
getTHMonth(1); // มกราคม
getTHMonth(1, true); // ม.ค.

getDateTH('2019-07-17 16:07:42'); // 17 ก.ค. 2562
getDateTH('2019-07-17 16:07:42', false); // 17 กรกฏาคม 2562
getDateTH('2019-07-17 16:07:42', true, true); // 17 ก.ค. 2562 16:07

getTimeFromDate('2019-07-17 16:07:42'); // 16:07
getTimeFromDate('2019-07-17 16:07:42', true); // 16:07:42
```

Security
--------

[](#security)

If you discover any security related issues, please open the issue or send me some cool PR.

Credits
-------

[](#credits)

- [Itthipat (Anthoz69)](https://github.com/anthoz69)
- [All Contributors](../../contributors)

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

License
-------

[](#license)

license is under MIT. Please see the [license file](license.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.4% 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

Every ~209 days

Recently: every ~402 days

Total

9

Last Release

572d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14963824?v=4)[Itthipat Pitiponwanit](/maintainers/anthoz69)[@anthoz69](https://github.com/anthoz69)

---

Top Contributors

[![anthoz69](https://avatars.githubusercontent.com/u/14963824?v=4)](https://github.com/anthoz69 "anthoz69 (27 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")

---

Tags

laravelAnterAnthoz69

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/anthoz69-anter/health.svg)

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

###  Alternatives

[laravolt/avatar

Turn name, email, and any other string into initial-based avatar or gravatar.

2.0k5.4M31](/packages/laravolt-avatar)[zservices/query

Pacote para consultas em serviços do governo.

131.1k](/packages/zservices-query)

PHPackages © 2026

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