Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FileHandling
- {
- public function __construct($request, $file) {
- $this->file = $request->file($file);
- }
- public function get_file_info() {
- return pathinfo($this->file->getClientOriginalName());
- }
- public function get_file() {
- return $this->file;
- }
- public function move_file($destination) {
- $this->file->move($destination , $this->get_file_info()['basename']);
- }
- }
Add Comment
Please, Sign In to add comment