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.
Exploratory Slim Framework 3 application.
License: BSD 3-Clause "New" or "Revised" License
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.
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.
I think it's bad idea use full path to Bookshelf dir in composer autoload, because if someone wants to add some functional it can be very confusing.
https://github.com/akrabat/slim-bookshelf/blob/master/composer.json#L19
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
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?
literally cloned and vagrant up and it fails... are there more steps to this?
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!
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.