fmohican/laravel-bootstrap-ui
Composer 安装命令:
composer require fmohican/laravel-bootstrap-ui
包简介
Laravel UI utilities and presets, based on webpack
README 文档
README
Introduction
While Laravel does not dictate which JavaScript or CSS pre-processors you use, it does provide a basic starting point using Bootstrap that will be helpful for many applications. By default, Laravel uses NPM to install both of these frontend packages.
This legacy package is a very simple authentication scaffolding built on the Bootstrap CSS framework. While it continues to work with the latest version of Laravel, you should consider using Laravel Breeze for new projects. Or, for something more robust, consider Laravel Jetstream.
Official Documentation
Supported Versions
Only the latest major version of Laravel UI receives bug fixes. The table below lists compatible Laravel versions:
| Version | Laravel Version |
|---|---|
| 4.x | 9.x, 10.x |
Installation
The Bootstrap and Vue scaffolding provided by Laravel is located in the fmohican/laravel-bootstrap-ui Composer package, which may be installed using Composer:
composer require fmohican/laravel-bootstrap-ui
Once the fmohican/laravel-bootstrap-ui package has been installed, you may install the frontend scaffolding using the ui Artisan command:
// Generate basic scaffolding... php artisan ui bootstrap // Generate login / registration scaffolding... php artisan ui bootstrap --auth
CSS
Laravel Mix provides a clean, expressive API over compiling SASS or Less, which are extensions of plain CSS that add variables, mixins, and other powerful features that make working with CSS much more enjoyable. In this document, we will briefly discuss CSS compilation in general; however, you should consult the full Laravel Mix documentation for more information on compiling SASS or Less.
JavaScript
Laravel does not require you to use a specific JavaScript framework or library to build your applications. In fact, you don't have to use JavaScript at all. However, Laravel does include some basic scaffolding to make it easier to get started writing modern JavaScript using the Vue library. Vue provides an expressive API for building robust JavaScript applications using components. As with CSS, we may use Laravel Mix to easily compile JavaScript components into a single, browser-ready JavaScript file.
Writing CSS
After installing the laravel/ui Composer package and generating the frontend scaffolding, Laravel's package.json file will include the bootstrap package to help you get started prototyping your application's frontend using Bootstrap. However, feel free to add or remove packages from the package.json file as needed for your own application. You are not required to use the Bootstrap framework to build your Laravel application - it is provided as a good starting point for those who choose to use it.
Before compiling your CSS, install your project's frontend dependencies using the Node package manager (NPM):
npm install
Once the dependencies have been installed using npm install, you can compile your SASS files to plain CSS using Laravel Mix. The npm run dev command will process the instructions in your webpack.mix.js file. Typically, your compiled CSS will be placed in the public/css directory:
npm run dev
The webpack.mix.js file included with Laravel's frontend scaffolding will compile the resources/sass/app.scss SASS file. This app.scss file imports a file of SASS variables and loads Bootstrap, which provides a good starting point for most applications. Feel free to customize the app.scss file however you wish or even use an entirely different pre-processor by configuring Laravel Mix.
Writing JavaScript
All of the JavaScript dependencies required by your application can be found in the package.json file in the project's root directory. This file is similar to a composer.json file except it specifies JavaScript dependencies instead of PHP dependencies. You can install these dependencies using the Node package manager (NPM):
npm install
By default, the Laravel
package.jsonfile includes a few packages such aslodashandaxiosto help you get started building your JavaScript application. Feel free to add or remove from thepackage.jsonfile as needed for your own application. Once the packages are installed, you can use thenpm run devcommand to compile your assets. Webpack is a module bundler for modern JavaScript applications. When you run thenpm run devcommand, Webpack will execute the instructions in yourwebpack.mix.jsfile:
npm run dev
By default, the Laravel webpack.mix.js file compiles your SASS and the resources/js/app.js file. Within the app.js file you may register your Vue components or, if you prefer a different framework, configure your own JavaScript application. Your compiled JavaScript will typically be placed in the public/js directory.
The
app.jsfile will load theresources/js/bootstrap.jsfile which bootstraps and configures Vue, Axios, jQuery, and all other JavaScript dependencies. If you have additional JavaScript dependencies to configure, you may do so in this file.
Adding Presets
Presets are "macroable", which allows you to add additional methods to the UiCommand class at runtime. For example, the following code adds a nextjs method to the UiCommand class. Typically, you should declare preset macros in a service provider:
use Laravel\Ui\UiCommand; UiCommand::macro('nextjs', function (UiCommand $command) { // Scaffold your frontend... });
Then, you may call the new preset via the ui command:
php artisan ui nextjs
License
laravel-bootstrap-ui is open-sourced software licensed under the MIT license, as fork of laravel/ui.
fmohican/laravel-bootstrap-ui 适用场景与选型建议
fmohican/laravel-bootstrap-ui 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 02 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ui」 「laravel」 「webpack」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fmohican/laravel-bootstrap-ui 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fmohican/laravel-bootstrap-ui 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fmohican/laravel-bootstrap-ui 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Webpack Manifest support
Package to use WebpackManifestPlugin in laravel
Symfony Datatable Bundle For Doctrine2 Entities
Bundle to Help Migrating From Assetic to Webpack
Alfabank REST API integration
Base SilverStripe theme with a webpack build system
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-20