Download the PHP package nawasara/emergency without Composer

On this page you can find all versions of the php package nawasara/emergency. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package emergency

nawasara/emergency

Emergency phone number directory for the Nawasara superapp framework. Numbers are grouped and served to the citizen app, along with a version marker so the app can keep a copy for use without a network connection.

Status v0.1.0

Feature Status
Emergency number table + admin panel ready
Grouping (Darurat, Kesehatan, Layanan Publik, Bencana) ready
Citizen endpoint GET /emergency/contacts, open, no account needed ready
Version marker for offline cache ready
Deactivate without deleting ready
National number seeder (112, 110, 113, 118, 119, 117, 123) ready
Ponorogo local numbers not built yet, staff fill these in via the panel

Why this screen has to work without a network

Emergency numbers are needed exactly when things go wrong: accidents, floods, fires, which is also when signal is most likely to drop. So the app keeps a copy of the list and only re-downloads it when the marker changes.

That marker (meta.version) is computed from both the count of active rows and the most recent update time, not one of them alone:

Together they catch adds, edits, and deletes. tests/DirectoryTest.php specifically locks down the deletion case.

Setup

Also add this to resources/css/app.css. Without it, none of the Tailwind classes in the package blades compile:

Citizen endpoint

Open, no account required, on purpose. Someone who just installed the app and has not registered yet is exactly the person who might need it; requiring login before showing the fire department number would be a design failure. The content is public anyway: these numbers are printed on brochures and notice boards.

Groups are ordered by urgency, not alphabetically. "Bencana" would come before "Darurat" alphabetically, and that is the wrong order for a screen people scan quickly. Groups outside the default list still show up, placed last; staff can add new groups without waiting for a code change.

Model

EmergencyContact, table nawasara_emergency_contacts

Column Notes
group Text, not an enum. The list of groups is a display decision that can change without a migration
name The name citizens read
number String, not a number. "112" and "0352481113" lose their leading zero as an integer
icon_name Lucide icon name without the prefix, e.g. shield-alert
primary The main number of its group, shown more prominently
is_active Deactivate without deleting; a withdrawn number keeps its trail
sort_order Order within its group

Permissions

Permission For
emergency.contact.view Viewing the list in the panel
emergency.contact.manage Adding, editing, deactivating

These are kept separate on purpose: changing an emergency number changes where citizens call when things go wrong, and that leaves no room for a second chance.

Seeder notes

ContactSeeder only contains national numbers that apply everywhere. Ponorogo local numbers are deliberately not guessed. A wrong emergency number is more dangerous than one that is not there yet. Local numbers are filled in by staff via the panel, and the panel exists precisely so that this does not have to wait for a release.

The seeder is safe to run repeatedly: it uses updateOrCreate on number + name, so it does not overwrite staff edits on other rows.

Roadmap

Author

Pringgo J. Saputro, Dinas Kominfo Kabupaten Ponorogo

License

MIT


All versions of emergency with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^12.0
spatie/laravel-permission Version ^6.0
nawasara/ui Version *
livewire/livewire Version ^3.0
nawasara/auth-primitives Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nawasara/emergency contains the following files

Loading the files please wait ...