New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

laravel-codegen

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

laravel-codegen

A package to fetch types from your laravel backend

latest
npmnpm
Version
2.1.0
Version published
Maintainers
1
Created
Source

Laravel Codegen

Install

yarn add laravel-codegen

Create a laravel-codegen.ts in the root of your project with the following syntax

const config = {
  apiUrl: 'https://someurl.fetch/api/types', // Must use
  path: '/', //defaults to root folder
  token: '', //If bearer token to api 
};

module.exports = config;

Then in your package json add the following script command

"laravel-codegen": "laravel-codegen"

The types will then be generated in the path from your config whenever you run the following command

yarn laravel-codegen

#DONT FORGET - reference the types somewhere in your repo f.ex. index.ts or similar Then you can import your types anywhere in your project

/// <reference path="./types/laravel-types.d.ts" />

FAQs

Package last updated on 04 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts