PHP Generator

Generate PHP classes from JSON data structures

JSON Input

Loading...

Generated PHP

Enter JSON data to generate PHP code

Classes with getters and setters

Frequently Asked Questions

What PHP features are supported?

The generator creates PHP classes with type hints (PHP 7.4+), getters/setters, constructors, and supports various frameworks like Laravel Eloquent models and plain PHP classes.

Can I generate Laravel Eloquent models?

Yes! Select 'Laravel' as the framework to generate Eloquent model classes that extend the base Model class with proper imports and Laravel conventions.

How are PHP namespaces handled?

You can specify a custom namespace in the options. The generator will add the appropriate namespace declaration at the top of the generated PHP file.

What about PHP type hints and strict typing?

The generator uses modern PHP type hints for method parameters and return types, supporting bool, int, float, string, and array types based on your JSON data.