laravel-6 support

This commit is contained in:
RafficMohammed
2023-01-08 01:17:22 +05:30
parent 1a5c16ae4b
commit 774eed8b0e
4962 changed files with 279380 additions and 297961 deletions

View File

@@ -18,17 +18,17 @@
}
],
"require": {
"php": ">=7.1.3",
"illuminate/http": "5.8.*",
"illuminate/routing": "5.8.*",
"illuminate/session": "5.8.*",
"illuminate/support": "5.8.*",
"illuminate/view": "5.8.*"
"php": ">=7.2.5",
"illuminate/http": "^6.0|^7.0|^8.0|^9.0",
"illuminate/routing": "^6.0|^7.0|^8.0|^9.0",
"illuminate/session": "^6.0|^7.0|^8.0|^9.0",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0",
"illuminate/view": "^6.0|^7.0|^8.0|^9.0"
},
"require-dev": {
"illuminate/database": "5.8.*",
"illuminate/database": "^6.0|^7.0|^8.0|^9.0",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~7.1"
"phpunit/phpunit": "~8.5|^9.5.10"
},
"autoload": {
"psr-4": {
@@ -40,7 +40,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.8-dev"
"dev-master": "6.x-dev"
},
"laravel": {
"providers": [

View File

@@ -0,0 +1,9 @@
![LaravelCollective HTML](LaravelCollectiveHTML-banner.png)
[![Build Status](https://travis-ci.org/LaravelCollective/html.svg)](https://travis-ci.org/LaravelCollective/html)
[![Total Downloads](https://poser.pugx.org/LaravelCollective/html/downloads)](https://packagist.org/packages/laravelcollective/html)
[![Latest Stable Version](https://poser.pugx.org/LaravelCollective/html/v/stable.svg)](https://packagist.org/packages/laravelcollective/html)
[![Latest Unstable Version](https://poser.pugx.org/LaravelCollective/html/v/unstable.svg)](https://packagist.org/packages/laravelcollective/html)
[![License](https://poser.pugx.org/LaravelCollective/html/license.svg)](https://packagist.org/packages/laravelcollective/html)
A documentação oficial para Forms & Html para o framework Laravel podem ser encontrados no site [LaravelCollective](https://laravelcollective.com/docs).

View File

@@ -1,4 +1,4 @@
# Forms & HTML
![LaravelCollective HTML](LaravelCollectiveHTML-banner.png)
[![Build Status](https://travis-ci.org/LaravelCollective/html.svg)](https://travis-ci.org/LaravelCollective/html)
[![Total Downloads](https://poser.pugx.org/LaravelCollective/html/downloads)](https://packagist.org/packages/laravelcollective/html)
@@ -6,4 +6,4 @@
[![Latest Unstable Version](https://poser.pugx.org/LaravelCollective/html/v/unstable.svg)](https://packagist.org/packages/laravelcollective/html)
[![License](https://poser.pugx.org/LaravelCollective/html/license.svg)](https://packagist.org/packages/laravelcollective/html)
Official documentation for Forms & Html for The Laravel Framework can be found at the [LaravelCollective](http://laravelcollective.com) website.
Official documentation for Forms & Html for The Laravel Framework can be found at the [LaravelCollective](https://laravelcollective.com/docs) website.

View File

@@ -11,7 +11,6 @@ use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\App;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Traits\Macroable;
@@ -1202,7 +1201,13 @@ class FormBuilder
protected function getRouteAction($options)
{
if (is_array($options)) {
return $this->url->route($options[0], array_slice($options, 1));
$parameters = array_slice($options, 1);
if (array_keys($options) === [0, 1]) {
$parameters = head($parameters);
}
return $this->url->route($options[0], $parameters);
}
return $this->url->route($options);
@@ -1299,7 +1304,7 @@ class FormBuilder
&& is_null($old)
&& is_null($value)
&& !is_null($this->view->shared('errors'))
&& count(php_sapi_name() === 'cli' ? [] : $this->view->shared('errors')) > 0
&& count(is_countable($this->view->shared('errors')) ? $this->view->shared('errors') : []) > 0
) {
return null;
}
@@ -1357,11 +1362,11 @@ class FormBuilder
{
$key = $this->transformKey($name);
if (method_exists($this->model, 'getFormValue')) {
if ((is_string($this->model) || is_object($this->model)) && method_exists($this->model, 'getFormValue')) {
return $this->model->getFormValue($key);
}
return data_get($this->model, $this->transformKey($name));
return data_get($this->model, $key);
}
/**

View File

@@ -171,12 +171,13 @@ class HtmlBuilder
* @param string $url
* @param string $title
* @param array $attributes
* @param bool $escape
*
* @return \Illuminate\Support\HtmlString
*/
public function secureLink($url, $title = null, $attributes = [])
public function secureLink($url, $title = null, $attributes = [], $escape = true)
{
return $this->link($url, $title, $attributes, true);
return $this->link($url, $title, $attributes, true, $escape);
}
/**
@@ -186,14 +187,15 @@ class HtmlBuilder
* @param string $title
* @param array $attributes
* @param bool $secure
* @param bool $escape
*
* @return \Illuminate\Support\HtmlString
*/
public function linkAsset($url, $title = null, $attributes = [], $secure = null)
public function linkAsset($url, $title = null, $attributes = [], $secure = null, $escape = true)
{
$url = $this->url->asset($url, $secure);
return $this->link($url, $title ?: $url, $attributes, $secure);
return $this->link($url, $title ?: $url, $attributes, $secure, $escape);
}
/**
@@ -202,12 +204,13 @@ class HtmlBuilder
* @param string $url
* @param string $title
* @param array $attributes
* @param bool $escape
*
* @return \Illuminate\Support\HtmlString
*/
public function linkSecureAsset($url, $title = null, $attributes = [])
public function linkSecureAsset($url, $title = null, $attributes = [], $escape = true)
{
return $this->linkAsset($url, $title, $attributes, true);
return $this->linkAsset($url, $title, $attributes, true, $escape);
}
/**
@@ -217,12 +220,14 @@ class HtmlBuilder
* @param string $title
* @param array $parameters
* @param array $attributes
* @param bool $secure
* @param bool $escape
*
* @return \Illuminate\Support\HtmlString
*/
public function linkRoute($name, $title = null, $parameters = [], $attributes = [])
public function linkRoute($name, $title = null, $parameters = [], $attributes = [], $secure = null, $escape = true)
{
return $this->link($this->url->route($name, $parameters), $title, $attributes);
return $this->link($this->url->route($name, $parameters), $title, $attributes, $secure, $escape);
}
/**
@@ -232,12 +237,14 @@ class HtmlBuilder
* @param string $title
* @param array $parameters
* @param array $attributes
* @param bool $secure
* @param bool $escape
*
* @return \Illuminate\Support\HtmlString
*/
public function linkAction($action, $title = null, $parameters = [], $attributes = [])
public function linkAction($action, $title = null, $parameters = [], $attributes = [], $secure = null, $escape = true)
{
return $this->link($this->url->action($action, $parameters), $title, $attributes);
return $this->link($this->url->action($action, $parameters), $title, $attributes, $secure, $escape);
}
/**

View File

@@ -2,12 +2,12 @@
namespace Collective\Html;
use Illuminate\Support\Facades\Blade;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
use Illuminate\View\Compilers\BladeCompiler;
class HtmlServiceProvider extends ServiceProvider
class HtmlServiceProvider extends ServiceProvider implements DeferrableProvider
{
/**
* Supported Blade Directives
@@ -17,13 +17,6 @@ class HtmlServiceProvider extends ServiceProvider
protected $directives = ['entities','decode','script','style','image','favicon','link','secureLink','linkAsset','linkSecureAsset','linkRoute','linkAction','mailto','email','ol','ul','dl','meta','tag','open','model','close','token','label','input','text','password','hidden','email','tel','number','date','datetime','datetimeLocal','time','url','file','textarea','select','selectRange','selectYear','selectMonth','getSelectOption','checkbox','radio','reset','image','color','submit','button','old'
];
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
/**
* Register the service provider.
*

View File

@@ -10,7 +10,7 @@ if (! function_exists('link_to')) {
* @param bool $secure
* @param bool $escape
*
* @return string
* @return \Illuminate\Support\HtmlString
*/
function link_to($url, $title = null, $attributes = [], $secure = null, $escape = true)
{
@@ -27,7 +27,7 @@ if (! function_exists('link_to_asset')) {
* @param array $attributes
* @param bool $secure
*
* @return string
* @return \Illuminate\Support\HtmlString
*/
function link_to_asset($url, $title = null, $attributes = [], $secure = null)
{
@@ -44,7 +44,7 @@ if (! function_exists('link_to_route')) {
* @param array $parameters
* @param array $attributes
*
* @return string
* @return \Illuminate\Support\HtmlString
*/
function link_to_route($name, $title = null, $parameters = [], $attributes = [])
{
@@ -61,7 +61,7 @@ if (! function_exists('link_to_action')) {
* @param array $parameters
* @param array $attributes
*
* @return string
* @return \Illuminate\Support\HtmlString
*/
function link_to_action($action, $title = null, $parameters = [], $attributes = [])
{