Skip to content

Commit

Permalink
Merge pull request #33 from laraflow/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
hafijul233 authored Oct 2, 2022
2 parents 56acae7 + 11d77d5 commit a572932
Show file tree
Hide file tree
Showing 286 changed files with 2,164 additions and 3,725 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '7.2'
coverage: none

- name: Install composer dependencies
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [7.4]
laravel: [8.*]
php: [7.2]
laravel: [6.*, 7.*, 8.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: 6.*
- laravel: [6.*, 7.*, 8.*]
testbench: [5.*, 6.*, 7.*]

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand All @@ -30,7 +30,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
extensions: dom, curl, pcntl, pdo, bcmath, fileinfo
coverage: none

- name: Setup problem matchers
Expand All @@ -43,5 +43,5 @@ jobs:
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/pest
# - name: Execute tests
# run: vendor/bin/pest
22 changes: 10 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "lafalow/form",
"name": "laraflow/form",
"type": "library",
"description": "Laravel form builder based bootstrap form components",
"support": {
Expand Down Expand Up @@ -40,22 +40,22 @@
"illuminate/view": "^6.0|^7.0|^8.0|^9.0"
},
"require-dev": {
"illuminate/database": "^6.0|^7.0|^8.0|^9.0",
"mockery/mockery": "~1.0",
"nunomaduro/collision": "^5.11",
"nunomaduro/collision": "^4.0|^5.0|^6.0",
"nunomaduro/larastan": "^1.0",
"orchestra/testbench": "^6.24",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.2",
"orchestra/testbench": "^5.0|^6.0|^7.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.1",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^8.0|^9.0"
},
"autoload": {
"psr-4": {
"Laraflow\\Form\\": "src"
}
"Laraflow\\Form\\": "./src"
},
"files": [
"./src/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
Expand All @@ -64,9 +64,7 @@
},
"scripts": {
"analyse": "vendor/bin/phpstan analyse",
"test": "vendor/bin/pest",
"test-coverage": "vendor/bin/pest --coverage",
"format": "vendor/bin/pint"
"test" : "vendor/bin/phpunit"
},
"config": {
"sort-packages": true,
Expand Down
55 changes: 16 additions & 39 deletions config/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,25 @@
* @var string style
* @value bootstrap3, bootstrap4, bootstrap5
*/
'style' => 'bootstrap4',
'style' => env('FORM_STYLE', 'bootstrap4'),

'field' => [
'default_class' => ['form-control'],
'error_class' => ['is-invalid'],
'styles' => [
'bootstrap4' => [
'wrapper' => [
'normal' => 'form-group',
'group' => 'form-group',
'horizon' => 'form-group row',
'inline' => 'form-inline',
],
'field' => ['form-control'],
'validation' => ['is-invalid'], //if validation false color class
'error' => ['d-block invalid-feedback'], //if validation false color class
'submit' => ['btn btn-primary', 'font-weight-bold'],
'cancel' => ['invalid-feedback'],
'horizon_label_size' => '2',
],
],

'message' => [
'default_class' => ['font-weight-bold'],
'error_class' => ['invalid-feedback'],
],

/**
* Form local language for field that support localization
*
* @reference month, day etc
*
* @var string style
* @value bootstrap3, bootstrap4, bootstrap5
*/
'submit_class' => 'btn btn-primary fw-bold',

/**
* Form local language for field that support localization
*
* @reference month, day etc
*
* @var string style
* @value bootstrap3, bootstrap4, bootstrap5
*/
'cancel_class' => 'invalid-feedback',

/**
* Form local language for field that support localization
*
* @reference month, day etc
*
* @var string style
* @value bootstrap3, bootstrap4, bootstrap5
*/
'horizon_label_size' => '2',

/**
* Form month values what value and label month dropdown
* will have
Expand Down
Empty file added export.txt
Empty file.
34 changes: 20 additions & 14 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,32 @@
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<testsuites>
<testsuite name="VendorName Test Suite">
<testsuite name="Laraflow Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<!-- <coverage cacheDirectory="/build/cache/PHPUnit"-->
<!-- includeUncoveredFiles="true"-->
<!-- processUncoveredFiles="true"-->
<!-- pathCoverage="false"-->
<!-- ignoreDeprecatedCodeUnits="true"-->
<!-- disableCodeCoverageIgnore="true">-->
<!-- <include>-->
<!-- <directory suffix=".php">./src</directory>-->
<!-- </include>-->
<!-- <report>-->
<!-- <html outputDirectory="build/coverage"/>-->
<!-- <text outputFile="build/coverage.txt"/>-->
<!-- <clover outputFile="build/logs/clover.xml"/>-->
<!-- </report>-->
<!-- </coverage>-->
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
</whitelist>
</filter>
</phpunit>
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/checkbox.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/date.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/email.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/file.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::fLabel($name, $label, $required, ['class' => 'd-block mb-2']) !!}
<div class="custom-file">
@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/number.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/radio.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/range.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/search.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/select.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@php
$options = ['class' => 'form-control custom-select'];
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/selectmonth.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@php
$options = ['class' => 'form-control custom-select'];
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/selectrange.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@php
$options = ['class' => 'form-control custom-select'];
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/selectyear.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@php
$options = ['class' => 'form-control custom-select'];
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/tel.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/text.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/textarea.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/group/url.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{!! \Laraflow\Form\Facades\Form::label($name, $label, $required) !!}

@php
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
6 changes: 3 additions & 3 deletions resources/views/bootstrap3/horizon/checkbox.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
{!! \Laraflow\Form\Facades\Form::hLabel($name, $label, $required, $col_size) !!}

@php
$field_size = abs(12 - $col_size);
$options = ['class' => 'form-control '];
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
@endphp

<div class="col-md-{{ $field_size }}">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/horizon/date.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@php
$field_size = abs(12 - $col_size);
$options = ['class' => 'form-control '];
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/bootstrap3/horizon/number.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@php
$field_size = abs(12 - $col_size);
$options = ['class' => 'form-control '];
if (isset($required) && $required == true) {
$options['required'] = 'required';
}
Expand Down
Loading

0 comments on commit a572932

Please sign in to comment.