PHPackages                             neosrulez/neos-essentials - 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. neosrulez/neos-essentials

ActiveNeos-package[Utility &amp; Helpers](/categories/utility)

neosrulez/neos-essentials
=========================

Essential and frequently needed things for development with Neos Flow.

0.1.0(2y ago)0924PHP

Since Feb 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/patriceckhart/NeosRulez.Neos.Essentials)[ Packagist](https://packagist.org/packages/neosrulez/neos-essentials)[ RSS](/packages/neosrulez-neos-essentials/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (8)Versions (11)Used By (0)

Neos Flow essentials
====================

[](#neos-flow-essentials)

I use this package to avoid having to recreate things that are needed in almost every app every time. Included are a UserService, a MailService (Fusion based mails), some settings and useful abstract PHP classes.

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

[](#installation)

Run

```
composer require neosrulez/neos-essentials

```

After installation run

```
flow flow:cache:flush --force
flow flow:package:rescan

```

Configuration
-------------

[](#configuration)

```
NeosRulez:
  Neos:
    Essentials:
      login:
        # These things are executed if the account is logged in when calling up the app
        ifAuthenticated:
          class: Acme\Package\Domain\Service\IsAuthenticated
          redirectToUri: /dashboard
        # These things are executed when the account has successfully logged out
        afterLogout:
          class: Acme\Package\Domain\Service\Logout
          redirectToUri: /homepage
        # These things are executed when the account has successfully logged in
        onAuthenticationSuccess:
          class: Acme\Package\Domain\Service\AuthSuccess
          redirectToUri: /dashboard
        # These things are executed when the login fails
        onAuthenticationFailure:
          class: Acme\Package\Domain\Service\AuthFailure
          redirectToUri: /homepage
      account:
        # Required!
        defaultRole: NeosRulez.Neos.Essentials:User
        # These things are done after an account is created. Account and password are passed in this function
        afterCreateAccount:
          class: Acme\Package\Domain\Service\UserService
      # Required! This is required to be able to use the getLoggedInUser() function from the UserService. The getLoggedInAccount() function is also available without this.
      user:
        model:
          class: Acme\Package\Domain\Model\User
        repository:
          class: Acme\Package\Domain\Repository\UserRepository
      # Required!
      mail:
        senderMail: noreply@foo.com
        senderName: Sender name

# You can safely override these settings if you need something else
Neos:
  Flow:
    security:
      authentication:
        providers:
          'NeosRulez.Neos.Essentials:Login':
            provider: 'PersistedUsernamePasswordProvider'
            entryPoint: 'WebRedirect'
    persistence:
      doctrine:
        filters:
          soft-deletable: 'Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter'
        eventListeners:
          - events: [ 'onFlush', 'loadClassMetadata' ]
            listener: 'Gedmo\SoftDeleteable\SoftDeleteableListener'
          - events: [ 'prePersist', 'onFlush', 'loadClassMetadata' ]
            listener: 'Gedmo\Timestampable\TimestampableListener'
```

Useful services
---------------

[](#useful-services)

### `UserService.php`

[](#userservicephp)

The UserService covers the most important things that are needed in almost every app. Account and user creation, password generation, ability to check which user or account is logged in.

```
use NeosRulez\Neos\Essentials\Service\UserService;

#[Flow\Inject]
protected UserService $userService;

$this->userService->createUser(string $email, string|null $password = null, string|null $role = null); # Create a new account and a new user. A separate user model abstracted from the AbstractUser.php model is required for this.
$this->userService->generatePassword(int $length); # Generates a secure password of any length
$this->userService->getLoggedInAccount(); # Returns the logged in account
$this->userService->getLoggedInUser(); # Returns the logged in user
```

### `MailService.php`

[](#mailservicephp)

The MailService can send HTML mails with attachments using Swiftmailer.

```
use NeosRulez\Neos\Essentials\Service\MailService;

#[Flow\Inject]
protected MailService $mailService;

$this->mailService()->sendMail(string $packageName, string $fusionPathAndFileName, array $variables, string $subject, string $sender, string $recipient, string|bool $replyTo = false, string|bool $cc = false, string|bool $bcc = false, array $attachments = []);

# Real life example
$this->mailService()->sendMail(
    'Acme.Package', # Package name for the Fusion Files
    'Acme/Package/Mail/FusionMail', # Component Name of the Fusion Files
    ['foo' => 'foos', 'bar' => $variable], # Variables used in the mail
    'Welcome to the Neos Flow application!', # Subject of the mail
    'noreply@foo.com', # Senders address
    $user->getEmail(), # Recipients address
    false, # In that case no reply to
    false, # In that case no cc
    false, # In that case no bcc
    ['/application/the_path_to_your_file1.pdf', '/application/the_path_to_your_file2.pdf'] # File paths to the files to be attached to the mail
);
```

#### `FusionMail.fusion`

[](#fusionmailfusion)

```
include: resource://Neos.Fusion/Private/Fusion/Root.fusion

Acme.Package.Mail.FusionMail = Neos.Fusion:Join {

    renderer = afx`
        Nice that you use the app!

            Foo {foo}
            Bar {bar}

    `
}

```

Useful abstract PHP classes
---------------------------

[](#useful-abstract-php-classes)

### `AbstractModel.php`

[](#abstractmodelphp)

This class provides things from the gedmo doctrine extension and a getter for the persistent object identifier and can be used to extend your own entity models.

```
use NeosRulez\Neos\Essentials\Domain\Model\AbstractModel;

$entity->getIdentifier();

$entity->getCreated(); # Returns a DateTime Object
$entity->getCreated('Y-m-d'); # Returns a string
```

### `AbstractUser.php`

[](#abstractuserphp)

This class abstracts from the `AbstractModel.php` and provides an abstract class for your own user model, which contains setter and getter for account and setter and getter for the property "active".

```
use NeosRulez\Neos\Essentials\Domain\Model\AbstractUser;

$userEntity->getAccount(); # Returns the Neos Flow Account referenced by the user
$userEntity->isActive(); # Returns a boolean
```

Fusion page component
---------------------

[](#fusion-page-component)

A page prototype to get an output easily.

```
Acme.Package.StandardController.index = NeosRulez.Neos.Essentials:Page {

    htmlTag {
        lang = 'de'
    }

    content = Neos.Fusion:Component {

        renderer = afx`

                ...

        `
    }
}

```

Fusion login form component
---------------------------

[](#fusion-login-form-component)

The login component works out-of-the-box.

```
prototype(Acme.Package:Component.LoginForm) < prototype(NeosRulez.Neos.Essentials:LoginForm) {

    username {
        label = 'Your username'
        placeholder = 'Enter your username ...'
    }

    loginButton {
        label = 'Login now!'
    }
}

```

Author
------

[](#author)

- E-Mail:
- URL:

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Every ~27 days

Recently: every ~42 days

Total

10

Last Release

948d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8604597e730303a1739fbb6a24bcf77019b22068e5d838ae4c12756e8121b488?d=identicon)[patriceckhart](/maintainers/patriceckhart)

---

Top Contributors

[![patriceckhart](https://avatars.githubusercontent.com/u/10776002?v=4)](https://github.com/patriceckhart "patriceckhart (18 commits)")

### Embed Badge

![Health badge](/badges/neosrulez-neos-essentials/health.svg)

```
[![Health](https://phpackages.com/badges/neosrulez-neos-essentials/health.svg)](https://phpackages.com/packages/neosrulez-neos-essentials)
```

###  Alternatives

[neos/neos

An open source Content Application Platform based on Flow. A set of core Content Management features is resting within a larger context that allows you to build a perfectly customized experience for your users.

116989.0k674](/packages/neos-neos)[sitegeist/kaleidoscope

Responsive-images for Neos

29352.4k10](/packages/sitegeist-kaleidoscope)[neos/fusion-form

Fusion Form

19724.3k31](/packages/neos-fusion-form)[neos/eel

The Embedded Expression Language (Eel) is a building block for creating Domain Specific Languages

122.0M27](/packages/neos-eel)[sandstorm/neostwofactorauthentication

1223.6k](/packages/sandstorm-neostwofactorauthentication)[breadlesscode/neos-blog

Ready to use blog package

161.4k](/packages/breadlesscode-neos-blog)

PHPackages © 2026

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