Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Themes
- id - integer
- composer_package - string
- name - string
- Plugins
- id - integer
- composer_package - string
- name - string
- Products
- id - integer
- name - string
- ...
- productable_id - integer
- productable_type - string
- public function store(Request $request)
- {
- $selectedTheme = null;
- foreach($request->input('theme') as $key => $value) {
- if($value === 'selected') {
- $selectedTheme = $key;
- }
- }
- $theme = Product::find($selectedTheme);
- foreach($this->predefinedArray as $value) {
- $request->session()->put('chosen_theme.' . $value, $theme->$value);
- }
- $data = $request->session()->all();
- return redirect('plugins');
- }
- public function productable()
- {
- return $this->morphTo();
- }
- public function order_items()
- {
- return $this->hasMany(Orderitems::class);
- }
- public function webshops()
- {
- return $this->hasMany(Webshop::class);
- }
- public function products()
- {
- return $this->morphMany(Product::class, 'productable');
- }
Add Comment
Please, Sign In to add comment