Download the PHP package five-say/laravel-exception-extend without Composer

On this page you can find all versions of the php package five-say/laravel-exception-extend. 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-exception-extend

laravel-exception-extend


合理的利用异常化编程方法,可以使代码可维护性大幅提高。

使用前的准备

在 composer.json 文件中申明依赖:

/app/config/app.php 中设置“别名”

使用方法

自定义验证消息

特殊用法(直接抛出异常)

实际项目中的应用节选

我们可以不受干扰的写完一整个业务逻辑,然后再针对捕获的异常做细化的错误处理,你会感觉到写代码从未有过的顺畅,整个代码的可读性也大幅度的提高。

模型的异常化

上例中的 UserSaveFailException 即是模型异常化的结果。要达到这种效果仅仅需要一个步骤。让我们以 User 模型为例:

继承 FiveSay\Model(不必担心,我们的 FiveSay\Model 已经继承了 Eloquent):

额外的支持 - 模型观察者(模型事件监听)

继承了 FiveSay\Model 的模型将额外获得一个特性:当对应的“模型观察者类”(XxxxObserver)存在时,将自动载入。
同样以 User 模型为例:当你在系统任何地方定义了 UserObserver 后,这个类就会被自动注册为“模型观察者”。

模型事件的触发顺序

注意: softing softed forcing forced 并非原生事件,是由 FiveSay\Model 拓展得到的。


All versions of laravel-exception-extend with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version 4.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 five-say/laravel-exception-extend contains the following files

Loading the files please wait ....