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.
bugban/symfony
beyonder-capi/workflow-extensions-bundle
beyonder-capi/job-queue-bundle
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin