Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c8d85cb28 | ||
|
|
596d90d940 | ||
|
|
ef6c0b7940 | ||
|
|
b524ca017f | ||
|
|
121152213a | ||
|
|
d26fe4d8c7 | ||
|
|
ec5437ff6d | ||
|
|
cb9092527e | ||
|
|
64ddfdcaee | ||
|
|
ac74f58045 | ||
|
|
599cea7d90 | ||
|
|
78c3cb516a | ||
|
|
9ee4251d57 |
No files matched your search
+4
-5
@@ -1,6 +1,5 @@
|
||||
/vendor
|
||||
composer.phar
|
||||
vendor/
|
||||
composer.lock
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.idea
|
||||
.phpunit.cache/
|
||||
.phpunit.result.cache
|
||||
.tools/
|
||||
@@ -0,0 +1,21 @@
|
||||
# Changelog
|
||||
|
||||
## [7.0.0] - 2026-11-26
|
||||
### Added
|
||||
- Soporte para Laravel 12 y Laravel 13.
|
||||
- `Form::selectMonth()` acepta formatos ISO de Carbon (`MMMM`, `MMM`, `MM`) y nombra los meses según el locale de la aplicación.
|
||||
### Changed
|
||||
- Requiere PHP 8.2 o superior y Laravel 11, 12 o 13.
|
||||
- `Form::selectMonth()` usa `Carbon::isoFormat()` en lugar de `strftime()`, que está deprecada desde PHP 8.1. Los formatos anteriores `%B`, `%b`, `%h` y `%m` se siguen aceptando.
|
||||
- Nulos explícitos en los constructores de `HtmlBuilder` y `FormBuilder` para no generar avisos en PHP 8.4.
|
||||
- Pruebas actualizadas a PHPUnit 10.5, 11.5 y 12, y verificadas en PHP 8.2, 8.3 y 8.4.
|
||||
### Removed
|
||||
- Soporte para Laravel 6 a 10 y para PHP anterior a 8.2.
|
||||
|
||||
## [6.5.1] - 2024-05-22
|
||||
### Changed
|
||||
- Nombre de proveedor `improving-labor-courts/html`.
|
||||
|
||||
## [6.5.0] - 2024-05-22
|
||||
### Added
|
||||
- Soporte para Laravel 11.
|
||||
+15
-17
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "laravelcollective/html",
|
||||
"name": "improving-labor-courts/html",
|
||||
"description": "HTML and Form Builders for the Laravel Framework",
|
||||
"version": "7.0.0",
|
||||
"license": "MIT",
|
||||
"homepage": "https://laravelcollective.com",
|
||||
"support": {
|
||||
"issues": "https://github.com/LaravelCollective/html/issues",
|
||||
"source": "https://github.com/LaravelCollective/html"
|
||||
"issues": "https://git.ilj.mx/ILJ/html/issues",
|
||||
"source": "https://git.ilj.mx/ILJ/html"
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
@@ -18,17 +18,17 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"illuminate/http": "^6.0|^7.0|^8.0",
|
||||
"illuminate/routing": "^6.0|^7.0|^8.0",
|
||||
"illuminate/session": "^6.0|^7.0|^8.0",
|
||||
"illuminate/support": "^6.0|^7.0|^8.0",
|
||||
"illuminate/view": "^6.0|^7.0|^8.0"
|
||||
"php": "^8.2",
|
||||
"illuminate/http": "^11.0|^12.0|^13.0",
|
||||
"illuminate/routing": "^11.0|^12.0|^13.0",
|
||||
"illuminate/session": "^11.0|^12.0|^13.0",
|
||||
"illuminate/support": "^11.0|^12.0|^13.0",
|
||||
"illuminate/view": "^11.0|^12.0|^13.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"illuminate/database": "^6.0|^7.0|^8.0",
|
||||
"mockery/mockery": "~1.0",
|
||||
"phpunit/phpunit": "~8.5"
|
||||
"illuminate/database": "^11.0|^12.0|^13.0",
|
||||
"mockery/mockery": "^1.6",
|
||||
"phpunit/phpunit": "^10.5|^11.5|^12.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@@ -40,7 +40,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "6.x-dev"
|
||||
"dev-7.x": "7.x-dev"
|
||||
},
|
||||
"laravel": {
|
||||
"providers": [
|
||||
@@ -51,7 +51,5 @@
|
||||
"Html": "Collective\\Html\\HtmlFacade"
|
||||
}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
}
|
||||
+20
-24
@@ -1,24 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
bootstrap="phpunit.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnError="false"
|
||||
stopOnFailure="false"
|
||||
verbose="true"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Laravel Html Test Suite">
|
||||
<directory suffix="Test.php">./tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">./src</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
bootstrap="phpunit.php"
|
||||
colors="true"
|
||||
displayDetailsOnTestsThatTriggerDeprecations="true"
|
||||
displayDetailsOnTestsThatTriggerWarnings="true"
|
||||
failOnDeprecation="true"
|
||||
failOnWarning="true">
|
||||
<testsuites>
|
||||
<testsuite name="Laravel Html Test Suite">
|
||||
<directory suffix="Test.php">./tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<source>
|
||||
<include>
|
||||
<directory suffix=".php">./src</directory>
|
||||
</include>
|
||||
</source>
|
||||
</phpunit>
|
||||
@@ -1,9 +1,24 @@
|
||||

|
||||
|
||||
[](https://travis-ci.org/LaravelCollective/html)
|
||||
[](https://packagist.org/packages/laravelcollective/html)
|
||||
[](https://packagist.org/packages/laravelcollective/html)
|
||||
[](https://packagist.org/packages/laravelcollective/html)
|
||||
[](https://packagist.org/packages/laravelcollective/html)
|
||||
## Fork mantenido por ILJ
|
||||
|
||||
Este paquete es un fork de `laravelcollective/html`, que dejó de mantenerse en Laravel 10. Aquí se mantiene compatible con **Laravel 11, 12 y 13** (PHP 8.2 o superior), con el mismo espacio de nombres `Collective\Html` y las mismas facades `Form` y `Html`, así que basta con cambiar la dependencia.
|
||||
|
||||
Se publica en el registro Composer de [git.ilj.mx](https://git.ilj.mx/ilj-oss/html); no requiere token:
|
||||
|
||||
```json
|
||||
"repositories": [
|
||||
{ "type": "composer", "url": "https://git.ilj.mx/api/packages/ilj-oss/composer" }
|
||||
]
|
||||
```
|
||||
|
||||
```bash
|
||||
composer require improving-labor-courts/html:^7.0
|
||||
```
|
||||
|
||||
Los cambios de cada versión están en [CHANGELOG.md](CHANGELOG.md).
|
||||
|
||||
Official documentation for Forms & Html for The Laravel Framework can be found at the [LaravelCollective](https://laravelcollective.com/docs) website.
|
||||
|
||||
## Replacement
|
||||
If you're looking to replace this package due to it's retirement we recommend using [Shift](https://laravelshift.com/convert-laravelcollective-html-to-spatie-laravel-html)
|
||||
+32
-4
@@ -10,6 +10,7 @@ use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use Illuminate\Support\Traits\Macroable;
|
||||
@@ -116,7 +117,7 @@ class FormBuilder
|
||||
* @param string $csrfToken
|
||||
* @param Request $request
|
||||
*/
|
||||
public function __construct(HtmlBuilder $html, UrlGenerator $url, Factory $view, $csrfToken, Request $request = null)
|
||||
public function __construct(HtmlBuilder $html, UrlGenerator $url, Factory $view, $csrfToken, ?Request $request = null)
|
||||
{
|
||||
$this->url = $url;
|
||||
$this->html = $html;
|
||||
@@ -709,21 +710,48 @@ class FormBuilder
|
||||
* @param string $name
|
||||
* @param string $selected
|
||||
* @param array $options
|
||||
* @param string $format
|
||||
* @param string $format ISO format for Carbon::isoFormat() (e.g. "MMMM").
|
||||
* Legacy strftime() month tokens (%B, %b, %h, %m) are
|
||||
* still accepted and translated.
|
||||
*
|
||||
* @return \Illuminate\Support\HtmlString
|
||||
*/
|
||||
public function selectMonth($name, $selected = null, $options = [], $format = '%B')
|
||||
public function selectMonth($name, $selected = null, $options = [], $format = 'MMMM')
|
||||
{
|
||||
$format = $this->strftimeToIsoFormat($format);
|
||||
|
||||
$months = [];
|
||||
|
||||
foreach (range(1, 12) as $month) {
|
||||
$months[$month] = strftime($format, mktime(0, 0, 0, $month, 1));
|
||||
$months[$month] = Carbon::create(2000, $month, 1)->isoFormat($format);
|
||||
}
|
||||
|
||||
return $this->select($name, $months, $selected, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate the strftime() month tokens accepted before 7.0 into
|
||||
* Carbon ISO tokens, so existing selectMonth() calls keep working.
|
||||
*
|
||||
* @param string $format
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function strftimeToIsoFormat($format)
|
||||
{
|
||||
if (strpos($format, '%') === false) {
|
||||
return $format;
|
||||
}
|
||||
|
||||
return strtr($format, [
|
||||
'%B' => 'MMMM',
|
||||
'%b' => 'MMM',
|
||||
'%h' => 'MMM',
|
||||
'%m' => 'MM',
|
||||
'%%' => '%',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the select option for the given value.
|
||||
*
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ class HtmlBuilder
|
||||
* @param \Illuminate\Contracts\Routing\UrlGenerator $url
|
||||
* @param \Illuminate\Contracts\View\Factory $view
|
||||
*/
|
||||
public function __construct(UrlGenerator $url = null, Factory $view)
|
||||
public function __construct(?UrlGenerator $url, Factory $view)
|
||||
{
|
||||
$this->url = $url;
|
||||
$this->view = $view;
|
||||
|
||||
@@ -14,6 +14,13 @@ use Mockery as m;
|
||||
|
||||
class FormAccessibleTest extends PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $formBuilder;
|
||||
protected $htmlBuilder;
|
||||
protected $modelData;
|
||||
protected $now;
|
||||
protected $urlGenerator;
|
||||
protected $viewFactory;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
Capsule::table('models')->truncate();
|
||||
|
||||
@@ -14,6 +14,10 @@ use Mockery as m;
|
||||
|
||||
class FormBuilderTest extends PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $htmlBuilder;
|
||||
protected $urlGenerator;
|
||||
protected $viewFactory;
|
||||
|
||||
/**
|
||||
* @var FormBuilder
|
||||
*/
|
||||
@@ -697,6 +701,38 @@ class FormBuilderTest extends PHPUnit\Framework\TestCase
|
||||
$this->assertStringContainsString('<select id="foo" name="month"><option value="1">January</option>', $month3);
|
||||
}
|
||||
|
||||
public function testFormSelectMonthAcceptsLegacyStrftimeFormats()
|
||||
{
|
||||
$long = (string) $this->formBuilder->selectMonth('month', null, [], '%B');
|
||||
$short = (string) $this->formBuilder->selectMonth('month', null, [], '%b');
|
||||
$numeric = (string) $this->formBuilder->selectMonth('month', null, [], '%m');
|
||||
|
||||
$this->assertStringContainsString('<option value="1">January</option>', $long);
|
||||
$this->assertStringContainsString('<option value="2">Feb</option>', $short);
|
||||
$this->assertStringContainsString('<option value="12">12</option>', $numeric);
|
||||
}
|
||||
|
||||
public function testFormSelectMonthAcceptsIsoFormats()
|
||||
{
|
||||
$short = (string) $this->formBuilder->selectMonth('month', null, [], 'MMM');
|
||||
|
||||
$this->assertStringContainsString('<option value="3">Mar</option>', $short);
|
||||
}
|
||||
|
||||
public function testFormSelectMonthFollowsCarbonLocale()
|
||||
{
|
||||
$previous = \Illuminate\Support\Carbon::getLocale();
|
||||
\Illuminate\Support\Carbon::setLocale('es');
|
||||
|
||||
try {
|
||||
$months = (string) $this->formBuilder->selectMonth('month');
|
||||
} finally {
|
||||
\Illuminate\Support\Carbon::setLocale($previous);
|
||||
}
|
||||
|
||||
$this->assertStringContainsString('<option value="1">enero</option>', $months);
|
||||
}
|
||||
|
||||
public function testFormCheckbox()
|
||||
{
|
||||
$this->formBuilder->setSessionStore($session = m::mock('Illuminate\Contracts\Session\Session'));
|
||||
|
||||
@@ -9,6 +9,10 @@ use Mockery as m;
|
||||
|
||||
class HtmlBuilderTest extends PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $htmlBuilder;
|
||||
protected $urlGenerator;
|
||||
protected $viewFactory;
|
||||
|
||||
|
||||
/**
|
||||
* Setup the test environment.
|
||||
|
||||
Reference in new issue
Block a user