Code Monkey home page Code Monkey logo

slim3-bookshelf's Introduction

Hi there ๐Ÿ‘‹

I'm a software consultant and developer concentrating on web APIs and applications.

Drop me an email at [email protected] if you think I could help with your project.

slim3-bookshelf's People

Contributors

8ctopus avatar akrabat avatar permanar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slim3-bookshelf's Issues

Seems not to work for me at all...

Php version 5.5.6.
I'm keep seeing white screen of death without errors from start.
When registering error handler, I've got:

Type: LogicException
Message: Cache can only be a string, false, or a Twig_CacheInterface implementation.
File: \vendor\twig\twig\lib\Twig\Environment.php
Line: 269

first, when changed cache to "false" instead of null:

Type: InvalidArgumentException
Message: Database [default] not configured.
File:\vendor\illuminate\database\DatabaseManager.php
Line: 246

What's wrong?
Of course everything is set, settings file parsed ok, DB exists and login details are correct.

save() throws internal server error

When I try to save model, I get internal server error, and can't catch error at all. My model have only two columns, id pk autoincrement and name (string 255) this is my settup:

Model:

class Version extends Illuminate\Database\Eloquent\Model
{
    protected $table = 'version';

    protected $fillable = ['name'];

    protected $hidden = ['id'];
}

Action:

public function create(RequestInterface $request, ResponseInterface $response)
    {
        $params = $request->getParsedBody();
        $class = $this->model; // App\Models\Version
        $model = new $class();
        $model->fill($params);

        return $model->save() ?
            $this->success($response, "{$this->getModelName()} successfully saved.") :
            $this->error($response, $model->errors());

    }

I manager to localize issue, by adding break points, to this part of code in Illuminate\Database\Eloquent\Builder line #1242

if (in_array($method, $this->passthru)) {
            return call_user_func_array([$this->toBase(), $method], $parameters);
        }

But I have no idea what is wrong

slim 4 upgrade

Rob, I'm planning to upgrade your project to slim 4, are you interested in a pull request for that or you prefer to keep it under slim 3?

Using PDO instad of Eloquent?

Im trying to remove Eloquent from your app, and instead using PDO

But Iยดm having a hard time figuring out how the Model would look like, to initiate the PDO instance from the model.

<?php
namespace Bookshelf;
use PDO
final class Book
{
    protected $db;

    public function __construct(PDO $db)
    {
        $this->db = $db;
    }

    public static function find($id)
    {
        $sql = "SELECT * FROM books WHERE id = :id";
        $query = $db->prepare($sql);
        $query->execute(array(':id' => $id));

        return $query->fetchAll();
    }
}

How would can this be done?
Thanks in advance!

cd: /vagrant/vm-provisioning: No such file or directory

Hi.

I'm trying to run this app but "sudo vagrant up" is failing at the last hurdle...

default: Running: inline script

==> default: /tmp/vagrant-shell: line 1: cd: /vagrant/vm-provisioning: No such file or directory

Any pointers as to how to sort this would be much appreciated.

Thanks,

Dan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.