├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── composer.json
├── preview-classic.png
├── preview-dark-mode.png
└── src
├── Controllers
├── TodoBarController.php
├── TodoBarProjects.php
└── TodoBarTasks.php
├── Facade
└── TodoBar.php
├── Middleware
└── TodoBarMiddleware.php
├── Storage
├── DataStorageInterface.php
└── JSONStorage.php
├── TodoBarMiddleware.php
├── TodoBarServiceProvider.php
├── assets
├── loader.gif
├── todobar-dark.css
├── todobar.css
└── todobar.js
├── config
└── todobar.php
├── resources
└── views
│ ├── partials
│ ├── form.blade.php
│ ├── handle.blade.php
│ ├── projects.blade.php
│ └── tasks.blade.php
│ └── todobar.blade.php
└── routes
└── web.php
/.gitignore:
--------------------------------------------------------------------------------
1 | vendor/
2 | composer.lock
3 | phpunit.xml
4 | node_modules/
5 | .idea
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 | php:
3 | - "7.2"
4 | before_script:
5 | - composer self-update
6 | - composer install --prefer-source
7 |
8 | script:
9 | - ./vendor/bin/phpcs --standard=PSR2 src
10 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Jefferson Ochoa and contributors
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Laravel TodoBar
2 |
3 | [](https://packagist.org/packages/tpaksu/laravel-todobar) [](https://packagist.org/packages/tpaksu/laravel-todobar) [](https://packagist.org/packages/tpaksu/laravel-todobar)
4 | [](https://packagist.org/packages/tpaksu/laravel-todobar) [](https://scrutinizer-ci.com/g/tpaksu/laravel-todobar/?branch=master)
5 | [](https://scrutinizer-ci.com/code-intelligence)
6 | [](https://lgtm.com/projects/g/tpaksu/laravel-todobar/context:javascript)
7 |
8 | TodoBar creates an overlay right sidebar to ease your Laravel projects task management.
9 |
10 | - It stores the tasks in a JSON file which is located in `/resources/todobar` folder, which is shared among your code in your repository, so you can get the tasks on every platform that you are developing your project.
11 |
12 | - It supports multiple groups, which you can use to track different aspects of your project in a single file, and you can easily switch between groups with a single dropdown.
13 |
14 | - It uses Bootstrap components as the frontend library, and for the "Edit Task" modal.
15 |
16 |
17 | ## Preview
18 | *Classic Mode*
19 |
20 | 
21 |
22 | *Dark Mode*
23 |
24 | 
25 |
26 |
27 |
28 |
29 | ## Installation
30 | You can install the package via composer with:
31 |
32 | ```
33 | composer require tpaksu/laravel-todobar --dev
34 | ```
35 |
36 | The sidebar will be enabled by default, but you can disable it by adding
37 |
38 | TODOBAR_ENABLED=false
39 |
40 | to your environment variables and run `php artisan config:cache` to update the configuration cache.
41 |
42 |
43 |
44 | ## Package Contents
45 |
46 | This package publishes the views used in the package and a configuration file which consists of three settings:
47 |
48 | - **enabled**: Enables the sidebar by setting the environment variable (`TODOBAR_ENABLED`) in your `.env` file, or by changing the default value when the environment value is missing.
49 |
50 | - **start_visible**: Defines the visibility on page load, if you set it to true, the sidebar will be shown on page load.
51 |
52 | - **overlay**: Defines if the sidebar will cover some part of the web page (overlay), or shrink the page and display the whole page besides itself.
53 |
54 | The views used and published by this package:
55 |
56 | + resources/views/vendor/tpaksu/todobar
57 | +-- partials
58 | | +-- form.blade.php
59 | | |-- handle.blade.php
60 | | |-- projects.blade.php
61 | | +-- tasks blade.php
62 | +-- todobar.blade.php
63 |
64 |
65 | ## Extending
66 |
67 | The package contains a `Storage` folder which contains an interface `DataStorageInterface` defining the data storage provider repository, and an example `JSONStorage` class which handles the data persisting in JSON file. If you want to use something different than a JSON file to store your tasks, you can create a class implementing `DataStorageInterface` and make the package use that instead by changing the configuration like this:
68 |
69 | ```php
70 | "storage" => [
71 | "engine" => \App\TodoBar\CustomStorage::class,
72 | "params" => [
73 | "param" => "[ Passed to your class ]",
74 | ],
75 | ],
76 | ```
77 |
78 |
79 |
80 | ## Contributing
81 |
82 | You are always welcome to send pull requests to this package. Please describe why and what changed in the code, so I can approve them quickly.
83 |
84 |
85 | ## Security
86 | If you discover any security related issues, please email tpaksu@gmail.com directly instead of using the issue tracker.
87 |
88 |
89 | ## License
90 | The MIT License (MIT).
91 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tpaksu/laravel-todobar",
3 | "description": "A simple todo list drawer for development tasks listing",
4 | "type": "library",
5 | "license": "MIT",
6 | "authors": [
7 | {
8 | "name": "Taha Paksu",
9 | "email": "tpaksu@gmail.com"
10 | }
11 | ],
12 | "autoload": {
13 | "psr-4": {
14 | "TPaksu\\TodoBar\\": "src/"
15 | }
16 | },
17 | "autoload-dev": {
18 | "psr-4": {
19 | "TPaksu\\TodoBar\\Tests\\": "tests/"
20 | }
21 | },
22 | "require": {},
23 | "extra": {
24 | "laravel": {
25 | "providers": [
26 | "TPaksu\\TodoBar\\TodoBarServiceProvider"
27 | ],
28 | "aliases": {
29 | "TodoBar": "TPaksu\\TodoBar\\Facade"
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/preview-classic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tpaksu/laravel-todobar/3ad955ac047c3cc6ed1e2fd400dd960f6de85016/preview-classic.png
--------------------------------------------------------------------------------
/preview-dark-mode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tpaksu/laravel-todobar/3ad955ac047c3cc6ed1e2fd400dd960f6de85016/preview-dark-mode.png
--------------------------------------------------------------------------------
/src/Controllers/TodoBarController.php:
--------------------------------------------------------------------------------
1 | " . file_get_contents($this->assets_path("todobar.js")) . "";
13 | }
14 |
15 | public function getDrawer() {
16 | return View::make("laravel-todobar::todobar");
17 | }
18 |
19 | public function getStyles() {
20 | $dark_mode = config("todobar.dark_mode", false);
21 | $file = "todobar.css";
22 | if ($dark_mode) {
23 | $file = "todobar-dark.css";
24 | }
25 | $path = $this->assets_path($file);
26 | return "";
27 | }
28 |
29 | public function getInjection()
30 | {
31 | return $this->getStyles() . $this->getDrawer() . $this->getScripts();
32 | }
33 |
34 | public function inject(Response $response) {
35 | $response->setContent(str_replace("