定制 milose/laravel-foundation 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

milose/laravel-foundation

Composer 安装命令:

composer require milose/laravel-foundation

包简介

Override Laravel Auth/Pagination views using Zurb Foundation instead of Twitter Bootstrap.

README 文档

README

UOverride Laravel Auth/Pagination views using Zurb Foundation instead of Twitter Bootstrap.

1. Installation

To install this package run

composer require milose/laravel-foundation

If you are using Laravel version >= 5.5 you can skip the next step.

Add the service provider to your config/app.php file by finding providers key, and adding this to the end of the list:

Milose\LaravelFoundation\LaravelFoundationServiceProvider::class,

2. Using the views

Auth scafolding

In order for Laravel to use the custom views for Authentication, we must import this package traits to the appropriate controllers. These traits override the original methods with updated view names.

Open all of the files in app/Http/Controllers/Auth, and before every trait add \Milose\LaravelFoundation\Auth\ to override the default view. So, for example, Login controller trait inside the class sould look like:

use \Milose\LaravelFoundation\Auth\AuthenticatesUsers;

Instead of:

use AuthenticatesUsers;

Do this for all files.

Pagination

In your blade files you can paginate as usual, by adding:

{{ $users->links('lf::pagination.default') }}

Or if you're using simplePaginate then add:

{{ $users->links('lf::pagination.simple') }}

3. Customizing the views

If you want to change how the views look, you need to publish the them to your resources/views/vendor directory by running

php artisan vendor:publish --tag=lf

After this, in resources/views/vendor/laravelFoundation you will find Blade templates for both authentication and pagination.

4. Adding Zurb Foundation to your project

Import npm package and copy settings and utils so you can customize Foundation:

yarn add foundation-sites motion-ui --dev
mkdir resources/assets/sass/foundation/
cp node_modules/foundation-sites/scss/settings/_settings.scss resources/assets/sass/foundation/
cp -R node_modules/foundation-sites/scss/util/ resources/assets/sass/foundation/util/

SCSS

In your resources/assets/sass/app.scss file remove:

// Bootstrap
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";

And add:

// Foundation
@import 'node_modules/foundation-sites/scss/foundation';
@import "foundation/settings";
@include foundation-everything; //or @include only the components you need

// Motion-Ui
@import 'node_modules/motion-ui/motion-ui'

JavaScript

In your resources/assets/js/bootstrap.js file remove:

require('bootstrap-sass');

And add:

require('motion-ui')
require('what-input')
require('foundation-sites') // or individual components
$(document).ready(function() {
    $(document).foundation()
})

Then run gulp to recompile the assets.

##TODO

  • Test

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固