承接 lifespikes/php-beam 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

lifespikes/php-beam

Composer 安装命令:

composer require lifespikes/php-beam

包简介

Opinionated PHP bootstrap package for LifeSpikes projects

README 文档

README

Component of lifespikes/lifespikes

The title gives it away, doesn't it?

A Laravel package that provides a simple way to deploy Inertia applications powered by Vite and React.

Getting Started

Installation

Install the package using Composer:

composer require lifespikes/php-beam

You'll need to install the applicable Inertia, React, and Vite packages as well. We've included a package.json that will install those for you if you use a package manager bridge like Foxy.

While we try to keep everything as agnostic as possible, you might not be able to use our configuration helpers if you use an older version of these tools.

Quick Start

LIVR is a package with an opinionated stack, but everything else is up to you. There are two steps to configure LIVR:

Laravel Config

Our service provider wraps around innocenzi/laravel-vite and inertiajs/inertia-laravel. We provide a standard configuration for both libraries that should support most installations. You can configure PhpBeam using by overriding any of the config options found in config/php-beam.php.

JS Configuration

LIVR comes with a set of TypeScript files you can use to quickly get your environment going.

Simply begin by creating a vite.config.ts file in your project root, and import in our config helper:

/* Running vite:tsconfig will provide you with a @php-beam/config alias */
import generateViteConfig from '@php-beam/config';

export default generateViteConfig({
  ...customViteConfig
})

Our helper will take care of generating the configuration for you. If there's any custom configuration you want to add, you can do so by passing it in as a first argument to the helper.

Root view, pages, and boot

The last step is providing the primary entrypoint and root view for your Inertia app. By default, our config will look for an entry point in resources/js/App.tsx and use its built-in root view.

You can customize any of these by specifying them in your php-beam config:

return [
    'entry_point' => 'resources/js/App.tsx',
    'root_view' => 'php-beam::app',
    
    // There are other options you can customize,
    // be sure to check the config/php-beam.php file
    // for more information.
];

Usage

Inertia Entrypoints

We've tried to make setting up the entrypoint of your Inertia app as simple as possible. Once you specify your entrypoint (Or use the default one), you can use the createInertiaViteApp helper to set up your Inertia app.

import createInertiaViteApp from '@php-beam/inertia';

createInertiaViteApp(
  import.meta.glob('./your-pages-dir/**/*.tsx')
);

If you want a more custom setup, like setting custom resolving logic, you can use the standard createInertiaApp helper. You can still use our resolvePageComponent helper for module resolution though!

Environment Configuration

The best way of customizing configuration for LIVR will be using environment variables. Modifying config values directly may cause issues with how LIVR synchronizes settings with its vite helpers.

Here is a list of the env vars you can use to customize LIVR:

Name Description
VITE_PUBLIC_DIR The public directory for your Vite app.
VITE_BUILD_DIR The build directory for your Vite app.
VITE_ENTRY_POINT Path to your entrypoint.
VITE_PORT The port for your Vite dev server.
VITE_URL The URL your dev server is bound to.
VITE_PUBLIC_URL The URL your dev server is accessible from.
VITE_SSL Whether or not to use SSL for your dev server.
VITE_SSL_KEY The SSL key for your dev server.
VITE_SSL_CERT The SSL cert for your dev server.
VITE_INERTIA_VIEW The root view for your Inertia app.

lifespikes/php-beam 适用场景与选型建议

lifespikes/php-beam 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25.72k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 11 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 lifespikes/php-beam 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 lifespikes/php-beam 我们能提供哪些服务?
定制开发 / 二次开发

基于 lifespikes/php-beam 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-11-25