Skip to content

Instantly share code, notes, and snippets.

@that0n3guy
Last active August 29, 2015 14:05
Show Gist options
  • Save that0n3guy/151fc54f7e0db8893ab7 to your computer and use it in GitHub Desktop.
Save that0n3guy/151fc54f7e0db8893ab7 to your computer and use it in GitHub Desktop.
bauhaus issues for #21
//----------------- error
Symfony\Component\Debug\Exception\FatalErrorException thrown with message "Class 'diquoterequests' not found"
Stacktrace:
#1 Symfony\Component\Debug\Exception\FatalErrorException in C:\xamppPHP5.4\htdocs\diqc-laravel\vendor\krafthaus\bauhaus\src\KraftHaus\Bauhaus\Field\HasManyField.php:36
#0 Illuminate\Exception\Handler:handleShutdown in <#unknown>:0
(copied from error)
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR)
Class 'diquoterequests' not found
Open: C:\xamppPHP5.4\htdocs\diqc-laravel\vendor\krafthaus\bauhaus\src\KraftHaus\Bauhaus\Field\HasManyField.php
* @return mixed|string
*/
public function render()
{
switch ($this->getContext()) {
case BaseField::CONTEXT_LIST:
$model = $this->getName();
$primaryKey = (new $model)->getKeyName();
$values = [];
//---------- my contact model:
<?php
use Jenssegers\Mongodb\Model as Moloquent;
class Contact extends Moloquent
{
protected $connection = 'mongodb';
protected $collection = 'contacts';
//protected $fillable = [];
protected $guarded = [];
public function diquoterequests()
{
return $this->hasMany('Diquoterequest');
}
//---------- my contactadmin:
<?php
use KraftHaus\Bauhaus\Admin;
class ContactAdmin extends Admin
{
public function configureList($mapper)
{
$mapper->identifier('fullname')->label("Name");
$mapper->string('email')->label('email');
$mapper->hasMany('diquoterequests') // you can see this is plural
->display('email')
->label('Quote Requests');
}
public function configureForm($mapper)
{
$mapper->text('firstname')->label('First Name');
$mapper->text('lastname')->label('Last Name');
$mapper->text('email')->label('Email Name');
}
public function configureFilters($mapper)
{
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment