{"id":15641989,"url":"https://github.com/petehouston/laravel-tinymce-simple-imageupload","last_synced_at":"2025-04-07T06:08:03.334Z","repository":{"id":10684872,"uuid":"66624155","full_name":"petehouston/laravel-tinymce-simple-imageupload","owner":"petehouston","description":"Simple image upload for TinyMCE in Laravel.","archived":false,"fork":false,"pushed_at":"2024-07-10T20:36:28.000Z","size":36,"stargazers_count":69,"open_issues_count":10,"forks_count":24,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-12-20T21:40:43.237Z","etag":null,"topics":["hacktoberfest","laravel","laravel-tinymce","tinymce","tinymce-editor"],"latest_commit_sha":null,"homepage":"","language":"Blade","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/petehouston.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-26T06:54:04.000Z","updated_at":"2024-07-10T20:46:53.000Z","dependencies_parsed_at":"2024-11-14T09:01:28.391Z","dependency_job_id":"cdc9513b-810e-44a3-869b-248dc939ab4b","html_url":"https://github.com/petehouston/laravel-tinymce-simple-imageupload","commit_stats":{"total_commits":27,"total_committers":7,"mean_commits":3.857142857142857,"dds":0.4444444444444444,"last_synced_commit":"8f8f8c6efb5ff05d849d964a3bf6a1029d0ce1e4"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petehouston%2Flaravel-tinymce-simple-imageupload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petehouston%2Flaravel-tinymce-simple-imageupload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petehouston%2Flaravel-tinymce-simple-imageupload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petehouston%2Flaravel-tinymce-simple-imageupload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petehouston","download_url":"https://codeload.github.com/petehouston/laravel-tinymce-simple-imageupload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","laravel","laravel-tinymce","tinymce","tinymce-editor"],"created_at":"2024-10-03T11:53:15.169Z","updated_at":"2025-04-07T06:08:03.301Z","avatar_url":"https://github.com/petehouston.png","language":"Blade","funding_links":[],"categories":[],"sub_categories":[],"readme":"# laravel-tinymce-simple-imageupload\n\nThe simple image upload for TinyMCE in Laravel.\n\n## Why made this?\n\nBecause, I use TinyMCE and basically, it is pretty hard to understand how to upload images directly to the editor while editing content. There are many TinyMCE image uploaders out there, but they are too complicated in functions, and I only need one core use-case, **pick up an image to upload**.\n\nThat's it, so I create this package for my projects to re-use. Well, if you want, you can use this too.\n\n**This package works with Laravel 5.0+.**\n\n\n## Installation\n\nFor Laravel 5.5+:\n\n```\n$ composer require \"petehouston/laravel-tinymce-simple-imageupload:~1.3\"\n```\n\nFor Laravel before 5.5:\n\n```\n$ composer require \"petehouston/laravel-tinymce-simple-imageupload:~1.1\"\n```\n\nFor laravel version 5.4 and older, you need to register the service provider in  `config/app.php`.\n\n```\n    'providers' =\u003e [\n        ...\n\n        Petehouston\\Tinymce\\TinymceServiceProvider::class,\n\n    ]\n```\n\n## Usage\n\nIn the view that contain setup for TinyMCE, you need to include the upload view, add this line at the bottom,\n\n```\n@include('mceImageUpload::upload_form')\n```\n\nDon't worry, this form is hidden from your view, no-one will see it because it is `display: none`.\n\nNext step is to add this config to the `tinymce` object,\n\n```\n    tinymce.init({\n        // .. your config here\n        relative_urls: false,\n        file_browser_callback: function(field_name, url, type, win) {\n            // trigger file upload form\n            if (type == 'image') $('#formUpload input').click();\n        }\n    });\n```\n\nThat's all, now you should be able to upload image directly to the editor while writing content.\n\n**You can publish view in case you need to customize in `resources/views` directory**\n\n```\n$ php artisan vendor:publish --provider=Petehouston\\Tinymce\\TinymceServiceProvider\n```\n\n### Try example\n\nThere is a setup example in the package, you can try in your project by adding a sample route,\n\n```\nRoute::get('/tinymce_example', function () {\n    return view('mceImageUpload::example');\n});\n```\n\n### Some notes\n\n**The image upload handler**\n\nI setup already a controller [`Petehouston\\Tinymce\\TinymceController`](https://github.com/petehouston/laravel-tinymce-simple-imageupload/blob/master/src/TinymceController.php) which implements a method for image uploading.\n\nAs you can see it will store all uploaded images in `public/img` directory, the name is like a concatenated hash,\n\n```\n$filename = 'image_'.time().'_'.$image-\u003ehashName();\n```\n\nThe default route for handling image upload is `/tinymce/simple-image-upload`.\n\n**Customize upload url and controller**\n\nIf you don't want to pre-config of the package, make yours.\n\nWhile including the uploading form, pass in the url of handling post image upload\n\n```\n@include('mceImageUpload::upload_form', ['upload_url' =\u003e 'YOUR_URL_FOR_HANDLING_IMAGE_UPLOAD'])\n```\n\nAdd a method for handling image upload that **should return the same result** as in [`Petehouston\\Tinymce\\TinymceController`](https://github.com/petehouston/laravel-tinymce-simple-imageupload/blob/master/src/TinymceController.php).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetehouston%2Flaravel-tinymce-simple-imageupload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetehouston%2Flaravel-tinymce-simple-imageupload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetehouston%2Flaravel-tinymce-simple-imageupload/lists"}