承接 vonsogt/laravel-form-template 相关项目开发

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

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

vonsogt/laravel-form-template

Composer 安装命令:

composer require vonsogt/laravel-form-template

包简介

Save form templates to re-use them later

README 文档

README

Latest Version on Packagist Build Status Quality Score Total Downloads

This laravel package allow you to save some form templates to apply them whenever you want. the utility is to avoid filling some inputs again and again, that most of the time have the same values, or maybe to apply some template based on the user choice.

Installation

You can install the package via composer:

composer require soufiene-slimi/laravel-form-template

Then run:

php artisan migrate

Usage

First of all you don't need to import anything since the package provide an alias.

Creating a new template

// creating a new template named 'Template 1' with
// data ['name' => 'foo','email' => 'foo@administrator.com']
\Template::make('Template 1', [
    'name' => 'foo',
    'email' => 'foo@administrator.',
]);
// creating a new template named 'Template 1' using a model instance
\Template::makeForModel('Template 1', $user);
// creating a new template named 'Template 1' using a model instance
// and some extra data
\Template::makeForModel('Template 1', $user, ['status_id' => 2]);
// creating a new template named 'Template 1' using a model instance,
//some extra data, and keeping all the model attributes
\Template::makeForModel('Template 1', $user, ['foo' => 'bar'], false);

Note that you can configure the attributes that will be removed from a model during the template creation by publishing the configuration and updating the excluded key.

Applying a template

To apply a template, first you have to use the old() function in your input:

<input type="text" name="name" value="{{ old('name') }}" />

Then find the template and apply it

\Template::first()->apply();

Template is an instance of the Illuminate\Database\Eloquent\Model, this mean that you can use all the Laravel ORM features.

To publish the configuration file run:

php artisan vendor:publish  --provider=SoufieneSlimi\LaravelFormTemplate\LaravelFormTemplateServiceProvider

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email soufiene.slimi@mail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固