Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ras Laravel Package

denissonleal/ras

RAS is a Laravel package for role-based access control. It lets you define roles and permissions, assign them to users, and protect routes and resources with a simple, lightweight API designed for easy integration into new or existing Laravel applications.

View on GitHub
Deep Wiki
Context7

Getting Started

Treat this as an unsupported, vendored dependency, not an ecosystem package. Last release was 2021-03-29 and the repo has 4 stars — there is no docs site, no test suite you can point at, and no deprecation policy. Budget an hour of reading source before you write a line of integration code.

  1. Pin the exact version and install:

    composer require denissonleal/ras:0.4.1
    

    Expect a platform-constraint fight — a 2021 package will typically cap illuminate/support at Laravel 8. Check its composer.json first and decide up front whether you're going to fork it rather than paper over conflicts with --ignore-platform-reqs.

  2. Read the package before running it. In priority order:

    • vendor/denissonleal/ras/composer.json — autoload namespace, PHP and Laravel constraints.
    • vendor/denissonleal/ras/src/*ServiceProvider.php — what gets registered, what's bindable in the container, whether config is merged or published-only.
    • The config file — this is where the SUS connection/export settings live. php artisan vendor:publish --provider="..." and commit the published file, don't let it regenerate.
    • The visita class referenced in the v0.4.1 changelog — it's the central domain object, so it's the one you'll be characterizing with tests.
    • Any Console/ directory — php artisan list will reveal export commands if they're registered.
  3. First use case: don't build a UI. Build one queued job that takes a date range, maps your own records into the package's visit representation, produces the export, and writes it to storage/app/ras/. Prove the file is correct against a known-good sample from the receiving system before anything else touches it.

  4. Legal check in parallel: the license is GPL-3.0 (copyleft). Internal back-office use is generally fine; distributing it inside a closed-source product is not. Get that resolved before it's load-bearing.

Implementation Patterns

Wrap it behind your own interface — non-negotiable at 0.4.x. Every package class you touch should be reachable through one adapter:

interface RasExporter {
    public function export(Carbon $from, Carbon $to): RasExportResult;
}

final class PackageRasExporter implements RasExporter { /* only file importing the vendor namespace */ }

Bind it in your own service provider. When the visita API shifts, the blast radius is one file.

Keep a mapping layer separate from the exporter. Your domain (appointments, professional records, procedures) should not be shaped by the package's model. One VisitMapper class, pure functions, fully unit-tested without booting Laravel — this is where 90% of real defects live (date formats, CNS padding, CID/CBOS codes, municipality codes).

Run exports as queued jobs, never inline in a request. SUS exports are batch-shaped and can be slow. Job → file in storage/app/ras/{year}/{period}/ → notify or expose via a signed download route. Store the row count, date range, and package version alongside the artifact so an auditor can tell which code produced which file.

Use golden-file tests. Capture one validated output file as a fixture and assert byte-for-byte (or field-by-field after normalization) that your pipeline reproduces it. This is the only regression net you'll have, since the package ships no usable coverage.

Schedule it explicitly rather than relying on anything the package registers:

$schedule->job(new GenerateRasExport($period))->monthlyOn(1, '03:00')->withoutOverlapping();

If the package offers artisan scaffolding commands (its published blurb claims scaffolding; the source may or may not back it), point the stubs at your own namespace and review generated output as a diff — don't git add -A it.

Gotchas and Tips

  • The metadata is contradictory. The package description says "rapid application scaffolding," the repo name/description says "API RAS para exportação do SUS," and the PM notes talk about visit/engagement tracking. These cannot all be right. Trust vendor/denissonleal/ras/src and nothing else — and re-confirm the package actually does what your stakeholders think it does before it lands on a roadmap.
  • Assume it's unmaintained. No release in ~4 years means no PHP 8.2+ / Laravel 10+ support, no security patches. Plan for a fork from day one: change the composer name, pull it in via a vcs repository, keep the original namespace so upstream diffs stay readable.
  • GPL-3.0 propagates. Link it into a distributed binary and you inherit obligations. Internal-only is the safe posture.
  • Portuguese domain vocabulary is a real bug source. visita ≠ atendimento, and "RAS" itself is overloaded across the SUS. Write a short glossary in a code comment block above the mapper — new team members will guess wrong otherwise.
  • Formats are legally versioned. The receiving system's layout changes on its own schedule. Persist the layout version with each generated file; when the spec bumps, you want to know exactly which historical files used the old one.
  • Validate output yourself. The package will not check referential integrity (procedure codes against the table, professional against establishment). Add a validation pass before delivery — a rejected batch at the destination is far more expensive than a failing assertion in your job.
  • Locale and dates: America/Sao_Paulo, Y-m-d vs d/m/Y, and float/decimal separators for any value fields. Force the format at the boundary; never rely on app.locale.
  • Config caching: after publishing or editing the config, php artisan config:clear in local and ensure your deploy runs config:cache — a stale published config silently producing wrong output is a classic.
  • Container extension points: if the service provider registers the visita class as a singleton, prefer $this->app->extend(...) in your own provider over editing vendor files. If it's instantiated with new inside the export class, you can't extend it — fork.
  • Characterize before you upgrade. Even a patch bump inside 0.4.x should be preceded by your golden-file test passing on the OLD version, then on the new one. The v0.4.1 note ("Correção na classe de visita") tells you nothing about blast radius; your fixture is the only thing that will.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource