This is a Vemto plugin. Vemto is a GUI Laravel generator with a complete set of tools for starting new Laravel projects.
Vemto TypeScript Entity plugin to generate entities from Laravel to TypeScript.
This plugin has only three simple settings:
Export entity type class:
You can export the entity as a class or an interface. By default it is exported in interface.Export entity for React .tsx:
If you are using React with typescript for the Frontend part, you can enable it to generate .tsx entities.Enable TypeORM entities:
If you are using NestJS or TypeORM, enable this option to easily generate the entities.
/**
* Homeflow Technologies | ClientEntity.
*
* @property first_name
* @property last_name
* @property address
* @property telephone
*
* Create ClientEntity
*/
export class ClientEntity {
first_name: string;
last_name: string;
address: string;
telephone: string;
}
or
/**
* Homeflow Technologies | ClientEntity.
*
* @property first_name
* @property last_name
* @property address
* @property telephone
*
* Create ClientEntity
*/
export interface ClientEntity {
first_name: string;
last_name: string;
address: string;
telephone: string;
}
/**
* Homeflow Technologies | ClientEntity.
*
* @property first_name
* @property last_name
* @property address
* @property telephone
*
* Create ClientEntity
*/
export interface ClientEntity {
first_name: string;
last_name: string;
address: string;
telephone: string;
}
import {Column, Entity, PrimaryGeneratedColumn} from "typeorm";
/**
* Homeflow Technologies | ClientEntity.
*
* @property first_name
* @property last_name
* @property address
* @property telephone
*
* Create ClientEntity
*/
@Entity()
export class ClientEntity {
@PrimaryGeneratedColumn()
id: number;
@Column()
first_name: string;
@Column()
last_name: string;
@Column()
address: string;
@Column()
telephone: string;
}