1. Go to this page and download the library: Download yzh52521/think-laravel-orm library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yzh52521 / think-laravel-orm example snippets
if (!function_exists('env')) {
/**
* 提高tp框架的助手函数env的权重,保证tp框架的正常运行
* 获取环境变量值
* @access public
* @param string $name 环境变量名(支持二级 .号分割)
* @param string $default 默认值
* @return mixed
*/
function env(string $name = null, $default = null)
{
return \think\facade\Env::get($name, $default);
}
}
if (! function_exists('collect')) {
/**
* 提高laravel-orm的collect助手函数的权重,使得laravel orm正常运行
* Create a collection from the given value.
*
* @param mixed $value
* @return \Illuminate\Support\Collection
*/
function collect($value = null)
{
return new \Illuminate\Support\Collection($value);
}
}