fbf/laravel-places 问题修复 & 功能扩展

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

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

fbf/laravel-places

Composer 安装命令:

composer require fbf/laravel-places

包简介

A Laravel 4 package to add place listings to a site, e.g. bars, restaurants or hotels

README 文档

README

A Laravel 4 package to add place listings to a site, e.g. bars, restaurants or hotels

Places have

  • title, summary and content fields
  • main image or YouTube Video
  • map showing location (control the marker centre, map centre, map zoom and marker title)
  • link to more info about the place (control the URL and the link text)
  • separate page title, meta description and keywords fields, also a slug field which is automatically generated from the title
  • Draft/Approved status
  • published date for future publishing
  • Is Sticky? field

The package comes with

  • Optional routes file with configurable URL prefix, or you can choose to use your own routes
  • PlacesController with actions for listing places and viewing individual places.
  • A migration for the places table, and a faker seed to populate it.
  • The Place model for interacting with Place data
  • Views and partials for showing the place listings and place details.

Installation

Add the following to you composer.json file (Recommend swapping "dev-master" for the latest release)

"fbf/laravel-places": "dev-master"

Run

composer update

Add the following to app/config/app.php

'Fbf\LaravelPlaces\LaravelPlacesServiceProvider'

Run the package migration

php artisan migrate --package=fbf/laravel-places

Publish the config

php artisan config:publish fbf/laravel-places

Optionally tweak the settings in the many config files for your app

Optionally copy the administrator config file (src/config/administrator/places.php) to your administrator model config directory.

Create the relevant image upload directories that you specify in your config, e.g.

public/uploads/packages/fbf/laravel-places/main_image/original
public/uploads/packages/fbf/laravel-places/main_image/thumbnail
public/uploads/packages/fbf/laravel-places/main_image/resized

Faker seed

The package comes with a seed that can populate the table with a whole bunch of sample places. There are some configuration options for the seeder in the seed config file. To run it:

php artisan db:seed --class="Fbf\LaravelPlaces\FakePlacesSeeder"

Configuration

See the many configuration options in the files in the config directory

Administrator

You can use the excellent Laravel Administrator package by frozennode to administer your data.

http://administrator.frozennode.com/docs/installation

A ready-to-use model config file for the Place model (places.php) is provided in the src/config/administrator directory of the package, which you can copy into the app/config/administrator directory (or whatever you set as the model_config_path in the administrator config file).

Usage

The package should work out the box (provided you have a master blade layout file, since the out-of-the-box views extend this) but if you want to add other content to the pages, such as your own header, logo, navigation, sidebar etc, you'll want to override the views provided.

The package views declare several sections that you may want to yield in your app/views/layouts/master.blade.php file, e.g.:

<!DOCTYPE html>
<html>
<head>
	<title>@yield('title')</title>
	<meta name="description" content="@yield('meta_description')">
	<meta name="keywords" content="@yield('meta_keywords')">
</head>
<body>
<div class="content">
	@yield('content')
</div>
</body>
</html>

The package's views are actually really simple, and most of the presentation is done in partials. This is deliberate so you can override the package's views in your own app, so you can include your own chrome, navigation and sidebars etc, yet you can also still make use of the partials provided, if you want to.

To override any view in your own app, just create the following directories and copy the file from the package into it, then hack away

  • app/views/packages/fbf/laravel-places/places
  • app/views/packages/fbf/laravel-places/partials

Extending

You can extend the model to add more fields, relations and even filter event listings by a relationship.

See the extending section in the readme on http://github.com/FbF/Laravel-Blog as it works the same way.

fbf/laravel-places 适用场景与选型建议

fbf/laravel-places 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 536 次下载、GitHub Stars 达 6, 最近一次更新时间为 2014 年 02 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「places」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 fbf/laravel-places 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-02-21