Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create dynamic table row inserting through shortcodes #72

Open
VeshGrg opened this issue Mar 6, 2022 · 0 comments
Open

create dynamic table row inserting through shortcodes #72

VeshGrg opened this issue Mar 6, 2022 · 0 comments

Comments

@VeshGrg
Copy link

VeshGrg commented Mar 6, 2022

I'm trying to insert a table row/s dynamically through form by shortcodes functionality.
shortcode : [post id="1,2,3"]
I'm trying to insert table 'post' with id=['1', '2', '3'] rows with my form data.
I have created a new shortcode called InsertAddShortcode and and register it in boot method of ShortcodeServiceProvider.
I have made register method inside InsertAddShortcode.php

public function register($shortcode, $content, $compiler, $name, $viewData)
    {
             $query = $shortcode->table::find($shortcode->id);
            return sprintf($shortcode->table=$query, $shortcode->id= $query->id, $shortcode->class, $content);
    }

but it show error: Class name must be a valid object or a string.

I'm stuck in this process.
Any advice, solution would be highly appreciated.
Thanks in advance!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant