PHPackages                             berthott/nglaravel - 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. berthott/nglaravel

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

berthott/nglaravel
==================

Build your angular frontend as part of your laravel project.

3.0.0(3y ago)31.2kMITPHP

Since Jun 30Pushed 1y ago2 watchersCompare

[ Source](https://github.com/berthott/nglaravel)[ Packagist](https://packagist.org/packages/berthott/nglaravel)[ RSS](/packages/berthott-nglaravel/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (12)Used By (0)

[![test workflow](https://github.com/berthott/nglaravel/actions/workflows/test.yml/badge.svg)](https://github.com/berthott/nglaravel/actions/workflows/test.yml/badge.svg)

NgLaravel
=========

[](#nglaravel)

A helper for Angular + Laravel projects.

Easily use Laravel as your API backend and Angular with its CLI as frontend. Inspired by [fristys' Blogpost](https://fristys.me/blog/using-angular-cli-with-laravel/).

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

[](#installation)

You should set up your [Laravel project](https://laravel.com/docs/8.x/installation#installation-via-composer) first. Then require the package.

```
$ composer require berthott/nglaravel
```

Set up Angular
--------------

[](#set-up-angular)

Choose a folder within or outside of your Laravel project to install your Angular project to. I recommend using the [Angular CLI](https://angular.io/cli/new) inside `resources/angular`.

In `angular.json` do the following changes:

```
"architect": {
  "build": {
    // ...
    "options": {
      "outputPath": "../../public/assets/angular",
      "deployUrl": "/assets/angular/",
      // ...
    },
    "configurations": {
      "production": {
        // ...
        "statsJson": true,
        // ...
      },
      "development": {
        "watch": true
      }
    }
  },
}
```

In the `package.json` of the angular project do the following changes:

```
"start": "ng build --configuration development --prod=false",
"build": "ng build",
```

By default default the package will look for Angulars output in `public/assets/angular`. If you choose to change the output path in `angular.json` please set the `output` property in `config/angular.php` or the `NG_OUTPUT_PATH` in `.env` accordingly.

How it works
------------

[](#how-it-works)

The package will set up a generic web route that will catch anything apart from routes specified in the `except_routes` config, and forward it to a view including Angulars output scripts. In development these are the static files, in production a controller will read `stats.json` to include the correctly hashed files.

Options
-------

[](#options)

To change the default options use

```
$ php artisan vendor:publish --provider="berthott\NgLaravel\NgBuildServiceProvider" --tag="config"
```

- `output`: Determines Angulars path inside the public folder. Defaults to `env('NG_OUTPUT_PATH', 'assets/angular')`.
- `except_routes`: Determines the beginning of routes that should not be forwarded to angular. Defaults to `['api']`.
- `middleware`: Configurations for the route. Defaults to `['web']`.

To change the default view use

```
$ php artisan vendor:publish --provider="berthott\NgLaravel\NgBuildServiceProvider" --tag="views"
```

Compatibility
-------------

[](#compatibility)

Tested with Laravel 10.x and Angular 16.

License
-------

[](#license)

See [License File](license.md). Copyright © 2023 Jan Bladt.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

Recently: every ~82 days

Total

11

Last Release

1178d ago

Major Versions

1.0.5 → 2.0.02022-03-23

2.2.0 → 3.0.02023-02-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/af6377eb5c44e90728f87b66923f10a0c7c81c2f05538763a4d1c5dac8a79ceb?d=identicon)[berthott](/maintainers/berthott)

---

Top Contributors

[![berthott](https://avatars.githubusercontent.com/u/3034025?v=4)](https://github.com/berthott "berthott (21 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/berthott-nglaravel/health.svg)

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

###  Alternatives

[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)

PHPackages © 2026

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