From 38d0b90d73664711930356bbbe485d16cc29bc72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Ba=C5=A1i=C4=87?= Date: Mon, 13 May 2019 01:02:16 +0200 Subject: [PATCH 1/9] New major version. --- .gitignore | 4 +- .travis.yml | 4 +- license.md => LICENSE.md | 2 +- README.md | 102 +++++++++++ composer.json | 39 ++-- phpunit.xml | 17 +- readme.md | 178 ------------------- src/Laravelista/Ekko/Ekko.php | 111 ------------ src/Laravelista/Ekko/EkkoServiceProvider.php | 39 ---- src/Laravelista/Ekko/Facades/Ekko.php | 11 -- src/Laravelista/Ekko/helpers.php | 133 -------------- src/is_active.php | 14 ++ tests/.gitkeep | 0 tests/EkkoTest.php | 125 ------------- tests/IsActiveTest.php | 46 +++++ 15 files changed, 180 insertions(+), 645 deletions(-) rename license.md => LICENSE.md (96%) create mode 100644 README.md delete mode 100644 readme.md delete mode 100644 src/Laravelista/Ekko/Ekko.php delete mode 100644 src/Laravelista/Ekko/EkkoServiceProvider.php delete mode 100644 src/Laravelista/Ekko/Facades/Ekko.php delete mode 100644 src/Laravelista/Ekko/helpers.php create mode 100644 src/is_active.php delete mode 100644 tests/.gitkeep delete mode 100644 tests/EkkoTest.php create mode 100644 tests/IsActiveTest.php diff --git a/.gitignore b/.gitignore index 1be27b4..5a22558 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ /vendor -composer.phar composer.lock -.DS_Store -/coverage \ No newline at end of file +.phpunit.result.cache \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 2bf9f76..93956da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,12 @@ php: - 5.6 - 7.0 - 7.1 + - 7.2 + - 7.3 before_script: - travis_retry composer self-update - - travis_retry composer install --prefer-dist --no-interaction --dev + - travis_retry composer install --prefer-dist --no-interaction script: - vendor/bin/phpunit diff --git a/license.md b/LICENSE.md similarity index 96% rename from license.md rename to LICENSE.md index a2a441b..2e0f966 100644 --- a/license.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2016 Mario Bašić +Copyright (c) 2015-2019 Mario Bašić 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: diff --git a/README.md b/README.md new file mode 100644 index 0000000..00a0621 --- /dev/null +++ b/README.md @@ -0,0 +1,102 @@ +# Ekko + +PHP function for marking navigation items active. The default output value is for [Bootstrap](http://getbootstrap.com), but it can be changed to anything. + +[![Become a Patron](https://img.shields.io/badge/Becoma%20a-Patron-f96854.svg?style=for-the-badge)](https://www.patreon.com/laravelista) + +> Starting with version `2.0.0`, there is no backward compatibility with the previous releases. + +## Installation + +From the command line: + +```bash +composer require laravelista/ekko +``` + +## Overview + +To mark a menu item active in [Bootstrap](http://getbootstrap.com/components/#navbar), you need to add a `active` CSS class to the `
  • ` tag: + +```html + +``` + +You could do it manually with Laravel, but you will end up with a sausage: + +```html + +``` + +With Ekko your code will look like this: + +```html + +``` + +What if you are not using Bootstrap, but some other framework or a custom design? Instead of returning `active` CSS class, you can make Ekko return anything you want including boolean `true` or `false`: + +```html + +``` + +Using boolean `true` or `false` is convenient if you need to display some content depending on which page you are in your layout view: + +```html +@if(is_active('/about', true)) +

    Something that is only visible on the `about` page.

    +@endif +``` + +## Usage + +This package consists of only one function `is_active`. The function accepts an `input` which can be a string or an array of strings, and an `output` which can be anything. The default output is `active`. + +### Static URLs + +You will use this for your static (non changing) pages. + +``` +
  • Home
  • +
  • About
  • +
  • Contact
  • +``` + +### Dynamic URLs + +Most useful when dealing with resources that contain either slugs or IDs. Useful for blogs, portfolio, model CRUD... + +``` +
  • User Management
  • +
  • Project
  • +
  • Edit User X
  • +``` + +### Array + +You can combine "Static" and "Dynamic" in an array. + +``` +
  • Home
  • +
  • Blog
  • +``` + +## Credits + +Many thanks to: + +- [@Jono20201](https://github.com/Jono20201) for helper functions. +- [@judgej](https://github.com/judgej) for route wildcards. +- [@Turboveja](https://github.com/Turboveja) for a PR that I did not merge. Sry. \ No newline at end of file diff --git a/composer.json b/composer.json index eded41b..3d1cffe 100644 --- a/composer.json +++ b/composer.json @@ -1,40 +1,21 @@ { "name": "laravelista/ekko", - "description": "Laravel helper for detecting active navigation menu items and applying bootstrap classes.", - "keywords": ["navigation", "bootstrap", "laravel", "helper"], + "description": "PHP function for marking navigation items active.", "license": "MIT", + "keywords": ["php", "function", "active", "bootstrap", "helper"], "authors": [ - { - "name": "Mario Basic", - "email": "mario.basic@outlook.com" - } + { + "name": "Mario Bašić", + "email": "mario@laravelista.hr" + } ], - "require": { - "php": ">=5.6.0", - "illuminate/routing": "~4.0|~5.0", - "illuminate/support": "~4.0|~5.0" - }, "autoload": { - "psr-0": { - "Laravelista\\Ekko\\": "src/" - }, - "files" : [ - "src/Laravelista/Ekko/helpers.php" - ] + "files" : [ + "src/is_active.php" + ] }, "minimum-stability": "stable", "require-dev": { - "phpunit/phpunit": "^5.3", - "mockery/mockery": "^0.9.4" - }, - "extra": { - "laravel": { - "providers": [ - "Laravelista\\Ekko\\EkkoServiceProvider" - ], - "aliases": { - "Ekko": "Laravelista\\Ekko\\Facades\\Ekko" - } - } + "phpunit/phpunit": "^8" } } diff --git a/phpunit.xml b/phpunit.xml index 6a8c013..d2b79f1 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,21 +7,10 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" - syntaxCheck="false" -> + stopOnFailure="false"> - - ./tests/ + + ./tests - - - ./src - - ./src/Laravelista/Ekko/Facades - ./src/Laravelista/Ekko/EkkoServiceProvider.php - - - diff --git a/readme.md b/readme.md deleted file mode 100644 index b7aec84..0000000 --- a/readme.md +++ /dev/null @@ -1,178 +0,0 @@ -# Ekko - -Laravel package for marking navigation items active. - -[![Become a Patron](https://img.shields.io/badge/Becoma%20a-Patron-f96854.svg?style=for-the-badge)](https://www.patreon.com/laravelista) - -## Installation - -From the command line: - -```bash -composer require laravelista/ekko -``` - -Laravel 5.5+ will use the auto-discovery function. - -If using 5.4 (or if you are not using auto-discovery) you will need to include the service providers / facade in `config/app.php`: - -```php -'providers' => [ - ..., - Laravelista\Ekko\EkkoServiceProvider::class -]; -``` - -And add a facade alias to the same file at the bottom: - -```php -'aliases' => [ - ..., - 'Ekko' => Laravelista\Ekko\Facades\Ekko::class -]; -``` - -## Overview - -To mark a menu item active in [Bootstrap](http://getbootstrap.com/components/#navbar), you need to add a `active` CSS class to the `
  • ` tag: - -```html - -``` - -You could do it manually with Laravel, but you will end up with a sausage: - -```html - -``` - -With Ekko your code will look like this: - -```html - -``` - -What if you are not using Bootstrap, but some other framework or a custom design? Instead of returning `active` CSS class, you can make Ekko return anything you want including boolean `true` or `false`: - -```html - -``` - -Using boolean `true` or `false` is convenient if you need to display some content depending on which page you are in your layout view: - -```html -@if(isActiveRoute('home', true)) -

    Something that is only visible on the `home` route.

    -@endif -``` - -## API - -There are two ways of using Ekko in your application, by using a facade `Ekko::isActiveURL('/about')` or by using a helper function `isActiveURL('/about')` or `is_active_route('/about')`. - -### isActiveRoute, is_active_route - -Compares given route name with current route name. - -```php -isActiveRoute($routeName, $output = "active") -``` - -```php -is_active_route($routeName, $output = "active") -``` - -**Examples:** - -If the current route is `home`, function `isActiveRoute('home')` would return *string* `active`. - -_The `*` wildcard can be used for resource routes._ - -Function `isActiveRoute('user.*')` would return *string* `active` for any current route which begins with `user`. - -### isActiveURL, is_active_url - -Compares given URL path with current URL path. - -```php -isActiveURL($url, $output = "active") -``` - -```php -is_active_url($url, $output = "active") -``` - -**Examples:** - -If the current URL path is `/about`, function `isActiveURL('/about')` would return *string* `active`. - -### isActiveMatch, is_active_match - -Detects if the given string is found in the current URL. - -```php -isActiveMatch($string, $output = "active") -``` - -```php -is_active_match($string, $output = "active") -``` - -**Examples:** - -If the current URL path is `/about` or `/insideout`, function `isActiveMatch('out')` would return *string* `active`. - -### areActiveRoutes, are_active_routes - -Compares given array of route names with current route name. - -```php -areActiveRoutes(array $routeNames, $output = "active") -``` - -```php -are_active_routes(array $routeNames, $output = "active") -``` - -**Examples:** - -If the current route is `product.index` or `product.show`, function `areActiveRoutes(['product.index', 'product.show'])` would return *string* `active`. - -_The `*` wildcard can be used for resource routes, including nested routes._ - -Function `areActiveRoutes(['user.*', 'product.*'])` would return *string* `active` for any current route which begins with `user` or `product`. - -### areActiveURLs, are_active_urls - -Compares given array of URL paths with current URL path. - -```php -areActiveURLs(array $urls, $output = "active") -``` - -```php -are_active_urls(array $urls, $output = "active") -``` - -**Examples:** - -If the current URL path is `/product` or `/product/create`, function `areActiveURLs(['/product', '/product/create'])` would return *string* `active`. - -## Credits - -Many thanks to: - -- [@Jono20201](https://github.com/Jono20201) for implementing helper functions -- [@judgej](https://github.com/judgej) for implementing route wildcards diff --git a/src/Laravelista/Ekko/Ekko.php b/src/Laravelista/Ekko/Ekko.php deleted file mode 100644 index d05a53c..0000000 --- a/src/Laravelista/Ekko/Ekko.php +++ /dev/null @@ -1,111 +0,0 @@ -route = $route; - $this->url = $url; - } - - /** - * Compares given route name with current route name. - * Any section of the route name can be replaced with a * wildcard. - * Example: user.* - * - * @param string $routeName - * @param string $output - * @return boolean - */ - public function isActiveRoute($routeName, $output = "active") - { - if (strpos($routeName, '*') !== false) { - // Quote all RE characters, then undo the quoted '*' characters to match any - // sequence of non-'.' characters. - $regex = '/^' . str_replace(preg_quote('*'), '[^.]*?', preg_quote($routeName, '/')) . '/'; - if (preg_match($regex, $this->route->currentRouteName())) { - return $output; - } - - } elseif ($this->route->currentRouteName() == $routeName) { - return $output; - } - - return null; - } - - /** - * Compares given URL with current URL. - * - * @param string $url - * @param string $output - * @return boolean - */ - public function isActiveURL($url, $output = "active") - { - if ($this->url->current() == $this->url->to($url)) { - return $output; - } - - return null; - } - - /** - * Detects if the given string is found in the current URL. - * - * @param string $string - * @param string $output - * @return boolean - */ - public function isActiveMatch($string, $output = "active") - { - if (strpos($this->url->current(), $string) !== false) { - return $output; - } - - return null; - } - - /** - * Compares given array of route names with current route name. - * - * @param array $routeNames - * @param string $output - * @return boolean - */ - public function areActiveRoutes(array $routeNames, $output = "active") - { - foreach ($routeNames as $routeName) { - if ($this->isActiveRoute($routeName, true)) { - return $output; - } - } - - return null; - } - - /** - * Compares given array of URLs with current URL. - * - * @param array $urls - * @param string $output - * @return boolean - */ - public function areActiveURLs(array $urls, $output = "active") - { - foreach ($urls as $url) { - if ($this->isActiveURL($url, true)) { - return $output; - } - } - - return null; - } - -} diff --git a/src/Laravelista/Ekko/EkkoServiceProvider.php b/src/Laravelista/Ekko/EkkoServiceProvider.php deleted file mode 100644 index 981c338..0000000 --- a/src/Laravelista/Ekko/EkkoServiceProvider.php +++ /dev/null @@ -1,39 +0,0 @@ -app->singleton(Ekko::class, function ($app) { - return new Ekko( - $app['router'], - $app['url'] - ); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return [Ekko::class]; - } -} diff --git a/src/Laravelista/Ekko/Facades/Ekko.php b/src/Laravelista/Ekko/Facades/Ekko.php deleted file mode 100644 index 2b18302..0000000 --- a/src/Laravelista/Ekko/Facades/Ekko.php +++ /dev/null @@ -1,11 +0,0 @@ -isActiveRoute($routeName, $output); - } -} - -if (!function_exists('is_active_route')) { - /** - * @param $routeName - * @param string $output - * - * @return string - */ - function is_active_route($routeName, $output = "active") - { - return isActiveRoute($routeName, $output); - } -} - -if (!function_exists('isActiveURL')) { - /** - * @param $url - * @param string $output - * - * @return string - */ - function isActiveURL($url, $output = "active") - { - return app(Ekko::class)->isActiveURL($url, $output); - } -} - -if (!function_exists('is_active_url')) { - /** - * @param $url - * @param string $output - * - * @return string - */ - function is_active_url($url, $output = "active") - { - return isActiveURL($url, $output); - } -} - -if (!function_exists('isActiveMatch')) { - /** - * @param $string - * @param string $output - * - * @return string - */ - function isActiveMatch($string, $output = "active") - { - return app(Ekko::class)->isActiveMatch($string, $output); - } -} - -if (!function_exists('is_active_match')) { - /** - * @param $string - * @param string $output - * - * @return string - */ - function is_active_match($string, $output = "active") - { - return isActiveMatch($string, $output); - } -} - -if (!function_exists('areActiveRoutes')) { - /** - * @param array $routeNames - * @param string $output - * - * @return string - */ - function areActiveRoutes(array $routeNames, $output = "active") - { - return app(Ekko::class)->areActiveRoutes($routeNames, $output); - } -} - -if (!function_exists('are_active_routes')) { - /** - * @param array $routeNames - * @param string $output - * - * @return string - */ - function are_active_routes(array $routeNames, $output = "active") - { - return areActiveRoutes($routeNames, $output); - } -} - -if (!function_exists('areActiveURLs')) { - /** - * @param array $urls - * @param string $output - * - * @return string - */ - function areActiveURLs(array $urls, $output = "active") - { - return app(Ekko::class)->areActiveURLs($urls, $output); - } -} - -if (!function_exists('are_active_urls')) { - /** - * @param array $urls - * @param string $output - * - * @return string - */ - function are_active_urls(array $urls, $output = "active") - { - return areActiveURLs($urls, $output); - } -} diff --git a/src/is_active.php b/src/is_active.php new file mode 100644 index 0000000..e0796b3 --- /dev/null +++ b/src/is_active.php @@ -0,0 +1,14 @@ + 0 ? $output : null; + } + + $regex = '/^' . str_replace(preg_quote('*'), '[^.]*?', preg_quote($input, '/')) . '$/'; + + return preg_match($regex, strtok($_SERVER['REQUEST_URI'], '?')) ? $output : null; + } +} diff --git a/tests/.gitkeep b/tests/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/EkkoTest.php b/tests/EkkoTest.php deleted file mode 100644 index 488a4ed..0000000 --- a/tests/EkkoTest.php +++ /dev/null @@ -1,125 +0,0 @@ -shouldReceive('currentRouteName')->times(8)->andReturn('users.index'); - - $url = m::mock(\Illuminate\Routing\UrlGenerator::class); - - $ekko = new Ekko($router, $url); - - $this->assertEquals("active", $ekko->isActiveRoute('users.index')); - $this->assertEquals("hello", $ekko->isActiveRoute('users.index', 'hello')); - $this->assertEquals(null, $ekko->isActiveRoute('clients.index')); - $this->assertEquals(null, $ekko->isActiveRoute('clients.index', 'hello')); - - // Wildcard support - $this->assertEquals("active", $ekko->isActiveRoute('users.*')); - $this->assertEquals("hello", $ekko->isActiveRoute('users.*', 'hello')); - $this->assertEquals(null, $ekko->isActiveRoute('clients.*')); - $this->assertEquals(null, $ekko->isActiveRoute('clients.*', 'hello')); - } - - /** @test */ - public function it_detects_active_url() - { - $router = m::mock(\Illuminate\Routing\Router::class); - - $url = m::mock(\Illuminate\Routing\UrlGenerator::class); - $url->shouldReceive('current')->times(4)->andReturn('/users'); - $url->shouldReceive('to')->times(4)->andReturn('/users', '/users', 'users', '/users/preview'); - - $ekko = new Ekko($router, $url); - - $this->assertEquals("active", $ekko->isActiveURL('/users')); - $this->assertEquals("hello", $ekko->isActiveURL('/users', 'hello')); - $this->assertEquals(null, $ekko->isActiveURL('users')); - $this->assertEquals(null, $ekko->isActiveURL('/users/preview', 'hello')); - } - - /** @test */ - public function it_detects_active_match_in_url() - { - $router = m::mock(\Illuminate\Routing\Router::class); - - $url = m::mock(\Illuminate\Routing\UrlGenerator::class); - $url->shouldReceive('current')->times(4) - ->andReturn('/somewhere-over-the-rainbow'); - - $ekko = new Ekko($router, $url); - - $this->assertEquals("active", $ekko->isActiveMatch('over-the-rainbow')); - $this->assertEquals("hello", $ekko->isActiveMatch('over-the-rainbow', "hello")); - $this->assertEquals(null, $ekko->isActiveMatch('under-the-rainbow')); - $this->assertEquals(null, $ekko->isActiveMatch('under-the-rainbow', 'hello')); - } - - /** @test */ - public function it_detects_active_routes_by_name() - { - $router = m::mock(\Illuminate\Routing\Router::class); - $router->shouldReceive('currentRouteName')->times(8)->andReturn('users.index'); - - $url = m::mock(\Illuminate\Routing\UrlGenerator::class); - - $ekko = new Ekko($router, $url); - - $this->assertEquals("active", $ekko->areActiveRoutes(['users.index'])); - $this->assertEquals("hello", $ekko->areActiveRoutes(['users.index'], 'hello')); - $this->assertEquals(null, $ekko->areActiveRoutes(['clients.index'])); - $this->assertEquals(null, $ekko->areActiveRoutes(['clients.index'], 'hello')); - - // Wildcard support - $this->assertEquals("active", $ekko->areActiveRoutes(['users.*'])); - $this->assertEquals("hello", $ekko->areActiveRoutes(['users.*'], 'hello')); - $this->assertEquals(null, $ekko->areActiveRoutes(['clients.*'])); - $this->assertEquals(null, $ekko->areActiveRoutes(['clients.*'], 'hello')); - } - - /** @test */ - public function it_detects_deep_active_routes_by_name() - { - $router = m::mock(\Illuminate\Routing\Router::class); - $router->shouldReceive('currentRouteName')->times(4)->andReturn('frontend.users.show.stats'); - - $url = m::mock(\Illuminate\Routing\UrlGenerator::class); - - $ekko = new Ekko($router, $url); - - // Wildcard support - $this->assertEquals("active", $ekko->areActiveRoutes(['frontend.users.*'])); - $this->assertEquals("hello", $ekko->areActiveRoutes(['frontend.users.*'], 'hello')); - $this->assertEquals(null, $ekko->areActiveRoutes(['clients.*'])); - $this->assertEquals(null, $ekko->areActiveRoutes(['clients.*'], 'hello')); - } - - /** @test */ - public function it_detects_active_routes_by_url() - { - $router = m::mock(\Illuminate\Routing\Router::class); - - $url = m::mock(\Illuminate\Routing\UrlGenerator::class); - $url->shouldReceive('current')->times(4)->andReturn('/users'); - $url->shouldReceive('to')->times(4)->andReturn('/users', '/users', 'users', '/users/preview'); - - $ekko = new Ekko($router, $url); - - $this->assertEquals("active", $ekko->areActiveURLs(['/users'])); - $this->assertEquals("hello", $ekko->areActiveURLs(['/users'], 'hello')); - $this->assertEquals(null, $ekko->areActiveURLs(['users'])); - $this->assertEquals(null, $ekko->areActiveURLs(['/users/preview'], 'hello')); - } - -} diff --git a/tests/IsActiveTest.php b/tests/IsActiveTest.php new file mode 100644 index 0000000..508cc6d --- /dev/null +++ b/tests/IsActiveTest.php @@ -0,0 +1,46 @@ +assertTrue(is_active('/', true)); + $this->assertTrue(is_active('*', true)); // you can do this, but why? + + $this->assertNull(is_active('/test')); + $this->assertNull(is_active('')); + } + + public function testWildcards() + { + $_SERVER['REQUEST_URI'] = '/user/3/edit'; + + $this->assertTrue(is_active('/user/3/edit', true)); + $this->assertTrue(is_active('/user/*/edit', true)); + $this->assertTrue(is_active('/user/3/*', true)); + $this->assertTrue(is_active('/user/*', true)); + $this->assertTrue(is_active('/user*', true)); + + $this->assertNull(is_active('/user')); + $this->assertNull(is_active('/user/3')); + $this->assertNull(is_active('/user/3/')); + } + + public function testMatches() + { + $_SERVER['REQUEST_URI'] = '/article/a-brown-fox-jumps-over-a-burning-bridge'; + + $this->assertTrue(is_active('*fox*', true)); + $this->assertTrue(is_active('*fox*bridge', true)); + $this->assertTrue(is_active('*bridge', true)); + $this->assertTrue(is_active('/article/*', true)); + + $this->assertNull(is_active('/article')); + $this->assertNull(is_active('/a-brown-fox')); + $this->assertNull(is_active('bridge')); + } +} \ No newline at end of file From 4719da8d4abf44cb67b9a924c1adc80f059f8696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Ba=C5=A1i=C4=87?= Date: Mon, 13 May 2019 01:11:16 +0200 Subject: [PATCH 2/9] Updated readme. --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 00a0621..56f19eb 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,11 @@ You can combine "Static" and "Dynamic" in an array. Many thanks to: -- [@Jono20201](https://github.com/Jono20201) for helper functions. - [@judgej](https://github.com/judgej) for route wildcards. -- [@Turboveja](https://github.com/Turboveja) for a PR that I did not merge. Sry. \ No newline at end of file +- [@Jono20201](https://github.com/Jono20201) for helper functions. +- [@JasonMillward](https://github.com/JasonMillward) for improving wildcards in nested route names. +- [@it-can](https://github.com/it-can) for Laravel 5.5+ auto-discovery. +- [@foo99](https://github.com/foo99) for snake_case function names. +- [@Turboveja](https://github.com/Turboveja) for a PR that I did not merge. Sry. + +I know that this new version includes very little of your contributions, but you will not be forgotten. Thank you. \ No newline at end of file From 914c175d75e1b171aee44ec07ed8ba74b11e84a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Ba=C5=A1i=C4=87?= Date: Mon, 13 May 2019 01:12:25 +0200 Subject: [PATCH 3/9] Updated readme. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 56f19eb..a32cec0 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # Ekko -PHP function for marking navigation items active. The default output value is for [Bootstrap](http://getbootstrap.com), but it can be changed to anything. +PHP function for marking navigation items active. [![Become a Patron](https://img.shields.io/badge/Becoma%20a-Patron-f96854.svg?style=for-the-badge)](https://www.patreon.com/laravelista) > Starting with version `2.0.0`, there is no backward compatibility with the previous releases. +The default output value is for [Bootstrap](http://getbootstrap.com), but it can be changed to anything. + ## Installation From the command line: From 5b4ab9aeb3acf578d00da66026c6a9130cbaa245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Ba=C5=A1i=C4=87?= Date: Mon, 13 May 2019 01:14:15 +0200 Subject: [PATCH 4/9] Updated readme. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a32cec0..47483e7 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,12 @@ PHP function for marking navigation items active. The default output value is for [Bootstrap](http://getbootstrap.com), but it can be changed to anything. +- Single function +- Five lines of code +- Framework agnostic +- Tested +- Documented + ## Installation From the command line: From 720db74b4f781ed7dbcb5166b314de776c2f4a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Ba=C5=A1i=C4=87?= Date: Mon, 13 May 2019 01:15:32 +0200 Subject: [PATCH 5/9] Updated readme. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 47483e7..6772497 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,12 @@ PHP function for marking navigation items active. The default output value is for [Bootstrap](http://getbootstrap.com), but it can be changed to anything. +## Features + - Single function - Five lines of code - Framework agnostic +- Supports wildcards & arrays - Tested - Documented From fbf40fe44f6a2b942f0cf6712f24ea1c75bb8be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Ba=C5=A1i=C4=87?= Date: Mon, 13 May 2019 01:15:54 +0200 Subject: [PATCH 6/9] Updated readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6772497..9b73c54 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ The default output value is for [Bootstrap](http://getbootstrap.com), but it can - Five lines of code - Framework agnostic - Supports wildcards & arrays -- Tested - Documented +- Tested ## Installation From 58dcb34f06ea134835b5634cfb1169f88303c506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Ba=C5=A1i=C4=87?= Date: Mon, 13 May 2019 01:27:15 +0200 Subject: [PATCH 7/9] Adds contributing. --- CONTRIBUTING.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..750d7d8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,19 @@ +# Contributing + +There are no strict rules when contributing, but here are my suggestions. + +> I use a combination of [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) and [Forking Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow). + +## Steps + +1. Fork the repository. +2. Create a branch depending on the issue that you are working on. *See reference table bellow.* +3. Do you work and commit. +4. Create a Pull Request to the `develop` branch. + +### Branch naming reference + +- `feature` - New functionality or refactoring. +- `bugfix` - Fixes existing code +- `hotfix` - Urgent production fix. Use this if there is a huge bug. +- `support` - Documentation updates & stuff like that. \ No newline at end of file From f530d7e3964bdfe8e4c04a3f611f64dec38f99aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Ba=C5=A1i=C4=87?= Date: Mon, 13 May 2019 01:28:08 +0200 Subject: [PATCH 8/9] Updated patreon badge finally. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b73c54..4af068a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ PHP function for marking navigation items active. -[![Become a Patron](https://img.shields.io/badge/Becoma%20a-Patron-f96854.svg?style=for-the-badge)](https://www.patreon.com/laravelista) +[![Become a Patron](https://img.shields.io/badge/Become%20a-Patron-f96854.svg?style=for-the-badge)](https://www.patreon.com/laravelista) > Starting with version `2.0.0`, there is no backward compatibility with the previous releases. From 8f81b02f60f8ddea84db47544fa909f63953621d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Ba=C5=A1i=C4=87?= Date: Mon, 13 May 2019 01:32:28 +0200 Subject: [PATCH 9/9] Updated travis. --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 93956da..6b95047 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,6 @@ language: php php: - - 5.6 - - 7.0 - - 7.1 - 7.2 - 7.3