Comments (7)
Thanks! I'll look into it. In the meantime I switched to your default crud package. Works very well in my current project.
from pagemanager.
Do you have "extras" in your $fillable property, on the model?
PS. For development questions (non-bugs), it's recommended that you post on Stack Overflow (using the backpack-for-laravel
tag) or Gitter, after you're sure you can't solve the problem yourself and there isn't an answer to that already. There are a lot more people on Gitter and StackOverflow. Plus:
- on StackOverflow people are rewarded with points for helping you out;
- on StackOverflow your conversation will be better indexed by search engines;
- for super-urgent issues, nothing beats a chatroom, like Gitter; if anyone's online, of course;
- we can keep the Github Issues only for bugs that affect everyone, so we can crush them faster;
If you want to help people out with development question, that would be a HUGE help for the project. You can answer people:
- synchronously - by leaving your Gitter app open;
- asynchronously - by adding a StackOverflow filter for the
backpack-for-laravel
tag to receive questions by email;
Answering questions improves communication skills, makes you better understand the inner workings and improves your self-esteem. Just sayin' :-)
from pagemanager.
Sorry for poor informations :'( But only the extras field (default) are saved not the field I've added in PageTemplates trait
from pagemanager.
You should also add those to the $fillable array if you want them saved.
from pagemanager.
So far I like Backpack a lot! Nice work.
I tried this as well by extending Backpack\PageManager\app\Models\Page and adding my own fillable properties but that does not seem to work. Is there any way of adding to the fillable property without adding it to the model in the vendor directory?
from pagemanager.
Hi @de-raaf-media ,
For changing the Page model you should create the following files, that extend the ones in vendor:
- app/Models/Page.php
- app/Http/Controllers/Admin/PageCrudController.php - make this one use your model above
Your PageCrudController should look something like this:
<?php namespace App\Http\Controllers\Admin;
use Backpack\CRUD\app\Http\Controllers\CrudController;
use Backpack\PageManager\app\Http\Controllers\Admin\PageCrudController as OriginalPageCrudController;
use App\PageTemplates;
// VALIDATION: change the requests to match your own file names if you need form validation
use Backpack\PageManager\app\Http\Requests\PageRequest as StoreRequest;
use Backpack\PageManager\app\Http\Requests\PageRequest as UpdateRequest;
class PageCrudController extends OriginalPageCrudController {
public function __construct($template_name = false)
{
/*
|--------------------------------------------------------------------------
| BASIC CRUD INFORMATION
|--------------------------------------------------------------------------
*/
$this->crud->setModel("App\Models\Page");
$this->crud->setRoute(config('backpack.base.route_prefix').'/page');
$this->crud->setEntityNameStrings('page', 'pages');
/*
|--------------------------------------------------------------------------
| COLUMNS
|--------------------------------------------------------------------------
*/
$this->crud->addColumn('name');
$this->crud->addColumn([
'name' => 'template',
'type' => 'model_function',
'function_name' => 'getTemplateName',
]);
$this->crud->addColumn('slug');
/*
|--------------------------------------------------------------------------
| FIELDS
|--------------------------------------------------------------------------
*/
// In PageManager,
// - default fields, that all templates are using, are set using $this->addDefaultPageFields();
// - template-specific fields are set per-template, in the PageTemplates trait;
/*
|--------------------------------------------------------------------------
| BUTTONS
|--------------------------------------------------------------------------
*/
$this->crud->addButtonFromModelFunction('line', 'open', 'getOpenButton', 'beginning');
}
}
Cheers!
from pagemanager.
Still not able to override fillable fields. I now use the "extra" column for storing an image. And actually that is working fine.
from pagemanager.
Related Issues (20)
- Target class [PageController] does not exist. HOT 4
- Unable to install via Composer: code error leading to post-autoload-dump event error HOT 6
- Error : Declaration of ... Page::sluggable() must be compatible with Cviebrock\EloquentSluggable\Sluggable::sluggable(): array HOT 4
- [Bug] visibility: hidden ckeditor and Wysiwyg HOT 11
- reorder items inside the repeatable field HOT 1
- None of the views in the given array exist HOT 6
- the wisywig fieldtype doensn't exist in the backpack v5.0 HOT 2
- Own Controller or Model not used by PageManager HOT 3
- Doesn't work with no wysiwyg field HOT 3
- [Bug] select_page_template field cannot be used multiple times HOT 1
- Version control when editing a page HOT 2
- support for translation / multiple language HOT 5
- Nested pages? HOT 6
- Upload field not working with Backpack v6 using new uploader HOT 11
- Upload File Validation HOT 2
- Unknown database type bit requested, Doctrine\DBAL\Platforms\MySQL80Platform may not support it. HOT 6
- how to get fake column value HOT 1
- Errors while upgrading from 3.6 to 4.0 HOT 2
- PHP Fatal error: Trait 'App\PageTemplates' not found in HOT 2
- Not installing Laravel 5.8 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pagemanager.