PHPackages                             totem-it/sam-skeleton - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. totem-it/sam-skeleton

ActiveLibrary[File &amp; Storage](/categories/file-storage)

totem-it/sam-skeleton
=====================

Basic elements for sam application.

1.0.0(1y ago)02BSD-3-ClausePHPPHP ^8.2CI passing

Since Oct 24Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/totem-it/sam-skeleton)[ Packagist](https://packagist.org/packages/totem-it/sam-skeleton)[ RSS](/packages/totem-it-sam-skeleton/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (10)Versions (2)Used By (0)

[![](art/logo.svg)](art/logo.svg)

SAM-skeleton
============

[](#sam-skeleton)

Basic elements for sam application.

General System Requirements
---------------------------

[](#general-system-requirements)

- [PHP ^8.2](http://php.net/)
- [Laravel ^11.0](https://github.com/laravel/framework)

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

[](#installation)

If necessary, use the composer to download the library

```
$ composer require totem-it/sam-skeleton
```

Remember to put repository in a composer.json

```
"repositories": [
    {
        "type": "vcs",
        "url":  "https://github.com/totem-it/sam-skeleton.git"
    }
],

```

---

Usage
-----

[](#usage)

Functionalities are organized into packages within the src/Bundles folder:

- [Auth](#Auth)
    - [AuthorizedRequest](#AuthorizedRequest)
    - [TrustOnlyAuthenticated](#TrustOnlyAuthenticated)
- [Middleware](#middleware)
    - [LocalizationMiddleware](#LocalizationMiddleware)
    - [ForceJsonMiddleware](#ForceJsonMiddleware)
- [Resource](#resource)
    - [ApiCollection](#ApiCollection)
    - [ApiResource](#ApiResource)
- [ValueObject](#ValueObject)

---

Auth
----

[](#auth)

### AuthorizedRequest

[](#authorizedrequest)

The trait is used in `FormRequest` classes to automatically check if a user is authorized to perform a given action. It ensures that only authenticated users can proceed with the request.

### TrustOnlyAuthenticated

[](#trustonlyauthenticated)

The middleware checks if the authenticated user’s UUID matches the UUID in the route

example:

```
Route::middleware(TrustOnlyAuthenticated::class)->group(function () {
    Route::post('/user/{uuid}/update', [UserController::class, 'update']);
```

---

Middleware
----------

[](#middleware)

### LocalizationMiddleware

[](#localizationmiddleware)

By Default SAM-skeleton uses localization from `.env APP_LOCALE` key. To change response of API, add header `Accept-Language`

example:

```
Route::middleware(LocalizationMiddleware::class)->get('/', [MyController::class, 'index']);
```

### ForceJsonMiddleware

[](#forcejsonmiddleware)

This middleware changes the `accept: *` header to `accept: application/json`.

example:

```
$this->app['router']->prependMiddlewareToGroup('api', ForceJsonMiddleware::class);
// inside service provider

Route::middleware(ForceJsonMiddleware::class)->get('/', [MyController::class, 'index']);
// inside routes
```

---

Resource
--------

[](#resource)

### ApiCollection

[](#apicollection)

Used to return a collection of models in an API response. Extends the ResourceCollection by providing additional information to the API response

### ApiResource

[](#apiresource)

extends JsonResource

- `whenHasAttribute()` Checks if the resource has the specified attribute.
- `noContent()` - Allows the response to be returned with an HTTP 204 (No Content) status code.

---

ValueObject
-----------

[](#valueobject)

Useful in value objects (VO) or data transfer objects (DTOs) where you often need to validate and parse input data before using it. It provides a simple and reusable way to handle common parsing scenarios.

Parse the property to a trimmed string or returns null.

```
ParseValueObject::trimOrNull(' some text ');
// `some text`

ParseValueObject::trimOrNull(null);
// null
```

Parse the property to an int or returns null.

```
ParseValueObject::intOrNull('123');
// 123

ParseValueObject::intOrNull(null);
// null
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance66

Regular maintenance activity

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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

571d ago

### Community

Maintainers

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

---

Top Contributors

[![rudashi](https://avatars.githubusercontent.com/u/5038647?v=4)](https://github.com/rudashi "rudashi (42 commits)")

---

Tags

laravelfilescoreuploadSkeletonrepositorysam

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/totem-it-sam-skeleton/health.svg)

```
[![Health](https://phpackages.com/badges/totem-it-sam-skeleton/health.svg)](https://phpackages.com/packages/totem-it-sam-skeleton)
```

###  Alternatives

[gaspertrix/laravel-backpack-dropzone-field

Add Dropzone support for Laravel Backpack

172.2k](/packages/gaspertrix-laravel-backpack-dropzone-field)

PHPackages © 2026

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