Giter Site home page Giter Site logo

jenssegers / laravel-mongodb Goto Github PK

View Code? Open in Web Editor NEW
6.9K 179.0 1.4K 2.33 MB

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)

Home Page: https://www.mongodb.com/compatibility/mongodb-laravel-integration

License: MIT License

PHP 99.91% Dockerfile 0.09%
laravel mongo mongodb eloquent orm moloquent php laravel-framework

laravel-mongodb's Introduction

Laravel MongoDB

Latest Stable Version Total Downloads Build Status

This package adds functionalities to the Eloquent model and Query builder for MongoDB, using the original Laravel API. This library extends the original Laravel classes, so it uses exactly the same methods.

This package was renamed to mongodb/laravel-mongodb because of a transfer of ownership to MongoDB, Inc. It is compatible with Laravel 10.x. For older versions of Laravel, please refer to the old versions.

Documentation

Reporting Issues

Think you’ve found a bug in the library? Want to see a new feature? Please open a case in our issue management tool, JIRA:

  • Create an account and login.
  • Navigate to the PHPORM project.
  • Click Create - Please provide as much information as possible about the issue type and how to reproduce it.

Note: All reported issues in JIRA project are public.

For general questions and support requests, please use one of MongoDB's Technical Support channels.

Security Vulnerabilities

If you've identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions in Create a Vulnerability Report.

Development

Development is tracked in the PHPORM project in MongoDB's JIRA. Documentation for contributing to this project may be found in CONTRIBUTING.md.

laravel-mongodb's People

Contributors

alcaeus avatar alexandre-butynski avatar andrei-gafton-rtgt avatar apeisa avatar benargo avatar bodom78 avatar ccho-mongodb avatar daveawb avatar denissonleal avatar dependabot[bot] avatar dfurnes avatar divine avatar duxet avatar gromnan avatar halaei avatar hans-thomas avatar hlorofos avatar jenssegers avatar manan-jadhav avatar pi0 avatar remicollin avatar rennokki avatar rjvandoesburg avatar rosemaryorchard avatar simonschaufi avatar smolevich avatar stephandesouza avatar thilanga avatar treggats avatar tucker-eric 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  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

laravel-mongodb's Issues

Class 'MongoClient' not found

After successfully installing the package and adding the provider + alias as mentioned in the docs, this error occurs in /vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Connection.php

Forces "_id" to be an instance of Mongo's ObjectId

If I wanted to have my document's "_id" be something other than Mongo's ObjectId, the "compileWheres()" function throws a Mongo Exception because it excepts to be able to create a MongoId instance. If Mongo allows anything to be entered into the _id field, shouldn't we be able to do that using the MongoDB Eloquent model?

User must implement Remindable interface.

I am using the inbuilt User auth in Laravel and when storing a password reset via Password::reset I am getting the following error "User must implement Remindable interface." Even though I am implementing that interface.

It was working with MySql, so it must be something I have done when transferring to use your package.

Have you run into this problem before?

Use both MySQL Models and MongoDB models

Our application uses both MySQL and MongoDB connections, but I'm afraid I can't get both working together.

I have tried various things such as tweaking namespaces etc. If I remove the 'Jenssegers\Mongodb\MongodbServiceProvider' from providers the MySQL eloquent models work as expected.

Is there any way to get them working side by side? My guess is the ConnectionResolver has been changed and its breaking MySQL models.

Im quite new to Laravel so not 100% if the above this the problem.

Using the connection everywhere

Hi again,
I would like to use the MongoDB connection outside of a Model (ie. a custom class not dependant of a specific collection).

So far:
DB::getMongoDB() does'nt work (dependency issue, couldn't resolve)
DB::connection('mongodb') returns NULL

What is the best practice?

A) still use your IoC ? Then how can I proceed?
B) Open the connection using the original Mongo PHP library, everytime I need it ? Isn't it efficient because it might trigger multiple connections instead of a single instance?

Thanks in advance!

Seeding fails

When I try to seed the MongoDB I get the following error:

