Coder Social home page Coder Social logo

laragear / rut Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 0.0 359 KB

Gracefully handle RUTs from within your Laravel application

Home Page: https://patreon.com/packagesforlaravel

License: MIT License

PHP 100.00%
chile laravel php rut validation validator

rut's People

Contributors

darkghosthunter avatar dependabot[bot] avatar stylecibot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

rut's Issues

Support for RUT over 100 million

Please check these requirements

  • This feature helps everyone using this package
  • It's feasible and maintainable
  • It's non breaking
  • I issued a PR with the implementation (optional)

Description

According to the guidelines of the Ministry of Education, since 2016, migrant students awaiting regularization are assigned a RUT over 100 million. This RUT is temporary and allows them access to services provided by the ministry, known as the Temporary School Identifier (Identificador Provisorio Escolar, IPE).

A few months ago, I had to implement a system that registers children. There were a couple of cases with RUTs over 100 million, which the system considered invalid.

This would entail:

  • Raising the maximum RUTs that can be validated to above 100 million. (To 150 million?).
  • Methods that allow determining if a RUT is temporary or definitive (isTemporary, isDefinitive).

Code sample

$rut = Rut::parse('100.765.432-5');

$rut->isValid(); //returns true

$rut->isPerson(); //returns true
$rut->isCompany(); //returns false

$rut->isTemporary(); //returns true
$rut->isDefinitive(); //returns false

[1.0.2] Undefined array key "rut"

PHP & Platform

8.1.3

Laravel verion

9.3.0

Have you done this?

  • I am willing to share my stack trace and logs
  • I can reproduce this bug in isolation (vanilla Laravel install)
  • I can suggest a workaround as a Pull Request

Expectation

Livewire validation passes (or fails) the rut property/cast if a model uses the HasRut trait.

Description

Laravel/Livewire returns a ErrorException indicating Undefined array key "rut" when attempting real-time validation ($this->validateOnly()), and clears the <rut> input field when the $this->validate() method is executed on form submit.

Reproduction

// https://github.com/noquierouser/laragear-rut-livewire-bug

Stack trace & logs

No response

Are you a Patreon supporter?

No, don't give priority to this

[1.x] Pick ups public functions into the builder.

PHP & Platform

N/A

Laravel verion

9.8.0

Have you done this?

  • I am willing to share my stack trace and logs
  • I can reproduce this bug in isolation (vanilla Laravel install)
  • I can suggest a workaround as a Pull Request

Expectation

Macro extensions pick up public OR static methods. Should take only those static AND public.

Description

Should use a collection and then filter the methods.

Reproduction

// https://github.com/Laragear/Rut/blob/fd970df14f2a027f5be0fd3a9ae0527c5a2974ee/src/Scopes/RutScope.php#L70

Stack trace & logs

No response

Are you a Patreon supporter?

Yes, with my username

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.