gammamatrix / site-api-angular
Playground: This is a base application site for Laravel based Playground APIs and Angular UIs.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^8.2
- gammamatrix/playground-cms-api: dev-develop
- laravel/framework: ^11.9
- laravel/sanctum: ^4.0
- laravel/tinker: ^2.9
Requires (Dev)
- fakerphp/faker: ^1.23
- gammamatrix/playground-test: *
- laravel/pint: ^1.13
- laravel/sail: ^1.26
- mockery/mockery: ^1.6
- nunomaduro/collision: ^8.0
- phpunit/phpunit: ^11.0.1
This package is auto-updated.
Last update: 2025-02-25 19:32:39 UTC
README
Site: Playground API and Angular SPA Integration Package for Laravel v11 and Angular v16, v17, v18 applications.
Read more on using Site: Playground API and Angular SPA Integration at Read the Docs: Playground Documentation.
Angular Application
Site: Playground CMS UI with Angular
Currently, there are two Angular applications available to use with this base Laravel application.
CMS with Angular v16 and Angular Material
See: gammamatrix/site-playground-cms-angular
CMS with Angular v18 and Bootstrap v5
See: gammamatrix/site-playground-cms-angular-bootstrap
Toggle User Information
Users
By default, this application uses a user with a UUID for a primary key: app/Models/PlaygroundUser.php.
- auto-incrementing is also supported with the standard app/Models/User.phps, which has been renamed as a source file.
Toggle Testing and Development Information
Testing and Development
Users
Playground Test provides a custom user table seeder: CustomUsersTableSeeder for development.
- There is also a DatabaseSeeder class that will import
Custom*Seeders
used in this application: database/seeders/DatabaseSeeder.php.
The user model is set up in config/auth.php:
'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => env('AUTH_MODEL', App\Models\PlaygroundUser::class), ], ],
Setting up users for testing
For security reasons, the CustomUsersTableSeeder must be manually linked or copied to this application:
cd database/seeders
ln -snf ../../vendor/gammamatrix/playground-test/resources/CustomUsersTableSeeder.php
Toggle Dev Notes
Dev Notes
A base Laravel installation was used.
composer create-project laravel/laravel site-api-angular
Enabled Sanctum
Added Laravel\Sanctum\HasApiTokens
to the User model.
php artisan install:api php artisan config:publish cors
SESSION_DOMAIN=site-api-angular
# SESSION_DOMAIN=site-playground-integration
SESSION_HTTP_ONLY=false
SESSION_SECURE_COOKIE=false
SANCTUM_STATEFUL_DOMAINS=site-api-angular
composer require gammamatrix/playground-cms-api
- composer.json need to allow
"minimum-stability": "dev",
nginx configuration for the PHP API and Angular app
resources/configuration/31010-site-api-angular.conf
- Note development is done on http with scheme-less URLs, where possible.