[ErrorException]
Argument 2 passed to Illuminate\Database\Query\Builder::__construct() must
be an instance of Illuminate\Database\Query\Grammars\Grammar, null given, c
alled in /home/bronx/www/zumuta/laravel/vendor/laravel/framework/src/Illumi
nate/Database/Eloquent/Model.php on line 1514 and defined

Class 'MongoClient' not found?

Class 'MongoClient' not found in Connection.php on line 132. This is the error received when I try to run migrations - ($ php artisan migrate). Any Ideas? Thanks in advance.

Does not work with Jeffrey Way's Factory

I am trying to do some testing. In doing so, I am generating random data for a model using Jeffrey Way's helper Factory. However, trying to do so by calling $model = Factory::make('CategoryModel'); generates this error:

{"error":{"type":"ErrorException","message":"call_user_func_array() expects 
parameter 1 to be a valid callback, class 'MongoDB' does not have a method 'getDoctrineDriver'","file":"/var/www/leaf/vendor/jenssegers/mongodb/src/
Jenssegers/Mongodb/Connection.php","line":174}}

His repository is at https://github.com/JeffreyWay/Laravel-Test-Helpers. I wonder if this is fixable?

Feature request: orderBy()->where()->take()->get();

Hi,

would it possible to allow combinations of orderBy with where? Something like this:

AnotherModel::orderBy('created_at', 'desc')->where('some_id', '=', new MongoID((string) $model->_id))->take(1)->get();

This would be really cool to have. Please correct me, if there already should be a feature like this available!

Thanks in advance!

Packagist requires Laravel 4.1.x

It breaks the compatibility again for those who use 4.0.x when using Composer to install. Can you tag one for 4.0.x on Packagist?

Can't run raw query

I can't see anyway to run a raw Mongo query using the open database connection. Is this possible? If not, I'd say this is an issue.

Aggregate by time

Hi there,
I just can't get to aggregate results by time.

Let's say I log errors in a MongoDB collection.
How can I group the number of errors per day (for example) ?

Thanks in advance.

Nested arrays

Is there any way to use the 'push' command to add objects to an existing array field? This is crucial in working with MongoDB to deal with nesting.

Cannot use "find" when Model has constructor

I wanted to create a constructor for my model to give some fields some default values. I created the constructor like this:

protected $fillable = array('_id');

public function __construct($attributes = array(), $exists = false)
    {
        parent::construct($attributes, $exists);

        $this->wigets = array();
        $this->starredDocuments = array();
        $this->last_accessed_date = date('m/d/Y g:i:s A'); // e.g. 08/23/2013 1:23:45 PM
    }

My plan requires me to first check if an entry exists with the given key before creating a new one and saving it. When I call "find" on my model, I get a BadMethodCallException: Call to undefined method Jenssegers\Mongodb\Builder::construct()

Connection Fail

I am trying to use Laravel-MongoDB in Laravel 4 but I run into this error

MongoClient::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known 

From Laravel trace tool, this file is highlighted [/var/www/archels/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Connection.php] line 30-39

// Store configuration
$this->config = $config;
// Check for connection options
$options = array_get($config, 'options', array());
// Create connection
$this->connection = new MongoClient($this->getDsn($config), $options);
// Select database

This is how I do my connection

'mongodb' => array( 'driver' => 'mongodb', 'host' => '127.0.0.1', 'port' => 27017, 'username' => 'myusername', 'password' => 'mypassword', 'database' => 'mydb' ),

Note: I followed this tutorial for php-driver installation and RockDB.

Any Idea on why this is happening? Thanks

implement $unset?

Since you have gone and support both $pull and $push, which is mongodb only feature, i am not sure if you would consider implementing $unset (remove attribute from document) as well?

::all() returns "_id":{"$id":"51c33c7e537e07abac000004"}

Hi,

since the last composer update, the ::all() method seems to return a broken _id. Here's an example code:

public function index()
{
$threads = Thread::all();

return Response::json($threads);
}

The code is resulting in this:

[{"_id":{"$id":"51c33c7e537e07abac000004"},"updated_at":{"sec":1371749502,"usec":0},"created_at":{"sec":1371749502,"usec":0}}]

It appears to have something to do with how the actual _id from the MongoDB is being processed.

laravel/mongo connection error

error: Unresolvable dependency resolving [Parameter #0 [ $server ]].
placeholders in credentials for instead of actual values

Mongo connection array

'mongodb' => array(
    'default' => array(
        'host'     => 'ds047987-a0.mongolab.com',
        'port'     => port_num,
        'database' => 'dbname',
        'username' => 'user',
        'password' => 'password',
    ),
),

Two connections to Postgres and MongoDB PHP 5.4

Hi Jens,

In our application (Laravel4) use two connections to Postgres databases and MongoDB.
Using PHP 5.3 we had no problems, but using PHP 5.4.9 have a problem with the instance of the connection to the DB you are getting 'jenssegers/mongodb/src/Jenssegers/Mongodb/Model.php'. I do not understand why it is that you are getting the connection to the Postgres database in 5.4 but work in 5.3.
We tested the PHP Mongo client 5.4 on a standalone application and it works.

The exception is:

       {"error""type":"ErrorException","message":"Argument 1 passed to Jenssegers\\Mongodb\\Builder::__construct() must be an instance of Jenssegers\\Mongodb\\Connection, instance of Illuminate\\Database\\PostgresConnection given, called in /vendor\/jenssegers\/mongodb\/src\/Jenssegers\/Mongodb\/Model.php on line 186 and defined","file":"/vendor\/jenssegers\/mongodb\/src\/Jenssegers\/Mongodb\/Builder.php","line":37}}

In my case I have defined:

Provider:

      'Jenssegers\Mongodb\MongodbServiceProvider'

Alias of the Laravel Eloquent Model:

      'Eloquent' => 'Illuminate\Database\Eloquent\Model',

Example of a Jenssegers model:

      use Jenssegers\Mongodb\Model as Eloquent;

      MongoData class extends Eloquent {
           protected $ collection = 'data';
      }

And finally,
The connections to the DB:

      'default' => 'pgsql'

      'mongodb' => array (
         'driver' => 'mongodb',
         'host' => 'localhost',
         'port' => 27017,
         'username' => 'user',
         'password' => 'password',
         'database' => 'database'
     )

     'pgsql' => array (
         'driver' => 'pgsql',
         'host' => 'localhost',
         'port' => 5432,
         'database' => 'database',
         'username' => 'user',
         'password' => 'password',
         'charset' => 'utf8',
         'prefix' =>'',
         'schema' => 'public',
     )

Fatal error accessing fromDateTime()

After upgrading the whole system breaks with error:

Access level to Jenssegers\Mongodb\Model::fromDateTime() must be public (as in class Illuminate\Database\Eloquent\Model) 

Connection works via terminal mongo but not using Laravel-MongoDB

Hey There,
Just installed Laravel-MongoDB on my Mongo setup,
After setting up everything in the database.php file I'm gettting a 'Failed to connect to: localhost:27017: Authentication failed on database 'vbtest' with username 'root': auth fails'

Even though I'm using exactly the same connection on the terminal which works.

Here's the Database.php config

'connections' => array(
                'mongodb'       => array(
                        'host'          => 'localhost',
                        'port'          => 27017,
                        'database'      => 'vbtest',
                        'username'      => 'root',
                        'password'      => 'mypassword'
                )
        ),

And this is how It works in the terminal

mongo --username=root --password=mypassword

Any ideas?
Thanks!
Shai.

Unable to aggregate subdocuments

I'm having a problem where I can't aggregate subdocuments. The problem is that my $columns argument has columns like subdocument.key. Mongo doesn't like that and spits out this error:

exception: the group aggregate field name 'metrics.clicks' cannot be used because $group's field names cannot contain '.'

Dump of the $group pipeline looks like this:

array(2) [
    '_id' => integer 0
    'metrics.clicks' => array(1) [
        '$sum' => string (15) "$metrics.clicks"
    ]
]

I'm not sure if this is even possible to fix without deviating too much from the Laravel query builder. Could possibly add a third optional parameter to rename columns, but I don't know if that would be wise.

Possibly introduce some set of characters to denote spaces, pass that to Mongo, and then split by those characters when Mongo comes back with the aggregates?

Model::find(NULL) throws an exception

The find method doesn't support NULL as parameter. The expected behavior is to return NULL (as Eloquent does).

"error": {
  "type":"ErrorException",
  "message":"Undefined index: value",
  "file":"...\/vendor\/jenssegers\/mongodb\/src\/Jenssegers\/Mongodb\/Builder.php",
  "line":587
}

I don't see a simple patch right now. I just start using your package and I hope help you more later.

Question: Query db by MongoDate

Hello,

first want to say that your extension is awesome!

I have one question... I have mongodb collection saved with models that have column type "Date". When I access that collection I see that column with Date type is actually MongoDate object.

My question is how I can query by that column? I have tried next scenarios with no success:

DB::connection('mongodb')->collection('names')->where('date', '<', new MongoDate())
DB::connection('mongodb')->collection('names')->where('date', '<', new DateTime())
DB::connection('mongodb')->collection('names')->where('date', '<', time())
DB::connection('mongodb')->collection('names')->where('date', '<', date('Y-m-d'))

Thanks,
Milos

Use 'driver' option

Rather than looking for a connection with a specific name I think it would make more sense to go by driver to follow standard.

Ideally rather than extending eloquent this might extend the database connection system instead, so things like sessions and eloquent "just work" as a result.

Unable to delete field

I know MongoDB uses $update to do this. I wonder if it's possible to have this function using Eloquent's style instead of raw input?

clusters including master/slave db hosts

I'm trying to connect to a cluster of 2 databases.
I'm aware that you build the connection string in the getDsn function.

so I set some extra parameters in the config for mongo like below

'mongodb' => array(

    'cluster'  => 'true',
    'host'     => 'ds031708-a0.mongolab.com',
    'host2'    => 'ds031708-a1.mongolab.com',
    'port'     => port_num,
    'database' => 'db_name',
    'username' => 'user',
    'password' => 'password',
),

and in getDsn I added this block:

    if (isset($config['cluster']) and (isset($config['host2'])) and ($config['cluster'] === 'true')) {
        $dsn .= ',{$host2}:{$port}';
    }

However I continue to get this error:

MongoCursorException
ds031708-a0.mongolab.com:31708: not master and slaveOk=false

Is there something that I'm overlooking?
It seems that the connection string should be built properly if these conditions are met.

Laravel-mongodb crashes laravel when mongod crashes

Laravel-MongoDB crashes Laravel when mongod crashes with following error

MongoClient::__construct(): send of 58 bytes failed with errno=10054
An existing connection was forcibly closed by the remote host. 

It doesn't get back to normal even after mongod is back up and running It only works when web server is restarted .

another laravel mongodb driver mongolid-laravel has same issue

MySQL hasOne relation to Mongo

I've never played with MongoDB before but this is really getting me into it. I'm using MySQL to store basic picture data such as filename, filesize etc, and MongoDB to store metadata which might be different for each picture (exif, ifd0) etc.

I've successfully got the MongoDB model set up and saving:

   $user = User::whereUsername('test_username')->first();
   $img = new Image();
   $img->filename = "hello.jpg";
   $img->save();

   $meta = new ImageMeta();
   $meta->exif_maker = "Canon";
   $meta->exif_model = "EOS 500D";
   $meta->save();

   $img->meta()->save($meta);

However when I try to get the metadata back from the image:

   echo $img->meta->exif_maker;

It returns NULL. Am I doing something wrong? If I look at the ImageMeta MongoDB model, I can see an image_id key which is populated with the image_id of the Image model.

Image relation:

$this->hasOne('ImageMeta');

ImageMeta relation:

$this->belongsTo('Image');

Image model table schema:

        Schema::create('images', function(Blueprint $table)
        {
            $table->increments('id');
            $table->string('filename');
            $table->integer('filesize');
            $table->string('hash');
            $table->string('hash_type');
            $table->integer('user_id');
            $table->timestamps();
        });

Any ideas?

Hi, Guys, when will you support upserts?

refer:
http://docs.mongodb.org/manual/core/update/#update-operations-with-the-upsert-flag

http://php.net/manual/en/mongocollection.update.php

Example #2 MongoCollection::update() upsert examples

Upserts can simplify code, as a single line can create the document if it does not exist (based on $criteria), or update an existing document if it matches.

In the following example, $new_object contains an atomic modifier. Since the collection is empty and upsert must insert a new document, it will apply those operations to the $criteria parameter in order to create the document.

drop(); $c->update( ``` array("uri" => "/summer_pics"), array('$inc' => array("page hits" => 1)), array("upsert" => true) ``` ); var_dump($c->findOne()); ?>

The above example will output something similar to:

array(3) {
["_id"]=>
object(MongoId)#9 (0) {
}
["uri"]=>
string(12) "/summer_pics"
["page hits"]=>
int(1)
}
If $new_object does not contain atomic modifiers (i.e. $ operators), upsert will use $new_object as-is for the new document. This matches the behavior of a normal update, where not using atomic modifiers causes the document to be overwritten.

drop(); $c->update( ``` array("name" => "joe"), array("username" => "joe312", "createdAt" => new MongoDate()), array("upsert" => true) ``` ); var_dump($c->findOne()); ?>

The above example will output something similar to:

array(3) {
["_id"]=>
object(MongoId)#10 (0) {
}
["username"]=>
string(6) "joe312"
["createdAt"]=>
object(MongoDate)#4 (0) {
}
}

Authentication Error

Hi

I am using different port and username|password . I get error
Failed to connect to: localhost:32759: Authentication failed
I am sure my username and password are correct . It connects fine via simple php mongoClient class.
Don't know why this happening.

After i reviewed source , it seems ok it should be passing password fine but its not connecting in laravel 4.

Changing primary key breaks getKey()

If I extend MongoDB Eloquent and set my own $primaryKey = 'myId', calling $this->getKey() returns null. However, I can access the key using $this->_id and not $this->myId. I think that the original primary key for some reason is not being re-declared in the extended class.

"Undefined index: result" - When calling Model aggregation methods

When I try to call any of the Model's aggregate functions (static calls to count, min, max, sum ...) I get this error message from the Builder.

image

In this example I have a simple class called Characters extending your base model, and its empty (no specialization code). Here is the logged output of the results array from the call to collection->aggregate()

(
    [errmsg] => no such cmd: aggregate
    [bad cmd] => Array
        (
            [aggregate] => characters
            [pipeline] => Array
                (
                    [0] => Array
                        (
                            [$group] => Array
                                (
                                    [_id] => 
                                    [*] => Array
                                        (
                                            [$sum] => 1
                                        )

                                )

                        )

                )

        )

    [ok] => 0
)

Strategies to test an application using Laravel-MongoDB

Hi,

Thanks for your module, it look very promising.
I'm pretty new to the testing world so I was just wondering how you would do integration tests on an application using your module.

Laravel tools like migration and seeding are not quite relevant with MongoDB.

What I would do is to set up a test db, flush it before each test, and then use something like https://github.com/Zizaco/factory-muff to populate my test db with some fake models.

What is your strategy on that matter ?

Many to many relations

Do you plan on adding many to many relation?

One way to achieve this is to keep an array of referenced objects in each entry. This would require two "inserts" for every change.

What do you think?

Soft-delete with orWhere doesn't return results

The following query yields many results:

$query = '%'.Input::get('q').'%';
return Contract::where('contractNumber', 'like', $query)->get();

But this query returns ZERO results...if anything, shouldn't it only return more results?

$query = '%'.Input::get('q').'%';
return Contract::where('contractNumber', 'like', $query)->orWhere('customerId', 'like', $query)->get();

"Contract" has $softDelete = 'true', and as soon as I turned that off, my orWhere clauses worked again

Invalid object ID

Don't know if it's a real issue or a feature needed, but there's some way to not throw an exception when a search doesn't find a object with the specified _id ?

Perhaps act like the mysql, returning an empty value if there isn't a object with the selected _id…

I'm doing this: MongoModel::where('_id',$data['_id'])->first();

