Enhance refactor commands with controller-aware Route() updates and fix code quality violations
Add semantic token highlighting for 'that' variable and comment file references in VS Code extension Add Phone_Text_Input and Currency_Input components with formatting utilities Implement client widgets, form standardization, and soft delete functionality Add modal scroll lock and update documentation Implement comprehensive modal system with form integration and validation Fix modal component instantiation using jQuery plugin API Implement modal system with responsive sizing, queuing, and validation support Implement form submission with validation, error handling, and loading states Implement country/state selectors with dynamic data loading and Bootstrap styling Revert Rsx::Route() highlighting in Blade/PHP files Target specific PHP scopes for Rsx::Route() highlighting in Blade Expand injection selector for Rsx::Route() highlighting Add custom syntax highlighting for Rsx::Route() and Rsx.Route() calls Update jqhtml packages to v2.2.165 Add bundle path validation for common mistakes (development mode only) Create Ajax_Select_Input widget and Rsx_Reference_Data controller Create Country_Select_Input widget with default country support Initialize Tom Select on Select_Input widgets Add Tom Select bundle for enhanced select dropdowns Implement ISO 3166 geographic data system for country/region selection Implement widget-based form system with disabled state support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
56
app/RSpade/Core/Models/Country_Model.php
Executable file
56
app/RSpade/Core/Models/Country_Model.php
Executable file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\RSpade\Core\Models;
|
||||
|
||||
use App\RSpade\Core\Database\Models\Rsx_Model_Abstract;
|
||||
use App\RSpade\Core\Models\Region_Model;
|
||||
|
||||
/**
|
||||
* RSX:USE
|
||||
* Country_Model - ISO 3166-1 country data
|
||||
*
|
||||
* Represents countries with their ISO codes and names.
|
||||
* Data populated from sokil/php-isocodes via rsx:seed:geographic-data command.
|
||||
*/
|
||||
class Country_Model extends Rsx_Model_Abstract
|
||||
{
|
||||
public static $enums = [];
|
||||
|
||||
protected $table = 'countries';
|
||||
|
||||
protected $casts = [
|
||||
'enabled' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get all regions (subdivisions) for this country
|
||||
*/
|
||||
public function regions()
|
||||
{
|
||||
return $this->hasMany(Region_Model::class, 'country_alpha2', 'alpha2');
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope to only enabled countries
|
||||
*/
|
||||
public function scopeEnabled($query)
|
||||
{
|
||||
return $query->where('enabled', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get country by alpha2 code
|
||||
*/
|
||||
public static function findByAlpha2(string $alpha2): ?self
|
||||
{
|
||||
return static::where('alpha2', $alpha2)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get country by alpha3 code
|
||||
*/
|
||||
public static function findByAlpha3(string $alpha3): ?self
|
||||
{
|
||||
return static::where('alpha3', $alpha3)->first();
|
||||
}
|
||||
}
|
||||
56
app/RSpade/Core/Models/Region_Model.php
Executable file
56
app/RSpade/Core/Models/Region_Model.php
Executable file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\RSpade\Core\Models;
|
||||
|
||||
use App\RSpade\Core\Database\Models\Rsx_Model_Abstract;
|
||||
use App\RSpade\Core\Models\Country_Model;
|
||||
|
||||
/**
|
||||
* RSX:USE
|
||||
* Region_Model - ISO 3166-2 subdivision data (states, provinces, territories)
|
||||
*
|
||||
* Represents geographic subdivisions with their ISO codes and names.
|
||||
* Data populated from sokil/php-isocodes via rsx:seed:geographic-data command.
|
||||
*/
|
||||
class Region_Model extends Rsx_Model_Abstract
|
||||
{
|
||||
public static $enums = [];
|
||||
|
||||
protected $table = 'regions';
|
||||
|
||||
protected $casts = [
|
||||
'enabled' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the country this region belongs to
|
||||
*/
|
||||
public function country()
|
||||
{
|
||||
return $this->belongsTo(Country_Model::class, 'country_alpha2', 'alpha2');
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope to only enabled regions
|
||||
*/
|
||||
public function scopeEnabled($query)
|
||||
{
|
||||
return $query->where('enabled', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope to regions for a specific country
|
||||
*/
|
||||
public function scopeForCountry($query, string $country_alpha2)
|
||||
{
|
||||
return $query->where('country_alpha2', $country_alpha2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get region by code
|
||||
*/
|
||||
public static function findByCode(string $code): ?self
|
||||
{
|
||||
return static::where('code', $code)->first();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user