PHPackages                             crudadmin/autoajax - 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. crudadmin/autoajax

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

crudadmin/autoajax
==================

Auto Ajax form submission for Laravel or plain PHP

2.0.12(10mo ago)01.2k2MITPHPPHP &gt;=8.0

Since Dec 2Pushed 10mo ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (27)Used By (2)

AutoAjax PHP library
====================

[](#autoajax-php-library)

PHP library manages HTTP responses for javascript library [autoAjax.js](https://github.com/crudadmin/autoajax.js). Package is designed for cooperaton of Laravel/PHP with VueJs/PlainJS form submissions and automatic form validation management received from validated response.

[![Example](https://github.com/crudadmin/autoajax.js/raw/master/dist/example2x.gif)](https://github.com/crudadmin/autoajax.js/raw/master/dist/example2x.gif)

**This is part** of package is for implementation on PHP/Laravel side of application. More for JavaScript/VueJs part of this package on [autoAjax.js](https://github.com/crudadmin/autoajax.js)

Features
--------

[](#features)

- automatically builds request data from form inputs.
- automatically bind validation error messages to each input from Laravel validation
- VueJs integration
- PlainJs integration

Composer installation
---------------------

[](#composer-installation)

`composer require "crudadmin/autoajax"`

Usage
-----

[](#usage)

In Laravel controller response

```
public function store()
{
    //...

    return autoAjax()->success('Thank you! Your for has been successfully sent.');
}
```

If you need throw error message. You need use **throw()** or **render()** method.

```
//...

//Script dies here
autoAjax()->success('Thank you! Your for has been successfully sent.')->throw();

//...
```

API
---

[](#api)

```
//Success messages.
autoAjax()->success('Success message');
autoAjax()->message('Success message');
autoAjax()->save(); //Global success message will be applied.

//Error messages
autoAjax()->error('Error message with 200 HTTP code');
autoAjax()->error('Error message with 500 HTTP code', 500);
autoAjax()->error('Error message with 500 HTTP code')->code(500);
autoAjax()->error(); //Global error message will be applied.

//Change title of response
autoAjax()->message('Success message')->title('My response title');
autoAjax()->error('Error message')->title('My response title');

//Change HTTP code
autoAjax()->message('My message')->code(500);

//If you want redirect/reload request after response comes. (autoAjax.js will handle it)
autoAjax()->redirect('https://google.com');
autoAjax()->reload();

//If you need run own JS callback after response
autoAjax()->title('This is my message')->callback('alert(1)');

//If you want modify all success/error messages globally. You can do it in AppServiceProvider or somewhere else in your app configuration like that.
autoAjax()->setGlobalMessage('success', 'Changes has been successfully saved.');
autoAjax()->setGlobalMessage('error', 'Something went wrong. Try again later.');
```

JSON Response
-------------

[](#json-response)

```
{
  callback: null,
  data: [],
  error: false,
  message: "Custom message",
  redirect: null,
  title: "Success",
  type: "message",
}

```

**callback** - Javascript callback for autoAjax library

**data** - Array of additional data for autoAjax library and your responses in VueJs or PlainJs application

**error** - Is response error type?

**message** - Message output.

**redirect** - URL where should be user redirected after response request. AutoAjax.js will handle it.

**title** - Your custom title for modals message.

**type** - Message or modal. You can customize your response for alert messages or for modal windows.

Validation response
-------------------

[](#validation-response)

You can throw validation response with Laravel validator

```
Validator::make($request->all(), [
    'title' => 'required|unique:posts|max:255',
    'body' => 'required',
])->validate();
```

You can also throw validation message by your own with **throwValidation** method

```
autoAjax()->throwValidation([
    'username' => 'Validation message for username',
    'password' => 'Validation message for password',
]);
```

Or manualy send JSON request with error code **422 Unprocessable Entity**

```
{
    "email": ["Please fill this field."],
    "phone": ["Please fill this field."]
}

```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance53

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity73

Established project with proven stability

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

Recently: every ~87 days

Total

26

Last Release

322d ago

Major Versions

1.0.x-dev → 2.0.02022-04-09

PHP version history (2 changes)1.0.0PHP &gt;=7.0

2.0.9PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9bb6f1e9694d2087e25341f99ecd8222dcd6d517100395c5ae65458f454ea35e?d=identicon)[marekgogol](/maintainers/marekgogol)

---

Top Contributors

[![MarekGogol](https://avatars.githubusercontent.com/u/11134410?v=4)](https://github.com/MarekGogol "MarekGogol (24 commits)")

### Embed Badge

![Health badge](/badges/crudadmin-autoajax/health.svg)

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

###  Alternatives

[illuminate/session

The Illuminate Session package.

9937.4M753](/packages/illuminate-session)[illuminate/cookie

The Illuminate Cookie package.

224.3M122](/packages/illuminate-cookie)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3183.3k6](/packages/codefog-contao-news-categories)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

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