Download the PHP package thehocinesaad/laravel-algereography without Composer

On this page you can find all versions of the php package thehocinesaad/laravel-algereography. 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 laravel-algereography

Laravel-Algereography

Laravel-Algereography allows you to add Migrations, Seeders and Models of Algerian Wilayas and Dairas to your existing or new cool Laravel project .

- 58 Wilayas.
- 548 Dairas.
- Support both Arabic and French languages.
- Built in models relationships, so you can for example do: Daira::find(1)->wilaya to get the Wilaya of Daira with the id=1.

Installation

Step 1 - Require the package

composer require thehocinesaad/laravel-algereography

Step 2: Install the package

php artisan algereography:install

This command will do those good stuff for you:

  1. Publish two Models, Wilaya and Daira to app/Models.

  2. Publish two Migrations, create_wilayas_table and create_dairas_table to database/migrations

  3. Publish two Seeders, WilayaSeeder and DairaSeeder to database/seeders

  4. Run the two Migrations (create_wilayas_table and create_dairas_table)
    Note: this operation will automatically overwrite any table with the name of wilayas and dairas

  5. Run the two Seeders (WilayaSeeder and DairaSeeder)

  6. Finally, it prints Done! to make you know that everything is succefully finished then it will print 1 2 3 Viva l'Algérie! just to make you a little bit proud of your country :heart:

Step 3:

There is no step 3, you're done :wink:
Check out your database and you will find two new tables, wilayas and dairas.

How can I use the package

As mentioned before, the package publishes two models Wilaya and Daira, use them just like any other model in your project.

Get all Wilayas

Wilaya::all();

Get all Dairas

Daira::all();

Get Dairas of a Wilaya

Wilaya::findOrFail(15)->dairas

Get Wilaya of a Daira

Daira::findOrFail(205)->wilaya;

Note: Don't forget to import the models first:

use App\Models\Wilaya;
use App\Models\Daira;

Helpers

You can also use the package using some Helpers I added that will make your life easier.

Helpers list:

When specifying the language, to access the name attribute just do ->name and it will automatically get the name in the correct language, so there is no need to do ->ar_name to get the name in arabic.

Example

How cool is that!

Contributing

Thank you for considering contributing to Laravel-Algereography project! Feel free to contribute in any way, we welcome every contribution.

License

Laravel-Algereography project is open-sourced software licensed under the MIT license.


All versions of laravel-algereography with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
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 thehocinesaad/laravel-algereography contains the following files

Loading the files please wait ....