承接 reivaj86/chef-auth 相关项目开发

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

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

reivaj86/chef-auth

Composer 安装命令:

composer require reivaj86/chef-auth

包简介

README 文档

README

##Recipes, Ingredients and Category Login "Chef-Captcha" for Laravel 5

Powerful package to implement a simple but effective login authorization step. Replace the normal Word Captcha system with this package. It will provide a very dynamic and interactive way for users to login with additional security.

Install

Install this package in through Composer.

{
    "require": {
        "reivaj86/chef-auth": "dev-master"
    }
}
Run

$ composer update

Add the package ChefAuthServiceProvider to your application service providers in config/app.php

'providers' => [
    
    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    
    'Reivaj86\ChefAuth\ChefAuthServiceProvider',

],

Publish the package migrations and config file to your application.

$ php artisan vendor:publish --provider="Vendor/Reivaj86/ChefAuth/ChefAuthServiceProvider" --tag="config"
$ php artisan vendor:publish --provider="Vendor/Reivaj86/ChefAuth/ChefAuthServiceProvider" --tag="migrations"

Run migrations.

$ php artisan migrate

Configuration file --- chef-auth.php

You can change connection for models, slug separator and there is also a handy cookable feature. Study the config file for more information.

Usage

First of all, include HasIngredient trait and also implement HasIngredientContract inside your User model.

use Reivaj86\ChefAuth\Contracts\HasIngredientContract;
use Reivaj86\ChefAuthTraits\HasIngredient;

class Recipe extends Model implements HasIngredientContract {

	use HasIngredient;

You're set to go. You can create your first recipe, ingredient and category database.

use Reivaj86\ChefAuth\Models\Recipe;

$recipe = Recipe::create([
    'name' => 'Carbonara',
    'slug' => 'carbonara',
    'img'  => 'assets/imgs/carbonara.png'
    'description' => 'Delicious italian pasta dish' // optional
]);

You then can create your first ingredient and attach it to a recipe.

use Reivaj86\ChefAuth\Models\Ingredient;
use Reivaj86\ChefAuth\Models\Recipe;

$ingredient = Ingredient::create([
    'name' => 'Eggs',
    'slug' => 'eggs',
    'description' => '' // optional
]);

$recipe = Recipe::find($id)->attachIngredient($ingredient); // Can pass whole object, or only its id

You can check if the current recipe has required ingredient.

if ($recipe->cooks('eggs')) // you can pass an id or slug
{
    return 'eggs'; // Or an image (return recipe->img;)

}

You can also do this:

if ($recipe->cooksEggs())
{
    return 'eggs';
}

And of course, there is a way to check for multiple ingredients:

if ($recipe->cooks('eggs|cheese')) // or $recipe->cooks('eggs, cheese') and also $recipe->cooks(['eggs', 'cheese'])
{
    // if recipe has at least one ingredient
}

if ($recipe->cooks('eggs|cheese', 'All')) // or $user->cooks('eggs, cheese', 'All') and also $recipe->cooks(['eggs', 'cheese'], 'All')
{
    // if recipe has all ingredients
}

When you are creating ingredients, there is also optional parameter img. It is set to null by default, but you can overwrite it and then you can do something like this:

if (!$ingredient->img = null)
{
    // code
}

Let's talk about categories in general. You can attach a category to an ingredient or directly to a specific ingredient (and of course detach them as well).

use Reivaj86\ChefAuth\Models\Category;
use Reivaj86\ChefAuth\Models\Ingredient;

$category = Category::create([
    'name' => 'Dairy',
    'slug' => 'dairy',
    'description' => 'Dairy products' // optional
]);

Ingredient::find($id)->attachCategory($category);


if ($ingredient->is('dairy') // you can pass an id or slug
{
    return 'Is a Dairy Product!';
}

You can check for multiple categories the same way as ingredients.

This condition checks if the current recipe is the owner of provided ingredient. If not, it will be looking inside ingredient categories for a row we created before.

if ($ingredient->steamed('dairy', $product, false)) // now owner check is disabled
{
    $product->save();
}

reivaj86/chef-auth 适用场景与选型建议

reivaj86/chef-auth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 06 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 reivaj86/chef-auth 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-06-11