Init(Core): Change repo

This commit is contained in:
2026-04-24 15:29:37 +03:30
commit ededb41a3a
1499 changed files with 199187 additions and 0 deletions

42
app/Models/Part.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Part extends Model
{
use HasFactory;
protected $fillable = ['title', 'number', 'chapter_id', 'section_id', 'book_id', 'volum_id', 'law_id','division_id'];
protected $hidden = ['created_at', 'updated_at'];
public function gates()
{
return $this->hasMany(Gate::class);
}
public function branch()
{
return $this->hasMany(Branch::class);
}
public function art()
{
return $this->hasMany(Art::class);
}
public static function search($searchTerm)
{
return self::where('title', 'LIKE', "%{$searchTerm}%")->get();
}
public static function searchLimit($searchTerm)
{
return self::where('title', 'LIKE', "%{$searchTerm}%")->limit(3)->get();
}
}