Skip to content

Commit 10aeed1

Browse files
committed
Initialize Laravel Menu Builder
1 parent 9f3ebdb commit 10aeed1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2291
-0
lines changed

composer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "codexshaper/laravel-menu-builder",
3+
"description": "Laravel Drag and Drop Menu Builder",
4+
"type": "library",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Md Abu Ahsan Basir",
9+
"email": "maab.career@gmail.com"
10+
}
11+
],
12+
"minimum-stability": "dev",
13+
"require": {},
14+
"autoload": {
15+
"psr-4": {
16+
"CodexShaper\\Menu\\": "src/"
17+
}
18+
},
19+
"extra": {
20+
"laravel": {
21+
"providers": [
22+
"CodexShaper\\Menu\\MenuServiceProvider"
23+
],
24+
"aliases": {
25+
"MenuBuilder": "CodexShaper\\Menu\\Facades\\Menu"
26+
}
27+
}
28+
},
29+
}

config/menu.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class CreateMenusTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('menus', function (Blueprint $table) {
17+
$table->increments('id');
18+
$table->string('name');
19+
$table->timestamps();
20+
});
21+
}
22+
23+
/**
24+
* Reverse the migrations.
25+
*
26+
* @return void
27+
*/
28+
public function down()
29+
{
30+
Schema::dropIfExists('menus');
31+
}
32+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class CreateMenuItemsTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('menu_items', function (Blueprint $table) {
17+
$table->increments('id');
18+
$table->integer('menu_id');
19+
$table->string('title')->nullable();
20+
$table->string('slug')->nullable();
21+
$table->string('url')->nullable();
22+
$table->string('target')->default('_self');
23+
$table->integer('parent_id')->unsigned()->nullable();
24+
$table->integer('order')->unsigned()->default(0);
25+
$table->string('custom_class')->nullable();
26+
$table->timestamps();
27+
});
28+
}
29+
30+
/**
31+
* Reverse the migrations.
32+
*
33+
* @return void
34+
*/
35+
public function down()
36+
{
37+
Schema::dropIfExists('menu_items');
38+
}
39+
}

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"dev": "npm run development",
5+
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6+
"watch": "npm run development -- --watch",
7+
"watch-poll": "npm run watch -- --watch-poll",
8+
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
9+
"prod": "npm run production",
10+
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11+
},
12+
"devDependencies": {
13+
"axios": "^0.19",
14+
"bootstrap": "^4.1.0",
15+
"cross-env": "^5.1",
16+
"jquery": "^3.2",
17+
"laravel-mix": "^4.0.7",
18+
"lodash": "^4.17.13",
19+
"popper.js": "^1.12",
20+
"resolve-url-loader": "^2.3.1",
21+
"sass": "^1.15.2",
22+
"sass-loader": "^7.1.0",
23+
"vue": "^2.5.17",
24+
"vue-template-compiler": "^2.6.10"
25+
},
26+
"dependencies": {
27+
"nestable2": "^1.6.0",
28+
"sweetalert2": "^8.16.3",
29+
"vuedraggable": "^2.23.0"
30+
}
31+
}

publishable/assets/css/menu.css

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.dd { position: relative; display: block; margin: 0; padding: 0; max-width: 600px; list-style: none; font-size: 13px; line-height: 20px; }
2+
3+
.dd-list { display: block; position: relative; margin: 0; padding: 0; list-style: none; }
4+
.dd-list .dd-list { padding-left: 30px; }
5+
.dd-collapsed .dd-list { display: none; }
6+
7+
.dd-item,
8+
.dd-empty,
9+
.dd-placeholder { display: block; position: relative; margin: 0; padding: 0; min-height: 20px; font-size: 13px; line-height: 20px; }
10+
11+
.dd-handle { display: block; height: 30px; margin: 5px 0; padding: 5px 10px; color: #333; text-decoration: none; font-weight: bold; border: 1px solid #ccc;
12+
background: #fafafa;
13+
background: -webkit-linear-gradient(top, #fafafa 0%, #eee 100%);
14+
background: -moz-linear-gradient(top, #fafafa 0%, #eee 100%);
15+
background: linear-gradient(top, #fafafa 0%, #eee 100%);
16+
-webkit-border-radius: 3px;
17+
border-radius: 3px;
18+
box-sizing: border-box; -moz-box-sizing: border-box;
19+
}
20+
.dd-handle:hover { color: #2ea8e5; background: #fff; }
21+
22+
.dd-item > button { display: none; position: relative; cursor: pointer; float: left; width: 25px; height: 20px; margin: 5px 0; padding: 0; text-indent: 100%; white-space: nowrap; overflow: hidden; border: 0; background: transparent; font-size: 12px; line-height: 1; text-align: center; font-weight: bold; }
23+
.dd-item > button:before { content: '+'; display: block; position: absolute; width: 100%; text-align: center; text-indent: 0; }
24+
.dd-item > button[data-action="collapse"]:before { content: '-'; }
25+
.dd-item .dd-collapse {display: block}
26+
27+
.dd-collapsed .dd-collapse {
28+
display: none;
29+
}
30+
.dd-collapsed .dd-expand {
31+
display: block;
32+
}
33+
34+
.dd-placeholder,
35+
.dd-empty { margin: 5px 0; padding: 0; min-height: 30px; background: #f2fbff; border: 1px dashed #b6bcbf; box-sizing: border-box; -moz-box-sizing: border-box; }
36+
.dd-empty { border: 1px dashed #bbb; min-height: 100px; background-color: #e5e5e5;
37+
background-image: -webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
38+
-webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
39+
background-image: -moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
40+
-moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
41+
background-image: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
42+
linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
43+
background-size: 60px 60px;
44+
background-position: 0 0, 30px 30px;
45+
}
46+
47+
.dd-dragel { position: absolute; pointer-events: none; z-index: 9999; }
48+
.dd-dragel > .dd-item .dd-handle { margin-top: 0; }
49+
.dd-dragel .dd-handle {
50+
-webkit-box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
51+
box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
52+
}
53+
54+
.menu-action {
55+
position: absolute;
56+
top: 0;
57+
right: 0;
58+
margin: 5px 5px 0px 0px;
59+
}
60+
61+
#menu_success.active {
62+
padding: 10px;
63+
}

0 commit comments

Comments
 (0)