Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@


This is originally develeoped at [Caffeinated Menus](https://github.com/caffeinated/menus). Modified to acheive my needs.


For this package Installation guide
==============================

Begin by installing the package through Composer.

```
composer require jigs1212/menus
```

Once this operation is complete, simply add the service provider class and facade alias to your project's `config/app.php` file:

#### Service Provider
```php
Jigs1212\Menus\MenusServiceProvider::class,
```

#### Facade
```php
'Menu' => Jigs1212\Menus\Facades\Menu::class,
```

And that's it! With your coffee in reach, start building out some awesome menus!




ORIGINAL PACKAGE
=================

Caffeinated Menus
=================
[![Laravel 5.3](https://img.shields.io/badge/Laravel-5.3-orange.svg?style=flat-square)](http://laravel.com)
Expand Down
24 changes: 12 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"name": "caffeinated/menus",
"name": "jigs1212/menus",
"description": "Laravel 5 Menus",
"keywords": ["menu", "navigation", "laravel", "caffeinated"],
"keywords": ["menu", "navigation", "laravel", "caffeinated", "jigs1212"],
"license": "MIT",
"authors": [
{
"name": "Shea Lewis",
"email": "shea.lewis89@gmail.com"
"name": "Jigar Lodaya",
"email": "jigar.lodaya12@gmail.com"
}
],
"require": {
"php": ">=5.6.4",
"illuminate/support": "5.3.*|5.4.*|5.5.*",
"illuminate/config": "5.3.*|5.4.*|5.5.*",
"illuminate/routing": "5.3.*|5.4.*|5.5.*",
"illuminate/view": "5.3.*|5.4.*|5.5.*",
"laravelcollective/html": "5.3.*|5.4.*|5.5.*"
"illuminate/support": "^5.3",
"illuminate/config": "^5.3",
"illuminate/routing": "^5.3",
"illuminate/view": "^5.3",
"laravelcollective/html": "^5.3"
},
"autoload": {
"psr-4": {
"Caffeinated\\Menus\\": "src/"
"Jigs1212\\Menus\\": "src/"
}
},
"extra": {
Expand All @@ -28,10 +28,10 @@
},
"laravel": {
"providers": [
"Caffeinated\\Menus\\MenusServiceProvider"
"Jigs1212\\Menus\\MenusServiceProvider"
],
"aliases": {
"Menu": "Caffeinated\\Menus\\Facades\\Menu"
"Menu": "Jigs1212\\Menus\\Facades\\Menu"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/Builder.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Caffeinated\Menus;
namespace Jigs1212\Menus;

use BadMethodCallException;
use Collective\Html\HtmlBuilder;
Expand All @@ -12,7 +12,7 @@ class Builder
* @var array
*/
protected $items;

/**
* @var array
*/
Expand Down Expand Up @@ -324,7 +324,7 @@ protected function getUrl($options)
}

$secure = (isset($options['secure']) and $options['secure'] === true) ? true : false;

if ($prefix) {
$prefix = $prefix.'/';
}
Expand Down Expand Up @@ -582,7 +582,7 @@ public function __call($method, $args)
if (isset($item->data[$attribute]) && $item->data[$attribute] == $value) {
return true;
}

if (! property_exists($item, $attribute)) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Collection.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Caffeinated\Menus;
namespace Jigs1212\Menus;

use Illuminate\Support\Collection as BaseCollection;

Expand Down
4 changes: 2 additions & 2 deletions src/Facades/Menu.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Caffeinated\Menus\Facades;
namespace Jigs1212\Menus\Facades;

use Illuminate\Support\Facades\Facade;

Expand All @@ -14,4 +14,4 @@ protected static function getFacadeAccessor()
{
return 'menu';
}
}
}
12 changes: 8 additions & 4 deletions src/Item.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Caffeinated\Menus;
namespace Jigs1212\Menus;

use Illuminate\Support\Facades\Request;

Expand Down Expand Up @@ -215,7 +215,7 @@ public function append($html)
* @param string $type Can be either "fontawesome" or "glyphicon"
* @return \Caffeinated\Menus\Item
*/
public function icon($icon, $type = 'fontawesome')
public function icon($icon, $type = 'span')
{
switch ($type) {
case 'fontawesome':
Expand All @@ -230,6 +230,10 @@ public function icon($icon, $type = 'fontawesome')
$html = '<i class="entypo-'.$icon.'"></i>';
break;

case 'span':
$html = '<span class="'.$icon.'"></span>';
break;

default:
$html = '<i class="'.$icon.'"></i>';
break;
Expand Down Expand Up @@ -333,7 +337,7 @@ public function checkActiveStatus()

list($path, $requestPath) = preg_replace('@^('.$base.')/@', '', [$path, $requestPath], 1);
}

if ($this->url() == Request::url() || $this->url() == \URL::secure(Request::path())) {
$this->activate();
}
Expand Down Expand Up @@ -370,7 +374,7 @@ public function active($pattern = null)

return $this;
}

/**
* Returns bool value if item is active or not.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Link.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Caffeinated\Menus;
namespace Jigs1212\Menus;

class Link
{
Expand Down
2 changes: 1 addition & 1 deletion src/Menu.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Caffeinated\Menus;
namespace Jigs1212\Menus;

use Collective\Html\HtmlBuilder;
use Illuminate\Config\Repository;
Expand Down
2 changes: 1 addition & 1 deletion src/MenusServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Caffeinated\Menus;
namespace Jigs1212\Menus;

use Illuminate\Support\ServiceProvider;

Expand Down