I'm in the same boat... I have been looking at two possible packages to use...
I'm thinking of going with doctrine, even if it's a beta, just because it's a bigger project, and I have heard more about it. And if we want to add more types of databases in the future to store specific data, using doctrine will probably make it easier to work with.
Hi,
I have used https://github.com/navruzm/lmongo and it was ok. I actually built with it a CRUD using bootstrap . ( I don't have the code on github) . I have also used https://github.com/navruzm/laravel-mongo-auth for the Auth.
I would stay way from doctrine2 .
https://packagist.org/packages/jenssegers/mongodb is the best. combined with way generators and you will get your laravel app with mongodb up and running in no time, using the usual eloquent methods. Laravel Auth works great too.
@infinityfish: I am also using the jenssegers/mongodb package. Were you able to get it working well with Form Model binding? I am having a hard time getting nested and array style fields to work.
For example, if I have a form setup like this:
{{ Form::model($model) }}
{{ Form::text('name') }}
{{ Form::select('specialty[0]', array('laravel' => 'Laravel', 'cake' => 'CakePHP', 'zend' => 'Zend Framework', 'none' => 'None')) }}
{{ Form::select('specialty[1]', array('laravel' => 'Laravel', 'cake' => 'CakePHP', 'zend' => 'Zend Framework', 'none' => 'None')) }}
{{ Form::select('specialty[2]', array('laravel' => 'Laravel', 'cake' => 'CakePHP', 'zend' => 'Zend Framework', 'none' => 'None')) }}
{{ Form::close() }}
When this gets saved to MongoDB, it is saved to the collection just fine. We get an object that liiks like this:
{
"_id": ObjectId('....'),
"name": "Adam Duro",
"specialty": ["laravel", "cake", "zend"],
}
However, when I return to the page, the select boxes are set back to their default states, and the model data is not displayed.
Is there something wrong with how I am implementing my Form Model Binding in the view?
AD
duro said:
@infinityfish: I am also using the jenssegers/mongodb package. Were you able to get it working well with Form Model binding? I am having a hard time getting nested and array style fields to work.
For example, if I have a form setup like this:
{{ Form::model($model) }} {{ Form::text('name') }} {{ Form::select('specialty[0]', array('laravel' => 'Laravel', 'cake' => 'CakePHP', 'zend' => 'Zend Framework', 'none' => 'None')) }} {{ Form::select('specialty[1]', array('laravel' => 'Laravel', 'cake' => 'CakePHP', 'zend' => 'Zend Framework', 'none' => 'None')) }} {{ Form::select('specialty[2]', array('laravel' => 'Laravel', 'cake' => 'CakePHP', 'zend' => 'Zend Framework', 'none' => 'None')) }} {{ Form::close() }}
When this gets saved to MongoDB, it is saved to the collection just fine. We get an object that liiks like this:
{ "_id": ObjectId('....'), "name": "Adam Duro", "specialty": ["laravel", "cake", "zend"], }
However, when I return to the page, the select boxes are set back to their default states, and the model data is not displayed.
Is there something wrong with how I am implementing my Form Model Binding in the view?
AD
What are you trying to get instead of simple array? For the code you provided this is totally ok result.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community