witooh / message
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/witooh/message
Requires
- php: >=5.3.0
- illuminate/support: 4.0.x
This package is not auto-updated.
Last update: 2025-10-20 19:44:22 UTC
README
#Laravel Message#
##Installation##
add in app.config
return array( 'providers'=>array( ... ... 'Witooh\Message\MessageServiceProvider', ), 'alias'=>array( ''' ... 'Message' => 'Witooh\Message\Facades\Message', ), );
##Usage##
###Message###
Message will generate json message data
public function getIndex(){ return Response::json(Message::success($data, $header); }
The response will be like this
{ header:{ status: 200, message: 'success' }, body:[ {id: 1, name: 'test1'}, {id: 2, nmae: 'test2'} ] }
Thow Error Exception to Json Response
public function testExceptioons() { throw new PermissionException(Message::permission($message)); throw new AuthenticateException(Message::auth($message)); throw new NoutFoundException(Message::notfound($message)); throw new ValidationException(Message::validation($errors)); }