diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a76df1c --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 skydiver + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..f1eae67 --- /dev/null +++ b/README.md @@ -0,0 +1,124 @@ +# laravel-materialize-css +Materialize CSS Framework for Laravel 5 [http://materializecss.com/] + + + +## Installation + +* Require this package in your composer.json and run composer update. +``` + "mskydiver/laravel-materialize-css": "dev-master" +``` + +* After updating composer, add the ServiceProvider to the providers array in config/app.php +```php + 'Skydiver\LaravelMaterializeCSS\MaterializeCSSServiceProvider', +``` + +* Then publish the package's assets to public folder: +``` + $ php artisan vendor:publish --tag=materializecss --force +``` + + + +## Updates +You can re-publish the assets automatically when composer updated the package: + +* In your composer.json, go to **scripts** > **post-update-cmd** section, add the next line: +``` + "php artisan vendor:publish --tag=materializecss --force" +``` + +* The code will look similar to: +``` + "post-update-cmd": [ + "php artisan optimize", + "php artisan vendor:publish --tag=materializecss --force" + ], +``` + + + +## Usage + +There are differents methods to include Materialize CSS assets: + +* **include_full()** +```php + {!! MaterializeCSS::include_full() !!} +``` +```html + + + +``` + +* **include_all()** +```php + {!! MaterializeCSS::include_all() !!} +``` +```html + + +``` + +* **include_css()** +```php + {!! MaterializeCSS::include_css() !!} +``` +```html + +``` + +* **include_js()** +```php + {!! MaterializeCSS::include_js() !!} +``` +```html + +``` + +* **include_secure_css()** +```php + {!! MaterializeCSS::include_secure_css() !!} +``` +```html + +``` + +* **include_secure_js()** +```php + {!! MaterializeCSS::include_secure_js() !!} +``` +```html + +``` + +* **get_url_css($full=false, $secure=false)** +```php + {!! MaterializeCSS::get_url_css() !!} + {!! MaterializeCSS::get_url_css(true, false) !!} + {!! MaterializeCSS::get_url_css(false, true) !!} + {!! MaterializeCSS::get_url_css(true, true) !!} +``` +```html + /materialize-css/css/materialize.min.css + http://yourdomain.com/materialize-css/css/materialize.min.css + /materialize-css/css/materialize.min.css + https://yourdomain.com/materialize-css/css/materialize.min.css +``` + +* **get_url_js($full=false, $secure=false)** +```php + {!! MaterializeCSS::get_url_js() !!} + {!! MaterializeCSS::get_url_js(true, false) !!} + {!! MaterializeCSS::get_url_js(false, true) !!} + {!! MaterializeCSS::get_url_js(true, true) !!} +``` +```html + /materialize-css/js/materialize.min.js + http://yourdomain.com/materialize-css/js/materialize.min.js + /materialize-css/js/materialize.min.js + https://yourdomain.com/materialize-css/js/materialize.min.js +``` \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100755 index 0000000..2a3253e --- /dev/null +++ b/composer.json @@ -0,0 +1,22 @@ +{ + "name": "skydiver/laravel-materialize-css", + "description": "Add Materialize CSS Framework to Laravel", + "keywords": ["Materialize", "CSS", "Material Design", "laravel", "CSS Framework"], + "license": "MIT", + "require": { + "php": ">=5.4.0", + "illuminate/support": "5.*" + }, + "authors": [ + { + "name": "Martin", + "email": "martin@flydev.com" + } + ], + "autoload": { + "psr-4": { + "Skydiver\\LaravelMaterializeCSS\\": "src/" + } + }, + "minimum-stability": "dev" +} \ No newline at end of file diff --git a/src/MaterializeCSSBuilder.php b/src/MaterializeCSSBuilder.php new file mode 100755 index 0000000..f8377ac --- /dev/null +++ b/src/MaterializeCSSBuilder.php @@ -0,0 +1,83 @@ +'; + } + + private static function tag_js($path) { + return ''; + } + + + + + + + + + + + + } + +?> \ No newline at end of file diff --git a/src/MaterializeCSSFacade.php b/src/MaterializeCSSFacade.php new file mode 100644 index 0000000..4f1eb64 --- /dev/null +++ b/src/MaterializeCSSFacade.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/src/MaterializeCSSServiceProvider.php b/src/MaterializeCSSServiceProvider.php new file mode 100644 index 0000000..3546dd4 --- /dev/null +++ b/src/MaterializeCSSServiceProvider.php @@ -0,0 +1,31 @@ +publishes([ + __DIR__.'/../assets' => public_path('materialize-css'), + ], 'materializecss'); + $this->registerMaterializeCSSBuilder(); + $this->app->alias('materialize-css', 'Skydiver\LaravelMaterializeCSS\MaterializeCSSBuilder'); + } + + protected function registerMaterializeCSSBuilder() { + $this->app->bindShared('materialize-css', function($app) { + return new MaterializeCSSBuilder($app['url']); + }); + } + + public function provides() { + return array('materialize-css'); + } + + } + +?> \ No newline at end of file