├── .gitignore ├── README.md ├── composer.json └── src ├── SkeletonPreset.php ├── SkeletonPresetServiceProvider.php └── skeleton-stubs ├── Controllers └── HomeController.php ├── _settings.scss ├── app.scss ├── bootstrap.js ├── skeleton.scss └── views ├── auth ├── login.blade.php ├── passwords │ ├── email.blade.php │ └── reset.blade.php └── register.blade.php ├── home.blade.php ├── layouts └── app.blade.php └── welcome.blade.php /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | composer.phar 3 | composer.lock 4 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Use this repo as a skeleton for your new preset, once you're done please open an issue on [this repo](https://github.com/laravel-frontend-presets/internals). 2 | 3 | Here's the latest documentation on Laravel 5.5: 4 | 5 | https://laravel.com/docs/master/ 6 | 7 | # A Boilerplate repo for presets 8 | 9 | This package makes it easy to use [:preset-name](:link-to-website) with Laravel 5.5+. 10 | 11 | **Note:** Replace ```:preset-name```, ```:link-to-website```, ```:author-name``` and ```:author-username``` on this file, and then delete this line. 12 | 13 | **Note:** Make sure you replace all the instances of the word ```skeleton``` or ```Skeleton``` on this file, the `composer.json` file and on the `src/` folder, and to rename the files. You can delete this line after. 14 | 15 | This is where your description should go. Add a little code example so build can understand real quick how the package can be used. Try and limit it to a paragraph or two. 16 | 17 | 18 | 19 | ## Contents 20 | 21 | - [Installation](#installation) 22 | - [Usage](#usage) 23 | - [Contributing](#contributing) 24 | - [Credits](#credits) 25 | - [License](#license) 26 | 27 | 28 | ## Installation 29 | 30 | To install this preset on your laravel application, simply run: 31 | 32 | ``` bash 33 | composer require laravel-frontend-presets/skeleton 34 | ``` 35 | 36 | ## Contributing 37 | 38 | Please check our contributing rules in [our website](https://laravel-frontend-presets.github.io) for details. 39 | 40 | ## Credits 41 | 42 | - [:author_name](https://github.com/:author_username) 43 | - [All Contributors](../../contributors) 44 | 45 | ## License 46 | 47 | The MIT License (MIT). 48 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel-frontend-presets/skeleton", 3 | "description": "Laravel 5.5.x Front-end preset for skeleton", 4 | "keywords": ["laravel", "preset", "skeleton"], 5 | "license": "MIT", 6 | "require": { 7 | "laravel/framework": "5.5.*" 8 | }, 9 | "autoload": { 10 | "psr-4": { 11 | "LaravelFrontendPresets\\SkeletonPreset\\": "src/" 12 | } 13 | }, 14 | "extra": { 15 | "laravel": { 16 | "providers": [ 17 | "LaravelFrontendPresets\\SkeletonPreset\\SkeletonPresetServiceProvider" 18 | ] 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/SkeletonPreset.php: -------------------------------------------------------------------------------- 1 | '^version']; 44 | // packages to remove from the package.json 45 | $packagesToRemove = ['package-name' => '^version']; 46 | return $packagesToAdd + Arr::except($packages, $packagesToRemove); 47 | } 48 | 49 | /** 50 | * Update the Sass files for the application. 51 | * 52 | * @return void 53 | */ 54 | protected static function updateSass() 55 | { 56 | // clean up all the files in the sass folder 57 | $orphan_sass_files = glob(resource_path('/assets/sass/*.*')); 58 | 59 | foreach($orphan_sass_files as $sass_file) 60 | { 61 | (new Filesystem)->delete($sass_file); 62 | } 63 | 64 | // copy files from the stubs folder 65 | copy(__DIR__.'/skeleton-stubs/app.scss', resource_path('assets/sass/app.scss')); 66 | } 67 | 68 | /** 69 | * Update the bootstrapping files. 70 | * 71 | * @return void 72 | */ 73 | protected static function updateBootstrapping() 74 | { 75 | // remove exisiting bootstrap.js file 76 | (new Filesystem)->delete( 77 | resource_path('assets/js/bootstrap.js') 78 | ); 79 | 80 | // copy a new bootstrap.js file from your stubs folder 81 | copy(__DIR__.'/skeleton-stubs/bootstrap.js', resource_path('assets/js/bootstrap.js')); 82 | } 83 | 84 | /** 85 | * Update the default welcome page file. 86 | * 87 | * @return void 88 | */ 89 | protected static function updateWelcomePage() 90 | { 91 | // remove default welcome page 92 | (new Filesystem)->delete( 93 | resource_path('views/welcome.blade.php') 94 | ); 95 | 96 | // copy new one from your stubs folder 97 | copy(__DIR__.'/skeleton-stubs/views/welcome.blade.php', resource_path('views/welcome.blade.php')); 98 | } 99 | 100 | /** 101 | * Copy Auth view templates. 102 | * 103 | * @return void 104 | */ 105 | protected static function addAuthTemplates() 106 | { 107 | // Add Home controller 108 | copy(__DIR__.'/stubs-stubs/Controllers/HomeController.php', app_path('Http/Controllers/HomeController.php')); 109 | 110 | // Add Auth routes in 'routes/web.php' 111 | $auth_route_entry = "Auth::routes();\n\nRoute::get('/home', 'HomeController@index')->name('home');\n\n"; 112 | file_put_contents('./routes/web.php', $auth_route_entry, FILE_APPEND); 113 | 114 | // Copy Skeleton auth views from the stubs folder 115 | (new Filesystem)->copyDirectory(__DIR__.'/foundation-stubs/views', resource_path('views')); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/SkeletonPresetServiceProvider.php: -------------------------------------------------------------------------------- 1 | info('Skeleton scaffolding installed successfully.'); 19 | $command->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.'); 20 | }); 21 | 22 | PresetCommand::macro('skeleton-auth', function ($command) { //optional 23 | SkeletonPreset::install(true); 24 | $command->info('Skeleton scaffolding with Auth views installed successfully.'); 25 | $command->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.'); 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/skeleton-stubs/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 17 | } 18 | 19 | /** 20 | * Show the application dashboard. 21 | * 22 | * @return \Illuminate\Http\Response 23 | */ 24 | public function index() 25 | { 26 | return view('home'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/skeleton-stubs/_settings.scss: -------------------------------------------------------------------------------- 1 | // Content here 2 | -------------------------------------------------------------------------------- /src/skeleton-stubs/app.scss: -------------------------------------------------------------------------------- 1 | 2 | // Fonts 3 | @import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600); 4 | 5 | // Variables 6 | @import "settings"; 7 | 8 | // Bootstrap 9 | @import "skeleton"; 10 | -------------------------------------------------------------------------------- /src/skeleton-stubs/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | 4 | /** 5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 6 | * for JavaScript based Bootstrap features such as modals and tabs. This 7 | * code may be modified to fit the specific needs of your application. 8 | */ 9 | 10 | try { 11 | window.$ = window.jQuery = require('jquery'); 12 | 13 | require('skeleton'); 14 | 15 | } catch (e) {} 16 | 17 | /** 18 | * We'll load the axios HTTP library which allows us to easily issue requests 19 | * to our Laravel back-end. This library automatically handles sending the 20 | * CSRF token as a header based on the value of the "XSRF" token cookie. 21 | */ 22 | 23 | window.axios = require('axios'); 24 | 25 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 26 | 27 | /** 28 | * Next we will register the CSRF Token as a common header with Axios so that 29 | * all outgoing HTTP requests automatically have it attached. This is just 30 | * a simple convenience so we don't have to attach every token manually. 31 | */ 32 | 33 | let token = document.head.querySelector('meta[name="csrf-token"]'); 34 | 35 | if (token) { 36 | window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 37 | } else { 38 | console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 39 | } 40 | 41 | /** 42 | * Echo exposes an expressive API for subscribing to channels and listening 43 | * for events that are broadcast by Laravel. Echo and event broadcasting 44 | * allows your team to easily build robust real-time web applications. 45 | */ 46 | 47 | // import Echo from 'laravel-echo' 48 | 49 | // window.Pusher = require('pusher-js'); 50 | 51 | // window.Echo = new Echo({ 52 | // broadcaster: 'pusher', 53 | // key: 'your-pusher-key' 54 | // }); 55 | r 56 | -------------------------------------------------------------------------------- /src/skeleton-stubs/skeleton.scss: -------------------------------------------------------------------------------- 1 | @import 'node_modules/skeleton'; 2 | -------------------------------------------------------------------------------- /src/skeleton-stubs/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 | {-- Content here --} 6 | 7 | @endsection 8 | -------------------------------------------------------------------------------- /src/skeleton-stubs/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 | {-- Content here --} 6 | 7 | @endsection 8 | -------------------------------------------------------------------------------- /src/skeleton-stubs/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 | {-- Content here --} 6 | 7 | @endsection 8 | -------------------------------------------------------------------------------- /src/skeleton-stubs/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 | {-- Content here --} 6 | 7 | @endsection 8 | -------------------------------------------------------------------------------- /src/skeleton-stubs/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 | {-- Content here --} 6 | 7 | @endsection 8 | -------------------------------------------------------------------------------- /src/skeleton-stubs/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | {-- Content here --} 2 | -------------------------------------------------------------------------------- /src/skeleton-stubs/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | {-- content here --} 2 | --------------------------------------------------------------------------------