itstudioat/spa 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

itstudioat/spa

最新稳定版本:v0.3.3

Composer 安装命令:

composer require itstudioat/spa

包简介

Initial Laraval Spa Installation

README 文档

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

What is Laravel-Spa

Laravel-Spa installs all necessary items for a fresh Laravel Single Page Application.

The installation uses next to laravel:

  • Vue with Vue-Router as Javascript-Framework and routing
  • Pinia as state store
  • Vuetify as css-framework
  • Sanctum as authentication-system for single-page-applications
  • Vite for asset bundling

It provides:

  • Login page together with a 'Unkown password' page and a Register page
  • The login use a 2-factor-authentification (password an email), if the user has set 2-fa option

For the authenticated admins it supports

  • Dashboard
  • Users page, where all users are listed, may be added, changed or deleted
  • Profile update with password change
  • Logout

It integrates the Spatie roles and you can manage the role-based access to all web- and api-routes.

After installing this package, you can easily start to develop your own single page application with all necessary requirements.

Installation

Install a new laravel project

laravel new new-laravel-app

Make all necessary configurations

  • .env

    • APP_URL
    • DB-configuration
    • MAIL-configuration
    • SESSION_DOMAIN='.localhost'
    • LOCALE-configuration
  • config/app.php

    • timezone

Create an empty database correspondig to the .env configuration

Install this package and run the install-commands

composer require itstudioat/spa
php artisan spa:install
php artisan spa:complete

Here you can enter your super_admin User.

Make important entries in some files

Change the config/cors.php file

 'supports_credentials' => true,

You may inividualize your logo for mails

php artisan vendor:publish --tag=laravel-mail

Change the file resources/views/mail/html/header.blade.php to:

@props(['url'])
<tr>
<td class="header">
<a href="{{ $url }}" style="display: inline-block;">
<img src="{{ asset('storage/images/logo.png') }}" class="logo" alt="Your Logo">
</a>
</td>
</tr>

Install your mailing system

If you use Postmark for mailing (i use it):

composer require symfony/postmark-mailer
composer require symfony/http-client

Permissions for routes

Web-Routes

Under routes/meta/web there is for each route.js-file a php-file. Here you may define, which route needs which (spatie-)roles. if the array is empty, no permission is needed.

With a simple command you can synchronize these files. The php-file is made actual with the route-js-file as basis:

    php artisan routes:sync

Api-Routes

Api-Routes may secured with the 'api-allowed'-Middleware followed from the allowed roles. In this example all users with the role admin may pass the apis

    Route::middleware(['auth:sanctum', 'api-allowed:admin'])->group(function () {
        ...

Usage

   php artisan serve
   npm run dev
   php artisan queue:work

Sending E-Mails

That everything works fine, sending E-Mails must be configured. I use Postmark for Mailing and everything is fine. You can find more infos under Laravel/Notifications.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 74
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固