Feature request: Multiple connections

Hi,

multiple mongdb connections from within one "mongodb" database connection definiton would be super-cool. The mongodb client library allows this:

mongodb://db1.example.net,db2.example.net:2500/?replicaSet=test

It would be really nice to have it configurable within the database.php:

    'mongodb' => array(
      'db1.example.net' => array(
        'host'     => 'db1.example.net',
        'port'     => 27017,
        'database' => 'example',     
      ),
      'db2.example.net' => array(
        'host'     => 'db2.example.net',
        'port'     => 27017,
        'database' => 'example',     
      )
    ),    

What do you think?

Unable to $push documents to array

I have a collection called "Contracts" with a field called "projects", which is an array of documents. Each document in the array would have an _id (a MongoID) and a 'projectName' (a string). I'm attempting to use the "push" function to append this array, but I cannot figure out how to add documents.

$projectId = new MongoId();
$test = DB::collection('Contracts')
            ->where('_id', $contractId)
            ->push('projects', array( '{ _id : '.$projectId.', projectName : <Project> }'));

The above code doesn't work, and I'm not sure how to do exactly what I'm trying to do. In addition, where I'm concatenating the $projectId, I really want that to be a new ObjectId.

How could I do this?
Thanks!

Raw queries

How would I convert this into a raw statement:

