Created
February 28, 2018 04:59
-
-
Save AdrianoBiolchi/4756d04977ab98d1884f1419494f5b1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@1. url
)