Download the PHP package yzh52521/think-laravel-orm without Composer

On this page you can find all versions of the php package yzh52521/think-laravel-orm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-laravel-orm

think-laravel-orm

喜欢thinkphp6+的轻量和目录结构?又想使用laravel框架中更强大更新频率更高的orm来操作数据库?

laravel中使用orm库是illuminate/database

安装

分两步走,毕竟是集成别人的库,多少有点兼容问题,更何况thinkphp6和它如此相似的情况下🤭

1.安装think-laravel-orm

安装完毕后运行php think可以看到新增一个指令make:laravel-model

 make
  make:command              Create a new command class
  make:controller           Create a new resource controller class
  make:event                Create a new event class
  make:laravel-model        Create a new laravel model class
  make:listener             Create a new listener class
  make:middleware           Create a new middleware class
  make:model                Create a new model class
  make:service              Create a new Service class
  make:subscribe            Create a new subscribe class
  make:validate             Create a validate class

2.解决兼容

主要是处理助手函数的兼容问题,因为tp6内置的助手函数topthink/think-helper有 很多和illuminate/database包里面加载的助手函数冲突 所以需要通过特殊的手段提高一下不同函数的权重才能保证正常使用。

我们需要借助composer-include-files包来帮助我 们完成这个动作(tips:这个包非常有用)。

1.安装

安装过程会询问你是否向composer.json文件写入新内容。y

2.创建重写文件

接着在项目app目录下新建Override.php,当然文件名随你,把下面的内容复制进去

3.更新composer.json内容

在composer.json文件中添加如下内容,"app/Override.php"就是重写文件

4.更新composer自动加载内容

执行完这一步,此时的重写文件的函数的优先级已经是最高级别。

配置文件

安装完毕后会在config目录下生成一个配置文件laravelorm.php

使用

只需要注意laravel的表名是复数形式问题。

查询构造器

模型

文档

反馈

如果有任何建议和问题欢迎在仓库留言


All versions of think-laravel-orm with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.5
topthink/framework Version >=6.0
illuminate/database Version ^8.0|^9.0|^10.0
illuminate/events Version ^8.0|^9.0|^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yzh52521/think-laravel-orm contains the following files

Loading the files please wait ....