Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Api Resource Bundle Laravel Package

conghau/api-resource-bundle

View on GitHub
Deep Wiki
Context7

Guide Config

  • Add config in app\AppKernel
...
   new \TCH\ApiResourceBundle\TCHApiResourceBundle(),
   new \Nelmio\ApiDocBundle\NelmioApiDocBundle(),
   new JMS\SerializerBundle\JMSSerializerBundle($this)

  • Add config in app\config\config.yml
...
jms_serializer:
    metadata:
        auto_detection: true
nelmio_api_doc: ~
tch_api_resource:
   resources:
       user:
           entity: AppBundle\Entity\User
           actions: C.R.U.D.S #Create, Read/Retrieve, Update, Delete, Search
       .......... # add more here
  • Add config in app\config\routing.yml
...
NelmioApiDocBundle:
    resource: "@NelmioApiDocBundle/Resources/config/routing.yml"
    prefix:   /api/doc

tch_api_resource:
    resource: .
    type: tch_api_resource
    prefix:   /api/v1/

Note: See more guide of nelmio here

  • Usage trait class TraitTCHRepository
Example:
    use TCH\ApiResourceBundle\Util\TraitTCHRepository;
    
    /**
     * UserRepository
     *
     * This class was generated by the Doctrine ORM. Add your own custom
     * repository methods below.
     */
    class UserRepository extends \Doctrine\ORM\EntityRepository
    {
        use TraitTCHRepository;
    }

  • Go to api doc
[host]/api/doc

Example: http://127.0.0.1:8000/api/doc

^^ Enjoy

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware