Download the PHP package goenitz/simple-model without Composer

On this page you can find all versions of the php package goenitz/simple-model. 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 simple-model

SimpleModel

仿Laravel Eloquent样式的mysql数据库操作类库。

安装方法

配置数据库信息

示例

假设有一个表,有id, title, content三个字段。

首先创建一个类

现在就可以使用了。

添加数据

或者

也可心一次添加多个

查询数据

查询第一条

查询所有

按主键查询

使用limit, skip , orderBy 查询

使用select 来确定查询的列

也可以在get方法传入参数来使用

条件查询

运行前可以把get改为toSql来查看sql语句,避免错误发生

whereIn 目前不建议和其它where连用,会产生不可预知的错误

修改数据

或者

批量修改

删除数据

删除一条

通过id删除多条

通过条件删除

格式化数据

Model类实现了Jsonable和Arrayable接口,在Article类中设置 protected $hidden = ['content'] 可设置要隐藏的列

对于通过where等查出来的多条数据也一样适用

写在最后

还有一些操作未实现或者不能通过以上方法完成,可以直接作用PDO来完成

这就是PDO对象了。

因为本类库使用了 illuminate/support 和symfony/var-dumper。所以你可以使用任何它们的方法。 具体可参考 https://laravel.com/docs/5.4/collections .

还有...

todo

change logs

0.01 初始版本


All versions of simple-model with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
illuminate/support Version ^5.4
symfony/var-dumper Version ^3.2
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 goenitz/simple-model contains the following files

Loading the files please wait ....