2017 © Pedro Peláez
 

library message

image

witooh/message

  • Sunday, July 14, 2013
  • by witooh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Laravel Message

Installation

add in app.config, (*1)

return array(
    'providers'=>array(
        ...
        ...
        'Witooh\Message\MessageServiceProvider',
    ),

    'alias'=>array(
        '''
        ...
        'Message' => 'Witooh\Message\Facades\Message',
    ),
);

Usage

Message

Message will generate json message data, (*2)

public function getIndex(){
    return Response::json(Message::success($data, $header);
}

The response will be like this, (*3)

{
    header:{
        status: 200,
        message: 'success'
    },
    body:[
        {id: 1, name: 'test1'},
        {id: 2, nmae: 'test2'}
    ]
}

Thow Error Exception to Json Response, (*4)

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));
    }

The Versions

14/07 2013

dev-master

9999999-dev

  Sources   Download

The Requires

 

by Avatar witooh