定制 theoluirard/laravel-get-table-name 二次开发

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

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

theoluirard/laravel-get-table-name

最新稳定版本:v1.0.3

Composer 安装命令:

composer require theoluirard/laravel-get-table-name

包简介

A package that adds a trait to the Laravel Model class and extends the Laravel Relation class with two new types of relations.

README 文档

README

This package provides a way to get statically table name and primary key in laravel

Features

  • Implement 2 methods to retrieve table name & primary key name

Installation

To install the package, use the following command:

composer require theoLuirard/laravel-get-table-name 

Configuration

Add the trait to your model

Simply add the trait to your model definition

<?php

namespace App\Models;

use HasTreeStructure;
use Illuminate\Database\Eloquent\Model;

class MyModel extends Model
{
    use HasTreeStructure;
}

Usage

To get the table name statically

MyModel::getTableName(); // Returns "my_table_name"
MyModel::getTableName(true); // Returns "my_connection.my_table_name"

To get the primary key name statically

MyModel::getTableName(); // Returns "my_primary_key"
MyModel::getTableName(true); // Returns "my_table_name.my_primary_key"

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固