定制 zems/munlite 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

zems/munlite

最新稳定版本:v1.0.1

Composer 安装命令:

composer create-project zems/munlite

包简介

Munlite is lite weight php framework

README 文档

README

Munlite is a PHP framework. It's a light weight framework. Ideal for Headless CMS.

Query Builder Examples (Content Model)

Get All Records

Content::get();

Find by ID

Content::find(1);
Content::where('id', 1)->first();

Select Specific Columns

Content::select('id', 'title', 'details')->get();

Where Condition

Content::where('status', 1)->get();
Content::where('type', '=', 'news')->get();

Multiple Where Conditions

Content::where('status', 1)->where('type', 'news')->get();

Or Where

Content::where('status', 1)->orWhere('type', 'blog')->get();

Where In

Content::whereIn('id', [1, 2, 3, 4, 5])->get();
Content::whereIn('type', ['news', 'blog'])->get();

Where Between

Content::whereBetween('id', [1, 10])->get();

Order By

Content::orderBy('id', 'DESC')->get();
Content::where('status', 1)->orderBy('title', 'ASC')->get();

Group By

Content::select('type', 'COUNT(*) as total')->groupBy('type')->get();

Limit & Offset (Pagination)

Content::orderBy('id', 'DESC')->limit(10)->offset(0)->get();

Join

User::select('user.id', 'user.name', 'content.title')
    ->leftJoin('content', 'user.id', '=', 'content.user_id')
    ->get();

Aggregate Functions

Content::count();
Content::count('id');
Content::where('status', 1)->count();
Content::max('id');
Content::min('id');
Content::avg('id');
Content::sum('id');

Create Record

Content::create([
    'title' => 'New Post',
    'details' => 'Content details here',
    'type' => 'news',
    'status' => 1
]);

Update Record

Content::where('id', 1)->update([
    'title' => 'Updated Title',
    'details' => 'Updated details'
]);

Content::where('status', 0)->update([
    'status' => 1
]);

Delete Record

Content::where('id', 1)->delete();
Content::where('status', 0)->delete();

Chained Example

Content::select('id', 'title', 'details')
    ->where('status', 1)
    ->whereIn('type', ['news', 'blog'])
    ->orderBy('id', 'DESC')
    ->limit(10)
    ->get();

Raw Queries in whereIn/whereBetween

Content::whereIn('id', [1, 2, 3])->get();
Content::orWhereIn('id', [4, 5, 6])->get();
Content::whereBetween('id', [1, 10])->get();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固