Skip to content

Instantly share code, notes, and snippets.

@AdrianoBiolchi
Created February 28, 2018 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdrianoBiolchi/4756d04977ab98d1884f1419494f5b1d to your computer and use it in GitHub Desktop.
Save AdrianoBiolchi/4756d04977ab98d1884f1419494f5b1d to your computer and use it in GitHub Desktop.
public function store (Request $ request)
    {
        $ detail = $ request-> summernoteInput;
        $ summernote = new Summernote;
        $ summernote-> title = $ request-> input ('title');
        $ summernote-> subtitle = $ request-> input ('subtitle');
        if ($ file = $ request-> hasFile ('imagePost')) {
            $ file = $ request-> file ('imagePost');
            $ fileName = time (). '-'. $ file-> getClientOriginalName ();
            $ destinationPath = public_path (). '/ upload / post_blog';
            $ file-> move ($ destinationPath, $ fileName);
            $ summernote-> imagePost = $ fileName;
        }
        $ summernote-> content = $ detail;
        $ summernote-> save ();
        Session :: flash ('flash_message', 'Success!', 'Close');
        return redirect () -> route ('admin / posts / show');
    }
@oukha
Copy link

oukha commented Jan 7, 2019

[_****_](

@1. url

)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment