One Hat Cyber Team
Your IP :
172.71.120.56
Server IP :
188.114.97.7
Server :
Linux advantage-project 5.14.0-503.26.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 19 16:28:19 UTC 2025 x86_64
Server Software :
Apache/2.4.62 (Rocky Linux) OpenSSL/3.2.2
PHP Version :
8.3.17
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
htmlOld
/
vendor
/
kalnoy
/
nestedset
/
src
/
View File Name :
NestedSet.php
<?php namespace Kalnoy\Nestedset; use Illuminate\Database\Schema\Blueprint; class NestedSet { /** * The name of default lft column. */ const LFT = '_lft'; /** * The name of default rgt column. */ const RGT = '_rgt'; /** * The name of default parent id column. */ const PARENT_ID = 'parent_id'; /** * Insert direction. */ const BEFORE = 1; /** * Insert direction. */ const AFTER = 2; /** * Add default nested set columns to the table. Also create an index. * * @param \Illuminate\Database\Schema\Blueprint $table */ public static function columns(Blueprint $table) { $table->unsignedInteger(self::LFT)->default(0); $table->unsignedInteger(self::RGT)->default(0); $table->unsignedInteger(self::PARENT_ID)->nullable(); $table->index(static::getDefaultColumns()); } /** * Drop NestedSet columns. * * @param \Illuminate\Database\Schema\Blueprint $table */ public static function dropColumns(Blueprint $table) { $columns = static::getDefaultColumns(); $table->dropIndex($columns); $table->dropColumn($columns); } /** * Get a list of default columns. * * @return array */ public static function getDefaultColumns() { return [ static::LFT, static::RGT, static::PARENT_ID ]; } /** * Replaces instanceof calls for this trait. * * @param mixed $node * * @return bool */ public static function isNode($node) { return is_object($node) && in_array(NodeTrait::class, (array)$node); } }