db.users.find ( { $or: [ { 'skills.Pascal': {$exists: true} }, { 'skills.Accounting': {$exists: true } } ] } )

Calling paginate() returns error

Doing User::paginate(1) generates stack trace:

[2013-07-29 08:36:57] log.ERROR: exception 'ErrorException' with message 'Undefined index: result' in /var/www/leaf.dev/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Builder.php:129
Stack trace:
#0 /var/www/leaf.dev/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Builder.php(129): Illuminate\Exception\Handler->handleError(8, 'Undefined index...', '/var/www/leaf.d...', 129, Array)
#1 /var/www/leaf.dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(943): Jenssegers\Mongodb\Builder->getFresh(Array)
#2 /var/www/leaf.dev/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Builder.php(192): Illuminate\Database\Query\Builder->get(Array)
#3 /var/www/leaf.dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1225): Jenssegers\Mongodb\Builder->aggregate('count', Array)
#4 /var/www/leaf.dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1195): Illuminate\Database\Query\Builder->count()
#5 /var/www/leaf.dev/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(213): Illuminate\Database\Query\Builder->getPaginationCount()
#6 /var/www/leaf.dev/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(184): Illuminate\Database\Eloquent\Builder->ungroupedPaginate(Object(Illuminate\Pagination\Environment), 20, Array)
#7 /var/www/leaf.dev/app/library/ArticleAPI.php(99): Illuminate\Database\Eloquent\Builder->paginate(20)
#8 /var/www/leaf.dev/app/controllers/ArticleController.php(36): app\library\ArticleAPI->latestArticles()
#9 [internal function]: ArticleController->getLatestArticles()
#10 /var/www/leaf.dev/vendor/laravel/framework/src/Illuminate/Routing/Controllers/Controller.php(138): call_user_func_array(Array, Array)
#11 /var/www/leaf.dev/vendor/laravel/framework/src/Illuminate/Routing/Controllers/Controller.php(115): Illuminate\Routing\Controllers\Controller->callMethod('getLatestArticl...', Array)
#12 /var/www/leaf.dev/bootstrap/compiled.php(4768): Illuminate\Routing\Controllers\Controller->callAction(Object(Illuminate\Foundation\Application), Object(Illuminate\Routing\Router), 'getLatestArticl...', Array)
#13 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#14 /var/www/leaf.dev/bootstrap/compiled.php(7838): call_user_func_array(Object(Closure), Array)
#15 /var/www/leaf.dev/bootstrap/compiled.php(7825): Illuminate\Routing\Route->callCallable()
#16 /var/www/leaf.dev/bootstrap/compiled.php(4779): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#17 /var/www/leaf.dev/bootstrap/compiled.php(483): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#18 /var/www/leaf.dev/bootstrap/compiled.php(472): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#19 /var/www/leaf.dev/public/index.php(49): Illuminate\Foundation\Application->run()
#20 {main} [] []

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.