Coder Social home page Coder Social logo

laravel-support's Introduction

Laravel Support

php/laravel部分代码封装

安装

composer require slowlyo/laravel-support

Macro

  • findInSet
    • 查询支持 find_in_set
  • toRawSql
    • 输出拼接了参数的原始sql

Functions

// functions start

// 获取当前域名
function domain()

// 可以传入 0 的 bcdiv
function safe_bc_dev($dividend, $divisor, $scale = 2)

// 计算数组的和
function bc_array_sum($array, $scale = 2)

// 可传入数组的 explode
function safe_explode($delimiter, $string)

// 返回前后拼接了 % 的字符串
function like($str)

// 是否是json字符串
function is_json($string)

// 获取表字段
function table_columns($tableName)

// 一行行读取文件
function file_to_line($path)

// html 转 string
function html_to_string($content)

// 获取 sql 执行记录
function sql_record()

// 创建目录
function make_dir($path, $mode = 0777, $recursive = true, $context = null)

// 抽奖
function lottery($probs)

// functions end

laravel-support's People

Contributors

slowlyo avatar

Watchers

 avatar

Forkers

micaomao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.