PHPackages                             arodu/utilcake - 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. arodu/utilcake

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

arodu/utilcake
==============

UtilCake plugin for CakePHP 4.x

v0.0.2(5y ago)268MITPHPPHP &gt;=7.2CI failing

Since Jul 5Pushed 5y agoCompare

[ Source](https://github.com/arodu/utilcake)[ Packagist](https://packagist.org/packages/arodu/utilcake)[ RSS](/packages/arodu-utilcake/feed)WikiDiscussions master Synced 6d ago

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

UtilCake plugin for CakePHP 4.x
===============================

[](#utilcake-plugin-for-cakephp-4x)

CakePHP Plugin, collection of utilities for CakePHP 4.x

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

The recommended way to install composer packages is:

```
composer require arodu/utilcake
```

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

[](#configuration)

You can load the plugin using the shell command:

```
bin/cake plugin load UtilCake
```

Or you can manually add the loading statement in the **src/Application.php** file of your application:

```
public function bootstrap(){
    parent::bootstrap();
    $this->addPlugin('UtilCake');
}
```

How to use
----------

[](#how-to-use)

### Google reCaptcha V3

[](#google-recaptcha-v3)

In the controller file

```
public function initialize(): void{
  parent::initialize();
  $this->loadComponent('UtilCake.ReCaptcha', [
    'public_key'=>'RECAPTCHA_PUBLIC_KEY',
    'secret_key'=>'RECAPTCHA_SECRET_KEY',
  ]);
}

// any action
public function action(){
  // ...
  if ($this->request->is('post')) {
    if($this->ReCaptcha->verify($this->request->getData())){
      // when the verification is successful
      // ...
    }else{
      // when the verification is not successful
      $this->Flash->error(__('reCaptcha failed, try again'));
    }
  }
  // ...
}
```

In the template `templates/ControllerName/action.php`

```
echo $this->Form->create(null, ['id'=>'form-id']);
  // ...
echo $this->Form->end();

$this->ReCaptcha->script('#form-id');
```

### Google login

[](#google-login)

with AuthenticationComponent

In the login template, ex:`/templates/Users/login.php`

```
echo $this->GoogleLogin->link(__('Sign in with Google'),
  ['class' => 'btn btn-block btn-danger', 'escape' => false]
);
```

In the controller file, ex:`/Controller/UsersController.php`

```
public function initialize(): void{
  parent::initialize();
  $this->loadComponent('UtilCake.GoogleLogin', [
    'client_id' => GOOGLE_CLIENT_ID,
    'client_secret' => GOOGLE_CLIENT_SECRET,
    'redirect_uri' => Router::url([
        'controller' => 'Users',
        'action' => 'googleLogin',
        'prefix' => false,
        '_full' => true
      ]),
  ]);
}

//...

public function googleLogin() {
  if (!empty($this->request->getQuery('code'))) {
    try {
      $data = $this->GoogleLogin->getAccessToken($this->request->getQuery('code'));
      $user_profile_info = $this->GoogleLogin->getUserProfileInfo($data['access_token']);

      $user = $this->Users->find()
        ->where(['Users.email' => $user_profile_info['email']])
        ->first();

      if ($user) {
        $this->Authentication->setIdentity($user);
        $target = $this->Authentication->getLoginRedirect() ?? '/';
        return $this->redirect($target);
      }

      $this->Flash->error('Invalid google login');
    } catch (\Exception $e) {
      throw new NotFoundException($e->getMessage());
    }
  }

  return $this->redirect(['action' => 'login']);
}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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 ~146 days

Total

2

Last Release

1995d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0617260c837f5cbcc776bf9944d8e3ac6b40bc7ec566ee986c99f4693e7674fa?d=identicon)[arodu](/maintainers/arodu)

---

Top Contributors

[![arodu](https://avatars.githubusercontent.com/u/12447690?v=4)](https://github.com/arodu "arodu (9 commits)")

---

Tags

cakephpcakephp4composergoogle-loginpluginrecaptcha-v3utilcake-pluginutilities

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arodu-utilcake/health.svg)

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

###  Alternatives

[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[markstory/asset_compress

An asset compression plugin for CakePHP. Provides file concatenation and a flexible filter system for preprocessing and minification.

3761.0M11](/packages/markstory-asset-compress)[dereuromark/cakephp-shim

A CakePHP plugin to shim applications between major framework versions.

401.0M11](/packages/dereuromark-cakephp-shim)[cakedc/cakephp-phpstan

CakePHP plugin extension for PHPStan.

40676.6k31](/packages/cakedc-cakephp-phpstan)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

2988.9k3](/packages/dereuromark-cakephp-dto)[dereuromark/cakephp-geo

A CakePHP plugin around geocoding tools and helpers.

51174.9k4](/packages/dereuromark-cakephp-geo)

PHPackages © 2026

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