Skip to content

Is laravel-data Laravel dependent? #633

Answered by czuniga9
rendesadam asked this question in Q&A
Discussion options

You must be logged in to vote

It's possible but not very easy. It doesn't have many dependencies but it implicitly depends on a global app function which returns a laravel container (package illuminate/container) and a global config function that returns a config object (package illuminate/config) or classes that have similar functions (since it doesn't check for an interface).

I was able to make a small proof of concept only using laravel-data and the container package:

The global helpers (copied from a laravel project):

<?php
use Illuminate\Container\Container;

function app($abstract = null, array $parameters = [])
{
    if (is_null($abstract)) {
        return Container::getInstance();
    }
    return Container::g…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@rendesadam
Comment options

@rubenvanassche
Comment options

@rubenvanassche
Comment options

Answer selected by rendesadam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants