Laravel - Eloquent - query many to many relationship
Example:
Table 1: posts
Table 2: categories
Pivot Table: category_post with foreign keys category_id, post_id
Laravel - Eloquent - query many to many relationship
Example:
Table 1: posts
Table 2: categories
Pivot Table: category_post with foreign keys category_id, post_id
Install git:
sudo apt-get install git
Configure Git:
touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"
git config --global user.email "Your Email"
#Laravel 5 Simple ACL manager
Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.
If the user has a 'Root' role, then they can perform any actions.
Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php
| function toCurrency(price) { | |
| return price.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
| } |
| /** | |
| * Description: | |
| * removes white space from text. useful for html values that cannot have spaces | |
| * Usage: | |
| * {{some_text | nospace}} | |
| */ | |
| app.filter('nospace', function () { | |
| return function (value) { | |
| return (!value) ? '' : value.replace(/ /g, ''); |
| Function.prototype.compose = function(argFunction) { | |
| var invokingFunction = this; | |
| return function() { | |
| return invokingFunction.call(this, argFunction.apply(this,arguments)); | |
| } | |
| } |
| $.fn.is_on_screen = function(){ | |
| var win = $(window); | |
| var viewport = { | |
| top : win.scrollTop(), | |
| left : win.scrollLeft() | |
| }; | |
| viewport.right = viewport.left + win.width(); | |
| viewport.bottom = viewport.top + win.height(); |
| $(window).on("scroll", function() { | |
| var scrollHeight = $(document).height(); | |
| var scrollPosition = $(window).height() + $(window).scrollTop(); | |
| if ((scrollHeight - scrollPosition) / scrollHeight === 0) { | |
| // when scroll to bottom of the page | |
| } | |
| }); |
| =======[ Media Queries - default media query break points ]======= | |
| @media(max-width:767px) { | |
| } | |
| @media(min-width:768px) { | |
| } | |
| @media(min-width:992px) { | |
| =======[ Media Queries - default media query break points ]======= | |
| @media(max-width:767px) { | |
| } | |
| @media(min-width:768px) { | |
| } | |
| @media(min-width:992px) { | |