Download the PHP package umutcangungormus/laravel-named-route-binding without Composer

On this page you can find all versions of the php package umutcangungormus/laravel-named-route-binding. 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-named-route-binding

Laravel Named Route Binding

Latest Version on Packagist Total Downloads

Laravel'de route parametrelerini controller metodlarına isimlerine göre bağlayan bir paket. Artık parametre sırası önemli değil!

Problem

Laravel'de varsayılan olarak route parametreleri controller metodlarına sırasına göre geçirilir:

Çözüm

Bu paket ile parametreler isimlerine göre eşleştirilir:

Kurulum

Composer ile paketi yükleyin:

Paket otomatik olarak keşfedilir (Laravel 5.5+). Manuel kayıt gerekiyorsa:

Yapılandırma (Opsiyonel)

Yapılandırma dosyasını yayınlayın:

config/named-route-binding.php:

Özellikler

1. İsimle Eşleştirme

2. Snake_case / CamelCase Desteği

Route parametresi user_id ise, metod parametresi userId veya user_id olabilir:

3. Dependency Injection Desteği

Request ve diğer bağımlılıklar otomatik enjekte edilir:

4. Varsayılan Değerler

5. Nullable Parametreler

Route Model Binding ile Kullanım

Laravel'in Route Model Binding özelliği ile tam uyumludur:

Gerçek Dünya Örnekleri

Örnek 1: E-ticaret

Örnek 2: API Resource

Test

Katkıda Bulunma

Pull request'ler memnuniyetle karşılanır!

Lisans

MIT Lisansı. Detaylar için LICENSE dosyasına bakın.


🇬🇧 English Version

A Laravel package that binds route parameters to controller method arguments by name instead of by order. Parameter order no longer matters!

The Problem

By default in Laravel, route parameters are passed to controller methods in order:

The Solution

With this package, parameters are matched by name:

Installation

Install the package via Composer:

The package will be auto-discovered (Laravel 5.5+). For manual registration:

Configuration (Optional)

Publish the configuration file:

config/named-route-binding.php:

Features

1. Name-Based Matching

2. Snake_case / CamelCase Support

If route parameter is user_id, method parameter can be userId or user_id:

3. Dependency Injection Support

Request and other dependencies are automatically injected:

4. Default Values

5. Nullable Parameters

Usage with Route Model Binding

Fully compatible with Laravel's Route Model Binding:

Real World Examples

Example 1: E-commerce

Example 2: API Resource

Testing

Contributing

Pull requests are welcome!

License

MIT License. See LICENSE for details.


All versions of laravel-named-route-binding with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 umutcangungormus/laravel-named-route-binding contains the following files

Loading the files please wait ...