承接 okipa/laravel-toggle-switch-button 相关项目开发

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

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

okipa/laravel-toggle-switch-button

最新稳定版本:2.0.5

Composer 安装命令:

composer require okipa/laravel-toggle-switch-button

包简介

A customizable toggle switch button generator for Laravel.

README 文档

README

Package abandonned in profit of https://github.com/Okipa/laravel-bootstrap-components package.

Source Code Latest Version Total Downloads License: MIT Code Coverage Scrutinizer Code Quality

A customizable and configurable toggle switch button generator for Laravel that enables you to simply display it on your projects pages.

Laravel Toggle Switch Button

Installation

Versions

  • V1 : composer require okipa/laravel-toggle-switch-button:^1.0.0
  • V2 : composer require okipa/laravel-toggle-switch-button:^2.0.0

For Laravel >=5.4 only

Add the package service provider in the register() method from your app/Providers/AppServiceProvider.php :

// laravel toggle switch button
// https://github.com/Okipa/laravel-toggle-switch-button
$this->app->register(Okipa\LaravelToggleSwitchButton\ToggleSwitchButtonServiceProvider::class);

Styles import

  • Load the package SASS or CSS file from the [path/to/composer/vendor]/okipa/laravel-toggle-switch-button/styles directory to your project.

Usage

Since the toggle switch button implements the Htmlable interface, just call it this way in your blade file :

{{ toggleSwitchButton()
    ->name('active')
    ->checked(old('active') or $model->active)
    ->icon('<i class="fas fa-power-off"></i>')
    ->label('Activation') }}

API

Public methods See the available public methods in the ToggleSwitchButton class

Customize styles

If you use CSS, just override the package styles.

If you use SASS, you can override the following variables before the package SASS file import. Check the following example for a bootstrap use :

// bootstrap 4 example
$toggle-switch-button-label-background-color: $input-group-addon-bg;
$toggle-switch-button-label-border-color: $input-group-addon-border-color;
$toggle-switch-button-label-font-size: $font-size-base;
$toggle-switch-button-unchecked-background-color: $input-group-addon-border-color;
$toggle-switch-button-checked-background-color: $primary;
$toggle-switch-button-label-border-radius: $btn-border-radius;
@import '[path/to/composer/vendor]/okipa/laravel-toggle-switch-button/styles/styles';

Customize templates

Publish the package blade templates file in your project :

php artisan vendor:publish --tag=toggle-switch-button::views

Then, change the content from your resources/views/vendor/components/switch-button.blade.php file.

Contributors

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-06-15