├── .gitattributes
├── .gitignore
├── app
├── commands
│ └── .gitkeep
├── config
│ ├── app.php
│ ├── auth.php
│ ├── cache.php
│ ├── compile.php
│ ├── database.php
│ ├── mail.php
│ ├── packages
│ │ └── .gitkeep
│ ├── queue.php
│ ├── remote.php
│ ├── session.php
│ ├── testing
│ │ ├── cache.php
│ │ └── session.php
│ ├── view.php
│ └── workbench.php
├── controllers
│ ├── .gitkeep
│ ├── BaseController.php
│ ├── HomeController.php
│ └── mrc
│ │ └── CategoryController.php
├── database
│ ├── migrations
│ │ ├── .gitkeep
│ │ └── 2014_01_17_003928_create_category_table.php
│ ├── production.sqlite
│ └── seeds
│ │ ├── .gitkeep
│ │ └── DatabaseSeeder.php
├── filters.php
├── lang
│ └── en
│ │ ├── pagination.php
│ │ ├── reminders.php
│ │ └── validation.php
├── models
│ ├── User.php
│ └── mrc
│ │ └── Category.php
├── routes.php
├── start
│ ├── artisan.php
│ ├── global.php
│ └── local.php
├── storage
│ ├── .gitignore
│ ├── cache
│ │ └── .gitignore
│ ├── logs
│ │ └── .gitignore
│ ├── meta
│ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
├── tests
│ ├── ExampleTest.php
│ └── TestCase.php
└── views
│ ├── emails
│ └── auth
│ │ └── reminder.blade.php
│ ├── hello.php
│ └── mrc
│ └── category.blade.php
├── artisan
├── bootstrap
├── autoload.php
├── paths.php
└── start.php
├── composer.json
├── demo.gif
├── phpunit.xml
├── public
├── .htaccess
├── assets-dev
│ ├── css
│ │ ├── alertify
│ │ │ ├── alertify.core.css
│ │ │ └── alertify.default.css
│ │ ├── editable
│ │ │ ├── img
│ │ │ │ ├── clear.png
│ │ │ │ └── loading.gif
│ │ │ └── jquery-editable.css
│ │ ├── jqtree
│ │ │ ├── img
│ │ │ │ └── jqtree-circle.png
│ │ │ └── jqtree.css
│ │ └── style.css
│ └── js
│ │ ├── 1.jquery
│ │ └── jquery-2.0.3.js
│ │ ├── 2.alertify
│ │ └── alertify.js
│ │ ├── 3.jqtree
│ │ └── tree.jquery.js
│ │ ├── 4.editable
│ │ └── jquery-editable-poshytip.js
│ │ └── site.js
├── assets
│ ├── img
│ │ ├── clear.png
│ │ ├── jqtree-circle.png
│ │ └── loading.gif
│ ├── site.css
│ ├── site.min.css
│ └── site.min.js
├── favicon.ico
├── gruntfile.js
├── index.php
├── package.json
├── packages
│ └── .gitkeep
└── robots.txt
├── readme.md
└── server.php
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /bootstrap/compiled.php
2 | /vendor
3 | composer.phar
4 | composer.lock
5 | .DS_Store
6 | Thumbs.db
--------------------------------------------------------------------------------
/app/commands/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrcasual/nested-sets-laravel-jquery/497b41b425a5508835aed4d2e2fee9842aecfb98/app/commands/.gitkeep
--------------------------------------------------------------------------------
/app/config/app.php:
--------------------------------------------------------------------------------
1 | true,
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Application URL
21 | |--------------------------------------------------------------------------
22 | |
23 | | This URL is used by the console to properly generate URLs when using
24 | | the Artisan command line tool. You should set this to the root of
25 | | your application so that it is used when running Artisan tasks.
26 | |
27 | */
28 |
29 | 'url' => 'http://localhost',
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Application Timezone
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here you may specify the default timezone for your application, which
37 | | will be used by the PHP date and date-time functions. We have gone
38 | | ahead and set this to a sensible default for you out of the box.
39 | |
40 | */
41 |
42 | 'timezone' => 'UTC',
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Application Locale Configuration
47 | |--------------------------------------------------------------------------
48 | |
49 | | The application locale determines the default locale that will be used
50 | | by the translation service provider. You are free to set this value
51 | | to any of the locales which will be supported by the application.
52 | |
53 | */
54 |
55 | 'locale' => 'en',
56 |
57 | /*
58 | |--------------------------------------------------------------------------
59 | | Encryption Key
60 | |--------------------------------------------------------------------------
61 | |
62 | | This key is used by the Illuminate encrypter service and should be set
63 | | to a random, 32 character string, otherwise these encrypted strings
64 | | will not be safe. Please do this before deploying an application!
65 | |
66 | */
67 |
68 | 'key' => 'YourSecretKey!!!',
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Autoloaded Service Providers
73 | |--------------------------------------------------------------------------
74 | |
75 | | The service providers listed here will be automatically loaded on the
76 | | request to your application. Feel free to add your own services to
77 | | this array to grant expanded functionality to your applications.
78 | |
79 | */
80 |
81 | 'providers' => array(
82 |
83 | 'Illuminate\Foundation\Providers\ArtisanServiceProvider',
84 | 'Illuminate\Auth\AuthServiceProvider',
85 | 'Illuminate\Cache\CacheServiceProvider',
86 | 'Illuminate\Session\CommandsServiceProvider',
87 | 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
88 | 'Illuminate\Routing\ControllerServiceProvider',
89 | 'Illuminate\Cookie\CookieServiceProvider',
90 | 'Illuminate\Database\DatabaseServiceProvider',
91 | 'Illuminate\Encryption\EncryptionServiceProvider',
92 | 'Illuminate\Filesystem\FilesystemServiceProvider',
93 | 'Illuminate\Hashing\HashServiceProvider',
94 | 'Illuminate\Html\HtmlServiceProvider',
95 | 'Illuminate\Log\LogServiceProvider',
96 | 'Illuminate\Mail\MailServiceProvider',
97 | 'Illuminate\Database\MigrationServiceProvider',
98 | 'Illuminate\Pagination\PaginationServiceProvider',
99 | 'Illuminate\Queue\QueueServiceProvider',
100 | 'Illuminate\Redis\RedisServiceProvider',
101 | 'Illuminate\Remote\RemoteServiceProvider',
102 | 'Illuminate\Auth\Reminders\ReminderServiceProvider',
103 | 'Illuminate\Database\SeedServiceProvider',
104 | 'Illuminate\Session\SessionServiceProvider',
105 | 'Illuminate\Translation\TranslationServiceProvider',
106 | 'Illuminate\Validation\ValidationServiceProvider',
107 | 'Illuminate\View\ViewServiceProvider',
108 | 'Illuminate\Workbench\WorkbenchServiceProvider',
109 |
110 | ),
111 |
112 | /*
113 | |--------------------------------------------------------------------------
114 | | Service Provider Manifest
115 | |--------------------------------------------------------------------------
116 | |
117 | | The service provider manifest is used by Laravel to lazy load service
118 | | providers which are not needed for each request, as well to keep a
119 | | list of all of the services. Here, you may set its storage spot.
120 | |
121 | */
122 |
123 | 'manifest' => storage_path().'/meta',
124 |
125 | /*
126 | |--------------------------------------------------------------------------
127 | | Class Aliases
128 | |--------------------------------------------------------------------------
129 | |
130 | | This array of class aliases will be registered when this application
131 | | is started. However, feel free to register as many as you wish as
132 | | the aliases are "lazy" loaded so they don't hinder performance.
133 | |
134 | */
135 |
136 | 'aliases' => array(
137 |
138 | 'App' => 'Illuminate\Support\Facades\App',
139 | 'Artisan' => 'Illuminate\Support\Facades\Artisan',
140 | 'Auth' => 'Illuminate\Support\Facades\Auth',
141 | 'Blade' => 'Illuminate\Support\Facades\Blade',
142 | 'Cache' => 'Illuminate\Support\Facades\Cache',
143 | 'ClassLoader' => 'Illuminate\Support\ClassLoader',
144 | 'Config' => 'Illuminate\Support\Facades\Config',
145 | 'Controller' => 'Illuminate\Routing\Controller',
146 | 'Cookie' => 'Illuminate\Support\Facades\Cookie',
147 | 'Crypt' => 'Illuminate\Support\Facades\Crypt',
148 | 'DB' => 'Illuminate\Support\Facades\DB',
149 | 'Eloquent' => 'Illuminate\Database\Eloquent\Model',
150 | 'Event' => 'Illuminate\Support\Facades\Event',
151 | 'File' => 'Illuminate\Support\Facades\File',
152 | 'Form' => 'Illuminate\Support\Facades\Form',
153 | 'Hash' => 'Illuminate\Support\Facades\Hash',
154 | 'HTML' => 'Illuminate\Support\Facades\HTML',
155 | 'Input' => 'Illuminate\Support\Facades\Input',
156 | 'Lang' => 'Illuminate\Support\Facades\Lang',
157 | 'Log' => 'Illuminate\Support\Facades\Log',
158 | 'Mail' => 'Illuminate\Support\Facades\Mail',
159 | 'Paginator' => 'Illuminate\Support\Facades\Paginator',
160 | 'Password' => 'Illuminate\Support\Facades\Password',
161 | 'Queue' => 'Illuminate\Support\Facades\Queue',
162 | 'Redirect' => 'Illuminate\Support\Facades\Redirect',
163 | 'Redis' => 'Illuminate\Support\Facades\Redis',
164 | 'Request' => 'Illuminate\Support\Facades\Request',
165 | 'Response' => 'Illuminate\Support\Facades\Response',
166 | 'Route' => 'Illuminate\Support\Facades\Route',
167 | 'Schema' => 'Illuminate\Support\Facades\Schema',
168 | 'Seeder' => 'Illuminate\Database\Seeder',
169 | 'Session' => 'Illuminate\Support\Facades\Session',
170 | 'SSH' => 'Illuminate\Support\Facades\SSH',
171 | 'Str' => 'Illuminate\Support\Str',
172 | 'URL' => 'Illuminate\Support\Facades\URL',
173 | 'Validator' => 'Illuminate\Support\Facades\Validator',
174 | 'View' => 'Illuminate\Support\Facades\View',
175 |
176 | ),
177 |
178 | );
179 |
--------------------------------------------------------------------------------
/app/config/auth.php:
--------------------------------------------------------------------------------
1 | 'eloquent',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Authentication Model
23 | |--------------------------------------------------------------------------
24 | |
25 | | When using the "Eloquent" authentication driver, we need to know which
26 | | Eloquent model should be used to retrieve your users. Of course, it
27 | | is often just the "User" model but you may use whatever you like.
28 | |
29 | */
30 |
31 | 'model' => 'User',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Authentication Table
36 | |--------------------------------------------------------------------------
37 | |
38 | | When using the "Database" authentication driver, we need to know which
39 | | table should be used to retrieve your users. We have chosen a basic
40 | | default value but you may easily change it to any table you like.
41 | |
42 | */
43 |
44 | 'table' => 'users',
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Password Reminder Settings
49 | |--------------------------------------------------------------------------
50 | |
51 | | Here you may set the settings for password reminders, including a view
52 | | that should be used as your password reminder e-mail. You will also
53 | | be able to set the name of the table that holds the reset tokens.
54 | |
55 | | The "expire" time is the number of minutes that the reminder should be
56 | | considered valid. This security feature keeps tokens short-lived so
57 | | they have less time to be guessed. You may change this as needed.
58 | |
59 | */
60 |
61 | 'reminder' => array(
62 |
63 | 'email' => 'emails.auth.reminder',
64 |
65 | 'table' => 'password_reminders',
66 |
67 | 'expire' => 60,
68 |
69 | ),
70 |
71 | );
72 |
--------------------------------------------------------------------------------
/app/config/cache.php:
--------------------------------------------------------------------------------
1 | 'file',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | File Cache Location
23 | |--------------------------------------------------------------------------
24 | |
25 | | When using the "file" cache driver, we need a location where the cache
26 | | files may be stored. A sensible default has been specified, but you
27 | | are free to change it to any other place on disk that you desire.
28 | |
29 | */
30 |
31 | 'path' => storage_path().'/cache',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Database Cache Connection
36 | |--------------------------------------------------------------------------
37 | |
38 | | When using the "database" cache driver you may specify the connection
39 | | that should be used to store the cached items. When this option is
40 | | null the default database connection will be utilized for cache.
41 | |
42 | */
43 |
44 | 'connection' => null,
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Database Cache Table
49 | |--------------------------------------------------------------------------
50 | |
51 | | When using the "database" cache driver we need to know the table that
52 | | should be used to store the cached items. A default table name has
53 | | been provided but you're free to change it however you deem fit.
54 | |
55 | */
56 |
57 | 'table' => 'cache',
58 |
59 | /*
60 | |--------------------------------------------------------------------------
61 | | Memcached Servers
62 | |--------------------------------------------------------------------------
63 | |
64 | | Now you may specify an array of your Memcached servers that should be
65 | | used when utilizing the Memcached cache driver. All of the servers
66 | | should contain a value for "host", "port", and "weight" options.
67 | |
68 | */
69 |
70 | 'memcached' => array(
71 |
72 | array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
73 |
74 | ),
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | Cache Key Prefix
79 | |--------------------------------------------------------------------------
80 | |
81 | | When utilizing a RAM based store such as APC or Memcached, there might
82 | | be other applications utilizing the same cache. So, we'll specify a
83 | | value to get prefixed to all our keys so we can avoid collisions.
84 | |
85 | */
86 |
87 | 'prefix' => 'laravel',
88 |
89 | );
90 |
--------------------------------------------------------------------------------
/app/config/compile.php:
--------------------------------------------------------------------------------
1 | PDO::FETCH_CLASS,
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Default Database Connection Name
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may specify which of the database connections below you wish
24 | | to use as your default connection for all database work. Of course
25 | | you may use many connections at once using the Database library.
26 | |
27 | */
28 |
29 | 'default' => 'mysql',
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Database Connections
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here are each of the database connections setup for your application.
37 | | Of course, examples of configuring each database platform that is
38 | | supported by Laravel is shown below to make development simple.
39 | |
40 | |
41 | | All database work in Laravel is done through the PHP PDO facilities
42 | | so make sure you have the driver for your particular database of
43 | | choice installed on your machine before you begin development.
44 | |
45 | */
46 |
47 | 'connections' => array(
48 |
49 | 'sqlite' => array(
50 | 'driver' => 'sqlite',
51 | 'database' => __DIR__.'/../database/production.sqlite',
52 | 'prefix' => '',
53 | ),
54 |
55 | 'mysql' => array(
56 | 'driver' => 'mysql',
57 | 'host' => 'localhost',
58 | 'database' => 'database',
59 | 'username' => 'root',
60 | 'password' => '',
61 | 'charset' => 'utf8',
62 | 'collation' => 'utf8_unicode_ci',
63 | 'prefix' => '',
64 | ),
65 |
66 | 'pgsql' => array(
67 | 'driver' => 'pgsql',
68 | 'host' => 'localhost',
69 | 'database' => 'database',
70 | 'username' => 'root',
71 | 'password' => '',
72 | 'charset' => 'utf8',
73 | 'prefix' => '',
74 | 'schema' => 'public',
75 | ),
76 |
77 | 'sqlsrv' => array(
78 | 'driver' => 'sqlsrv',
79 | 'host' => 'localhost',
80 | 'database' => 'database',
81 | 'username' => 'root',
82 | 'password' => '',
83 | 'prefix' => '',
84 | ),
85 |
86 | ),
87 |
88 | /*
89 | |--------------------------------------------------------------------------
90 | | Migration Repository Table
91 | |--------------------------------------------------------------------------
92 | |
93 | | This table keeps track of all the migrations that have already run for
94 | | your application. Using this information, we can determine which of
95 | | the migrations on disk haven't actually been run in the database.
96 | |
97 | */
98 |
99 | 'migrations' => 'migrations',
100 |
101 | /*
102 | |--------------------------------------------------------------------------
103 | | Redis Databases
104 | |--------------------------------------------------------------------------
105 | |
106 | | Redis is an open source, fast, and advanced key-value store that also
107 | | provides a richer set of commands than a typical key-value systems
108 | | such as APC or Memcached. Laravel makes it easy to dig right in.
109 | |
110 | */
111 |
112 | 'redis' => array(
113 |
114 | 'cluster' => false,
115 |
116 | 'default' => array(
117 | 'host' => '127.0.0.1',
118 | 'port' => 6379,
119 | 'database' => 0,
120 | ),
121 |
122 | ),
123 |
124 | );
125 |
--------------------------------------------------------------------------------
/app/config/mail.php:
--------------------------------------------------------------------------------
1 | 'smtp',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | SMTP Host Address
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may provide the host address of the SMTP server used by your
26 | | applications. A default option is provided that is compatible with
27 | | the Postmark mail service, which will provide reliable delivery.
28 | |
29 | */
30 |
31 | 'host' => 'smtp.mailgun.org',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | SMTP Host Port
36 | |--------------------------------------------------------------------------
37 | |
38 | | This is the SMTP port used by your application to delivery e-mails to
39 | | users of your application. Like the host we have set this value to
40 | | stay compatible with the Postmark e-mail application by default.
41 | |
42 | */
43 |
44 | 'port' => 587,
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Global "From" Address
49 | |--------------------------------------------------------------------------
50 | |
51 | | You may wish for all e-mails sent by your application to be sent from
52 | | the same address. Here, you may specify a name and address that is
53 | | used globally for all e-mails that are sent by your application.
54 | |
55 | */
56 |
57 | 'from' => array('address' => null, 'name' => null),
58 |
59 | /*
60 | |--------------------------------------------------------------------------
61 | | E-Mail Encryption Protocol
62 | |--------------------------------------------------------------------------
63 | |
64 | | Here you may specify the encryption protocol that should be used when
65 | | the application send e-mail messages. A sensible default using the
66 | | transport layer security protocol should provide great security.
67 | |
68 | */
69 |
70 | 'encryption' => 'tls',
71 |
72 | /*
73 | |--------------------------------------------------------------------------
74 | | SMTP Server Username
75 | |--------------------------------------------------------------------------
76 | |
77 | | If your SMTP server requires a username for authentication, you should
78 | | set it here. This will get used to authenticate with your server on
79 | | connection. You may also set the "password" value below this one.
80 | |
81 | */
82 |
83 | 'username' => null,
84 |
85 | /*
86 | |--------------------------------------------------------------------------
87 | | SMTP Server Password
88 | |--------------------------------------------------------------------------
89 | |
90 | | Here you may set the password required by your SMTP server to send out
91 | | messages from your application. This will be given to the server on
92 | | connection so that the application will be able to send messages.
93 | |
94 | */
95 |
96 | 'password' => null,
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Sendmail System Path
101 | |--------------------------------------------------------------------------
102 | |
103 | | When using the "sendmail" driver to send e-mails, we will need to know
104 | | the path to where Sendmail lives on this server. A default path has
105 | | been provided here, which will work well on most of your systems.
106 | |
107 | */
108 |
109 | 'sendmail' => '/usr/sbin/sendmail -bs',
110 |
111 | /*
112 | |--------------------------------------------------------------------------
113 | | Mail "Pretend"
114 | |--------------------------------------------------------------------------
115 | |
116 | | When this option is enabled, e-mail will not actually be sent over the
117 | | web and will instead be written to your application's logs files so
118 | | you may inspect the message. This is great for local development.
119 | |
120 | */
121 |
122 | 'pretend' => false,
123 |
124 | );
--------------------------------------------------------------------------------
/app/config/packages/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrcasual/nested-sets-laravel-jquery/497b41b425a5508835aed4d2e2fee9842aecfb98/app/config/packages/.gitkeep
--------------------------------------------------------------------------------
/app/config/queue.php:
--------------------------------------------------------------------------------
1 | 'sync',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Queue Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may configure the connection information for each server that
26 | | is used by your application. A default configuration has been added
27 | | for each back-end shipped with Laravel. You are free to add more.
28 | |
29 | */
30 |
31 | 'connections' => array(
32 |
33 | 'sync' => array(
34 | 'driver' => 'sync',
35 | ),
36 |
37 | 'beanstalkd' => array(
38 | 'driver' => 'beanstalkd',
39 | 'host' => 'localhost',
40 | 'queue' => 'default',
41 | ),
42 |
43 | 'sqs' => array(
44 | 'driver' => 'sqs',
45 | 'key' => 'your-public-key',
46 | 'secret' => 'your-secret-key',
47 | 'queue' => 'your-queue-url',
48 | 'region' => 'us-east-1',
49 | ),
50 |
51 | 'iron' => array(
52 | 'driver' => 'iron',
53 | 'project' => 'your-project-id',
54 | 'token' => 'your-token',
55 | 'queue' => 'your-queue-name',
56 | ),
57 |
58 | 'redis' => array(
59 | 'driver' => 'redis',
60 | 'queue' => 'default',
61 | ),
62 |
63 | ),
64 |
65 | /*
66 | |--------------------------------------------------------------------------
67 | | Failed Queue Jobs
68 | |--------------------------------------------------------------------------
69 | |
70 | | These options configure the behavior of failed queue job logging so you
71 | | can control which database and table are used to store the jobs that
72 | | have failed. You may change them to any database / table you wish.
73 | |
74 | */
75 |
76 | 'failed' => array(
77 |
78 | 'database' => 'mysql', 'table' => 'failed_jobs',
79 |
80 | ),
81 |
82 | );
83 |
--------------------------------------------------------------------------------
/app/config/remote.php:
--------------------------------------------------------------------------------
1 | 'production',
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Remote Server Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | These are the servers that will be accessible via the SSH task runner
24 | | facilities of Laravel. This feature radically simplifies executing
25 | | tasks on your servers, such as deploying out these applications.
26 | |
27 | */
28 |
29 | 'connections' => array(
30 |
31 | 'production' => array(
32 | 'host' => '',
33 | 'username' => '',
34 | 'password' => '',
35 | 'key' => '',
36 | 'keyphrase' => '',
37 | 'root' => '/var/www',
38 | ),
39 |
40 | ),
41 |
42 | /*
43 | |--------------------------------------------------------------------------
44 | | Remote Server Groups
45 | |--------------------------------------------------------------------------
46 | |
47 | | Here you may list connections under a single group name, which allows
48 | | you to easily access all of the servers at once using a short name
49 | | that is extremely easy to remember, such as "web" or "database".
50 | |
51 | */
52 |
53 | 'groups' => array(
54 |
55 | 'web' => array('production')
56 |
57 | ),
58 |
59 | );
--------------------------------------------------------------------------------
/app/config/session.php:
--------------------------------------------------------------------------------
1 | 'file',
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Session Lifetime
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may specify the number of minutes that you wish the session
27 | | to be allowed to remain idle before it expires. If you want them
28 | | to immediately expire on the browser closing, set that option.
29 | |
30 | */
31 |
32 | 'lifetime' => 120,
33 |
34 | 'expire_on_close' => false,
35 |
36 | /*
37 | |--------------------------------------------------------------------------
38 | | Session File Location
39 | |--------------------------------------------------------------------------
40 | |
41 | | When using the native session driver, we need a location where session
42 | | files may be stored. A default has been set for you but a different
43 | | location may be specified. This is only needed for file sessions.
44 | |
45 | */
46 |
47 | 'files' => storage_path().'/sessions',
48 |
49 | /*
50 | |--------------------------------------------------------------------------
51 | | Session Database Connection
52 | |--------------------------------------------------------------------------
53 | |
54 | | When using the "database" or "redis" session drivers, you may specify a
55 | | connection that should be used to manage these sessions. This should
56 | | correspond to a connection in your database configuration options.
57 | |
58 | */
59 |
60 | 'connection' => null,
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Session Database Table
65 | |--------------------------------------------------------------------------
66 | |
67 | | When using the "database" session driver, you may specify the table we
68 | | should use to manage the sessions. Of course, a sensible default is
69 | | provided for you; however, you are free to change this as needed.
70 | |
71 | */
72 |
73 | 'table' => 'sessions',
74 |
75 | /*
76 | |--------------------------------------------------------------------------
77 | | Session Sweeping Lottery
78 | |--------------------------------------------------------------------------
79 | |
80 | | Some session drivers must manually sweep their storage location to get
81 | | rid of old sessions from storage. Here are the chances that it will
82 | | happen on a given request. By default, the odds are 2 out of 100.
83 | |
84 | */
85 |
86 | 'lottery' => array(2, 100),
87 |
88 | /*
89 | |--------------------------------------------------------------------------
90 | | Session Cookie Name
91 | |--------------------------------------------------------------------------
92 | |
93 | | Here you may change the name of the cookie used to identify a session
94 | | instance by ID. The name specified here will get used every time a
95 | | new session cookie is created by the framework for every driver.
96 | |
97 | */
98 |
99 | 'cookie' => 'laravel_session',
100 |
101 | /*
102 | |--------------------------------------------------------------------------
103 | | Session Cookie Path
104 | |--------------------------------------------------------------------------
105 | |
106 | | The session cookie path determines the path for which the cookie will
107 | | be regarded as available. Typically, this will be the root path of
108 | | your application but you are free to change this when necessary.
109 | |
110 | */
111 |
112 | 'path' => '/',
113 |
114 | /*
115 | |--------------------------------------------------------------------------
116 | | Session Cookie Domain
117 | |--------------------------------------------------------------------------
118 | |
119 | | Here you may change the domain of the cookie used to identify a session
120 | | in your application. This will determine which domains the cookie is
121 | | available to in your application. A sensible default has been set.
122 | |
123 | */
124 |
125 | 'domain' => null,
126 |
127 | /*
128 | |--------------------------------------------------------------------------
129 | | HTTPS Only Cookies
130 | |--------------------------------------------------------------------------
131 | |
132 | | By setting this option to true, session cookies will only be sent back
133 | | to the server if the browser has a HTTPS connection. This will keep
134 | | the cookie from being sent to you if it can not be done securely.
135 | |
136 | */
137 |
138 | 'secure' => false,
139 |
140 | );
141 |
--------------------------------------------------------------------------------
/app/config/testing/cache.php:
--------------------------------------------------------------------------------
1 | 'array',
19 |
20 | );
--------------------------------------------------------------------------------
/app/config/testing/session.php:
--------------------------------------------------------------------------------
1 | 'array',
20 |
21 | );
--------------------------------------------------------------------------------
/app/config/view.php:
--------------------------------------------------------------------------------
1 | array(__DIR__.'/../views'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Pagination View
21 | |--------------------------------------------------------------------------
22 | |
23 | | This view will be used to render the pagination link output, and can
24 | | be easily customized here to show any view you like. A clean view
25 | | compatible with Twitter's Bootstrap is given to you by default.
26 | |
27 | */
28 |
29 | 'pagination' => 'pagination::slider-3',
30 |
31 | );
32 |
--------------------------------------------------------------------------------
/app/config/workbench.php:
--------------------------------------------------------------------------------
1 | '',
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Workbench Author E-Mail Address
21 | |--------------------------------------------------------------------------
22 | |
23 | | Like the option above, your e-mail address is used when generating new
24 | | workbench packages. The e-mail is placed in your composer.json file
25 | | automatically after the package is created by the workbench tool.
26 | |
27 | */
28 |
29 | 'email' => '',
30 |
31 | );
--------------------------------------------------------------------------------
/app/controllers/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrcasual/nested-sets-laravel-jquery/497b41b425a5508835aed4d2e2fee9842aecfb98/app/controllers/.gitkeep
--------------------------------------------------------------------------------
/app/controllers/BaseController.php:
--------------------------------------------------------------------------------
1 | layout))
13 | {
14 | $this->layout = View::make($this->layout);
15 | }
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/app/controllers/HomeController.php:
--------------------------------------------------------------------------------
1 | beforeFilter(function()
12 | {
13 | $this->request = (object) Input::all();
14 | if ( ! Request::ajax() ||
15 | ! in_array($this->request->action, ["addCategory", "deleteCategory", "renameCategory", "moveCategory"]) ||
16 | (\Validator::make(['name' => $this->request->name], ["name" => ["required", "regex:/^[\w\p{Cyrillic}\040,.-_']+$/u"]])->fails())
17 | ) App::abort(405);
18 |
19 | }, ["on" => "post"]);
20 | }
21 |
22 | public function getIndex()
23 | {
24 | $categories = Category::withoutRoot()->get(['id', 'title as label', '_lft', '_rgt', 'parent_id'])->toTree();
25 | return View::make("mrc.category")->with("categoriesData", $categories);
26 | }
27 |
28 | public function postIndex()
29 | {
30 | // start transaction
31 | DB::beginTransaction();
32 |
33 | switch($this->request->action) {
34 |
35 | case "renameCategory":
36 | $status = Category::where("title", $this->request->originalname)
37 | ->where("id", $this->request->id)
38 | ->update(["title" => $this->request->name]);
39 | break;
40 |
41 | case "addCategory":
42 | $sourceCategory = new Category(['title' => $this->request->name]);
43 | $targetCategory = Category::root();
44 |
45 | // append category to root
46 | if ( $status = $sourceCategory->appendTo($targetCategory)->save() ) {
47 | DB::commit();
48 | return ["id" => $sourceCategory->id, "parent_id" => $sourceCategory->parent_id];
49 | }
50 | break;
51 |
52 | case "deleteCategory":
53 | try {
54 | $category = Category::where("title", $this->request->name)
55 | ->where("id", $this->request->id)
56 | ->firstOrFail();
57 | $status = $category->delete();
58 | } catch (\Exception $e) {
59 | $status = false;
60 | }
61 | break;
62 |
63 | case "moveCategory":
64 | // get source/target categories from DB
65 | $sourceCategory = Category::find($this->request->id);
66 | $targetCategory = Category::find($this->request->to);
67 |
68 | // check for data consistency (can also do a try&catch instead)
69 | if ($sourceCategory && $targetCategory && ($sourceCategory->parent_id == $this->request->parent_id)) {
70 | switch ($this->request->direction) {
71 | case "inside" :
72 | $status = $sourceCategory->prependTo($targetCategory)->save();
73 | break;
74 | case "before" :
75 | $status = $sourceCategory->before($targetCategory)->save();
76 | break;
77 | case "after" :
78 | $status = $sourceCategory->after($targetCategory)->save();
79 | break;
80 | }
81 | }
82 | break;
83 | }
84 | if (!isset($status) || $status == null) { DB::rollback(); App::abort(400); }
85 | DB::commit();
86 | }
87 |
88 | }
--------------------------------------------------------------------------------
/app/database/migrations/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrcasual/nested-sets-laravel-jquery/497b41b425a5508835aed4d2e2fee9842aecfb98/app/database/migrations/.gitkeep
--------------------------------------------------------------------------------
/app/database/migrations/2014_01_17_003928_create_category_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('title');
19 | $table->timestamps();
20 | NestedSet::columns($table);
21 | });
22 |
23 | // The root node is required
24 | NestedSet::createRoot('mrc_category', array(
25 | 'title' => 'Root',
26 | ));
27 | }
28 |
29 | /**
30 | * Reverse the migrations.
31 | *
32 | * @return void
33 | */
34 | public function down()
35 | {
36 | Schema::drop('mrc_category');
37 | }
38 | }
--------------------------------------------------------------------------------
/app/database/production.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrcasual/nested-sets-laravel-jquery/497b41b425a5508835aed4d2e2fee9842aecfb98/app/database/production.sqlite
--------------------------------------------------------------------------------
/app/database/seeds/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrcasual/nested-sets-laravel-jquery/497b41b425a5508835aed4d2e2fee9842aecfb98/app/database/seeds/.gitkeep
--------------------------------------------------------------------------------
/app/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call('UserTableSeeder');
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/app/filters.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 |
18 | 'next' => 'Next »',
19 |
20 | );
--------------------------------------------------------------------------------
/app/lang/en/reminders.php:
--------------------------------------------------------------------------------
1 | "Passwords must be at least six characters and match the confirmation.",
17 |
18 | "user" => "We can't find a user with that e-mail address.",
19 |
20 | "token" => "This password reset token is invalid.",
21 |
22 | "sent" => "Password reminder sent!",
23 |
24 | );
25 |
--------------------------------------------------------------------------------
/app/lang/en/validation.php:
--------------------------------------------------------------------------------
1 | "The :attribute must be accepted.",
17 | "active_url" => "The :attribute is not a valid URL.",
18 | "after" => "The :attribute must be a date after :date.",
19 | "alpha" => "The :attribute may only contain letters.",
20 | "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.",
21 | "alpha_num" => "The :attribute may only contain letters and numbers.",
22 | "array" => "The :attribute must be an array.",
23 | "before" => "The :attribute must be a date before :date.",
24 | "between" => array(
25 | "numeric" => "The :attribute must be between :min and :max.",
26 | "file" => "The :attribute must be between :min and :max kilobytes.",
27 | "string" => "The :attribute must be between :min and :max characters.",
28 | "array" => "The :attribute must have between :min and :max items.",
29 | ),
30 | "confirmed" => "The :attribute confirmation does not match.",
31 | "date" => "The :attribute is not a valid date.",
32 | "date_format" => "The :attribute does not match the format :format.",
33 | "different" => "The :attribute and :other must be different.",
34 | "digits" => "The :attribute must be :digits digits.",
35 | "digits_between" => "The :attribute must be between :min and :max digits.",
36 | "email" => "The :attribute format is invalid.",
37 | "exists" => "The selected :attribute is invalid.",
38 | "image" => "The :attribute must be an image.",
39 | "in" => "The selected :attribute is invalid.",
40 | "integer" => "The :attribute must be an integer.",
41 | "ip" => "The :attribute must be a valid IP address.",
42 | "max" => array(
43 | "numeric" => "The :attribute may not be greater than :max.",
44 | "file" => "The :attribute may not be greater than :max kilobytes.",
45 | "string" => "The :attribute may not be greater than :max characters.",
46 | "array" => "The :attribute may not have more than :max items.",
47 | ),
48 | "mimes" => "The :attribute must be a file of type: :values.",
49 | "min" => array(
50 | "numeric" => "The :attribute must be at least :min.",
51 | "file" => "The :attribute must be at least :min kilobytes.",
52 | "string" => "The :attribute must be at least :min characters.",
53 | "array" => "The :attribute must have at least :min items.",
54 | ),
55 | "not_in" => "The selected :attribute is invalid.",
56 | "numeric" => "The :attribute must be a number.",
57 | "regex" => "The :attribute format is invalid.",
58 | "required" => "The :attribute field is required.",
59 | "required_if" => "The :attribute field is required when :other is :value.",
60 | "required_with" => "The :attribute field is required when :values is present.",
61 | "required_without" => "The :attribute field is required when :values is not present.",
62 | "same" => "The :attribute and :other must match.",
63 | "size" => array(
64 | "numeric" => "The :attribute must be :size.",
65 | "file" => "The :attribute must be :size kilobytes.",
66 | "string" => "The :attribute must be :size characters.",
67 | "array" => "The :attribute must contain :size items.",
68 | ),
69 | "unique" => "The :attribute has already been taken.",
70 | "url" => "The :attribute format is invalid.",
71 |
72 | /*
73 | |--------------------------------------------------------------------------
74 | | Custom Validation Language Lines
75 | |--------------------------------------------------------------------------
76 | |
77 | | Here you may specify custom validation messages for attributes using the
78 | | convention "attribute.rule" to name the lines. This makes it quick to
79 | | specify a specific custom language line for a given attribute rule.
80 | |
81 | */
82 |
83 | 'custom' => array(),
84 |
85 | /*
86 | |--------------------------------------------------------------------------
87 | | Custom Validation Attributes
88 | |--------------------------------------------------------------------------
89 | |
90 | | The following language lines are used to swap attribute place-holders
91 | | with something more reader friendly such as E-Mail Address instead
92 | | of "email". This simply helps us make messages a little cleaner.
93 | |
94 | */
95 |
96 | 'attributes' => array(),
97 |
98 | );
99 |
--------------------------------------------------------------------------------
/app/models/User.php:
--------------------------------------------------------------------------------
1 | getKey();
30 | }
31 |
32 | /**
33 | * Get the password for the user.
34 | *
35 | * @return string
36 | */
37 | public function getAuthPassword()
38 | {
39 | return $this->password;
40 | }
41 |
42 | /**
43 | * Get the e-mail address where password reminders are sent.
44 | *
45 | * @return string
46 | */
47 | public function getReminderEmail()
48 | {
49 | return $this->email;
50 | }
51 |
52 | }
--------------------------------------------------------------------------------
/app/models/mrc/Category.php:
--------------------------------------------------------------------------------
1 | client->request('GET', '/');
13 |
14 | $this->assertTrue($this->client->getResponse()->isOk());
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/app/tests/TestCase.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Password Reset
8 |
9 |
10 | To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}.
11 |
",
40 | log : "{{message}}"
41 | };
42 |
43 | /**
44 | * Return the proper transitionend event
45 | * @return {String} Transition type string
46 | */
47 | getTransitionEvent = function () {
48 | var t,
49 | type,
50 | supported = false,
51 | el = document.createElement("fakeelement"),
52 | transitions = {
53 | "WebkitTransition" : "webkitTransitionEnd",
54 | "MozTransition" : "transitionend",
55 | "OTransition" : "otransitionend",
56 | "transition" : "transitionend"
57 | };
58 |
59 | for (t in transitions) {
60 | if (el.style[t] !== undefined) {
61 | type = transitions[t];
62 | supported = true;
63 | break;
64 | }
65 | }
66 |
67 | return {
68 | type : type,
69 | supported : supported
70 | };
71 | };
72 |
73 | /**
74 | * Shorthand for document.getElementById()
75 | *
76 | * @param {String} id A specific element ID
77 | * @return {Object} HTML element
78 | */
79 | $ = function (id) {
80 | return document.getElementById(id);
81 | };
82 |
83 | /**
84 | * Alertify private object
85 | * @type {Object}
86 | */
87 | _alertify = {
88 |
89 | /**
90 | * Labels object
91 | * @type {Object}
92 | */
93 | labels : {
94 | ok : "OK",
95 | cancel : "Cancel"
96 | },
97 |
98 | /**
99 | * Delay number
100 | * @type {Number}
101 | */
102 | delay : 5000,
103 |
104 | /**
105 | * Whether buttons are reversed (default is secondary/primary)
106 | * @type {Boolean}
107 | */
108 | buttonReverse : false,
109 |
110 | /**
111 | * Which button should be focused by default
112 | * @type {String} "ok" (default), "cancel", or "none"
113 | */
114 | buttonFocus : "ok",
115 |
116 | /**
117 | * Set the transition event on load
118 | * @type {[type]}
119 | */
120 | transition : undefined,
121 |
122 | /**
123 | * Set the proper button click events
124 | *
125 | * @param {Function} fn [Optional] Callback function
126 | *
127 | * @return {undefined}
128 | */
129 | addListeners : function (fn) {
130 | var hasOK = (typeof btnOK !== "undefined"),
131 | hasCancel = (typeof btnCancel !== "undefined"),
132 | hasInput = (typeof input !== "undefined"),
133 | val = "",
134 | self = this,
135 | ok, cancel, common, key, reset;
136 |
137 | // ok event handler
138 | ok = function (event) {
139 | if (typeof event.preventDefault !== "undefined") event.preventDefault();
140 | common(event);
141 | if (typeof input !== "undefined") val = input.value;
142 | if (typeof fn === "function") {
143 | if (typeof input !== "undefined") {
144 | fn(true, val);
145 | }
146 | else fn(true);
147 | }
148 | return false;
149 | };
150 |
151 | // cancel event handler
152 | cancel = function (event) {
153 | if (typeof event.preventDefault !== "undefined") event.preventDefault();
154 | common(event);
155 | if (typeof fn === "function") fn(false);
156 | return false;
157 | };
158 |
159 | // common event handler (keyup, ok and cancel)
160 | common = function (event) {
161 | self.hide();
162 | self.unbind(document.body, "keyup", key);
163 | self.unbind(btnReset, "focus", reset);
164 | if (hasOK) self.unbind(btnOK, "click", ok);
165 | if (hasCancel) self.unbind(btnCancel, "click", cancel);
166 | };
167 |
168 | // keyup handler
169 | key = function (event) {
170 | var keyCode = event.keyCode;
171 | if ((keyCode === keys.SPACE && !hasInput) || (hasInput && keyCode === keys.ENTER)) ok(event);
172 | if (keyCode === keys.ESC && hasCancel) cancel(event);
173 | };
174 |
175 | // reset focus to first item in the dialog
176 | reset = function (event) {
177 | if (hasInput) input.focus();
178 | else if (!hasCancel || self.buttonReverse) btnOK.focus();
179 | else btnCancel.focus();
180 | };
181 |
182 | // handle reset focus link
183 | // this ensures that the keyboard focus does not
184 | // ever leave the dialog box until an action has
185 | // been taken
186 | this.bind(btnReset, "focus", reset);
187 | this.bind(btnResetBack, "focus", reset);
188 | // handle OK click
189 | if (hasOK) this.bind(btnOK, "click", ok);
190 | // handle Cancel click
191 | if (hasCancel) this.bind(btnCancel, "click", cancel);
192 | // listen for keys, Cancel => ESC
193 | this.bind(document.body, "keyup", key);
194 | if (!this.transition.supported) {
195 | this.setFocus();
196 | }
197 | },
198 |
199 | /**
200 | * Bind events to elements
201 | *
202 | * @param {Object} el HTML Object
203 | * @param {Event} event Event to attach to element
204 | * @param {Function} fn Callback function
205 | *
206 | * @return {undefined}
207 | */
208 | bind : function (el, event, fn) {
209 | if (typeof el.addEventListener === "function") {
210 | el.addEventListener(event, fn, false);
211 | } else if (el.attachEvent) {
212 | el.attachEvent("on" + event, fn);
213 | }
214 | },
215 |
216 | /**
217 | * Use alertify as the global error handler (using window.onerror)
218 | *
219 | * @return {boolean} success
220 | */
221 | handleErrors : function () {
222 | if (typeof global.onerror !== "undefined") {
223 | var self = this;
224 | global.onerror = function (msg, url, line) {
225 | self.error("[" + msg + " on line " + line + " of " + url + "]", 0);
226 | };
227 | return true;
228 | } else {
229 | return false;
230 | }
231 | },
232 |
233 | /**
234 | * Append button HTML strings
235 | *
236 | * @param {String} secondary The secondary button HTML string
237 | * @param {String} primary The primary button HTML string
238 | *
239 | * @return {String} The appended button HTML strings
240 | */
241 | appendButtons : function (secondary, primary) {
242 | return this.buttonReverse ? primary + secondary : secondary + primary;
243 | },
244 |
245 | /**
246 | * Build the proper message box
247 | *
248 | * @param {Object} item Current object in the queue
249 | *
250 | * @return {String} An HTML string of the message box
251 | */
252 | build : function (item) {
253 | var html = "",
254 | type = item.type,
255 | message = item.message,
256 | css = item.cssClass || "";
257 |
258 | html += "
";
259 | html += "Reset Focus";
260 |
261 | if (_alertify.buttonFocus === "none") html += "";
262 |
263 | // doens't require an actual form
264 | if (type === "prompt") html += "
";
265 |
266 | html += "";
267 | html += dialogs.message.replace("{{message}}", message);
268 |
269 | if (type === "prompt") html += dialogs.input;
270 |
271 | html += dialogs.buttons.holder;
272 | html += "";
273 |
274 | if (type === "prompt") html += "
";
275 |
276 | html += "Reset Focus";
277 | html += "