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 Model Laravel Package

outrightvision/api-model

View on GitHub
Deep Wiki
Context7

Assumptions

  • We cast the created_at and updated_at using Carbon::parse() by default, if you want to avoid this or add other parameters to date casting, you need to add them to cast_dates attribute.
  • The requiredParameters defines which parameters are needed in order to determine if the model exists or not.
  • The default timezone for dates is inside the attribute: date_timezone.
  • You should not (it is not encouraged) to edit the relationships attribute manually.

Helpers

The library comes with a handy helper get_data

This helper allows you to access arrays using dot notation and arrow notation.

Examples

$user  = [
    'name' => 'Jon Snow',
    'father' => [
            'data' => [
                'name' => 'Rhaegar Targaryen',
                'sister' => [
                    'data' => [
                        'name' => 'Daenerys Targaryen'
                    ],
            ],
        ],
    ],
];

get_data($user, 'name'); // "Jon Snow"
get_data($user, 'father.data.name'); // "Rhaegar Targaryen"
get_data($user, 'father.data.sister.data.name'); // Daenerys Targaryen
// Short version:
get_data($user, 'father->name'); // Daenerys Targaryen
get_data($user, 'father->sister->name'); // Daenerys Targaryen
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky