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.
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed