shridharkaushik29/laravel-angular-app
Composer 安装命令:
composer require shridharkaushik29/laravel-angular-app
包简介
AngularJS Applications in Laravel
README 文档
README
This plugin provides a great eloquent way of creating HTML5 applications with AngularJS, Angular, ReactJS, Vue and many more.
Don't go with the name of the package i.e. laravel-angular-app, because initially, this package was designed to create only AngularJS applications, but now it's objective is to create, build and load assets in an elegant way in Laravel.
Installation:
composer require shridharkaushik29/laravel-angular-app
Usage:
Add the provider in config/app.php. Skip this step if you are using Laravel version greater than 5.4.
"providers" => [ Shridhar\Angular\Provider::class ]
Creating multiple apps per Laravel Installation.
This package offers to create multiple webpack applications in a single Laravel installation. For example, if you want to create an E-Commerce application, then it would require a separate application to manage the content for the front end application. This is handled very efficiently in this package because you can create as many applications you want with different blades.
Creating Blade View
@angular("react")
{{--Used to set app name--}}
@route("react")
{{--Used to define site route name--}}
@title("Laravel React")
{{--Used to define application title--}}
@servicesRoute("services")
{{--Used to define services route, when defined a $servicesUrl variable is defined in javascript--}}
<html lang="en">
<head>
<title>{{$app->title()}}</title>
<base href="{{$app->url()}}/">
<link href="{{asset("img/laravel-developer.png")}}" rel="shortcut icon"/>
<link href="{{$app->asset("style.css")->url()}}" rel="stylesheet"/>
@vars()
{{--Used to print <script> tag containing javascript variables--}}
</head>
<body>
<div id="app"></div>
<div class="pre-loader" ng-if="showPreloader">
<img class="logo" src="{{asset("storage/laravel-logo.png")}}">
<p>Loading Application</p>
</div>
<script src="{{$app->asset("runtime.js")->url()}}" async></script>
<script src="{{$app->asset("vendor.js")->url()}}" async></script>
<script src="{{$app->asset("main.js")->url()}}" async></script>
</body>
</html>
Loading View
There's nothing special required to load views, it's as usual.
Route::get('/', function () { return view('welcome'); });
Creating Assets
This package assumes a folder with the app name in public/assets directory, where all of the assets are placed for that application.
For example, if an app is having name welcome, then there should be a directory public/assets/welcome containing all the javascript, css, images and other assets required by that application.
Loading Assets
$app->asset("path/for/asset") will return an instance for Shridhar\Bower\Asset class.
It contains an url() method which return an absolute url for that asset.
<link href="{{$app->asset("style.css")->url()}}" rel="stylesheet"/>
<script src="{{$app->asset("runtime.js")->url()}}" async></script>
<img src="{{$app->asset("logo.jpg")->url()}}">
shridharkaushik29/laravel-angular-app 适用场景与选型建议
shridharkaushik29/laravel-angular-app 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 480 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 shridharkaushik29/laravel-angular-app 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shridharkaushik29/laravel-angular-app 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 480
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 5
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-06