├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── composer.json ├── phpunit.xml ├── public └── js │ ├── AjaxisBootstrap.js │ └── AjaxisMaterialize.js ├── resources └── views │ ├── bootstrap │ ├── display │ │ └── body.blade.php │ ├── footer.blade.php │ ├── get │ │ ├── footer.blade.php │ │ └── head.blade.php │ ├── head.blade.php │ └── types │ │ ├── checkbox.blade.php │ │ ├── radio.blade.php │ │ ├── select.blade.php │ │ └── text.blade.php │ └── materialize │ ├── display │ └── body.blade.php │ ├── footer.blade.php │ ├── get │ ├── footer.blade.php │ └── head.blade.php │ ├── head.blade.php │ └── types │ ├── checkbox.blade.php │ ├── date.blade.php │ ├── radio.blade.php │ ├── select.blade.php │ └── text.blade.php ├── src ├── Ajaxis.php ├── AjaxisGenerate.php ├── AjaxisServiceProvider.php ├── Attributes │ └── Attributes.php ├── Autoarray │ └── AutoArray.php ├── Bootstrap │ └── Builders │ │ ├── BootstrapDeleteConfirmationMessage.php │ │ ├── BootstrapDisplayBuilder.php │ │ ├── BootstrapModalBuilder.php │ │ └── BootstrapText.php ├── Materialize │ └── Builders │ │ ├── MaterializeDeleteConfirmationMessage.php │ │ ├── MaterializeDisplayBuilder.php │ │ └── MaterializeModalBuilder.php └── Modal │ ├── Modal.php │ ├── ModalDirector.php │ └── ModalInterface.php └── tests ├── AjaxisTest.php └── TestCase.php /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | composer.lock 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | sudo: false 4 | 5 | php: 6 | - 5.5 7 | - 5.6 8 | - 7.0 9 | - hhvm 10 | 11 | env: 12 | - TESTBENCH_VERSION=3.2.* 13 | 14 | before_script: 15 | - travis_retry composer self-update 16 | - travis_retry composer require --prefer-source --no-interaction --dev "orchestra/testbench:${TESTBENCH_VERSION}" 17 | 18 | script: 19 | - composer validate 20 | - vendor/bin/phpunit 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Amrani Houssain 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Ajaxis PHP/Javascript package for laravel 2 | =================================== 3 | 4 | [![SensioLabsInsight](https://insight.sensiolabs.com/projects/de72e940-3c06-4664-b84c-425838cd68ea/big.png)](https://insight.sensiolabs.com/projects/de72e940-3c06-4664-b84c-425838cd68ea) 5 | 6 | [![Build Status](https://travis-ci.org/amranidev/ajaxis.svg?branch=master)](https://travis-ci.org/amranidev/ajaxis) 7 | [![StyleCI](https://styleci.io/repos/39261607/shield?style=flat)](https://styleci.io/repos/39261607) 8 | [![Latest Stable Version](https://poser.pugx.org/amranidev/ajaxis/v/stable)](https://packagist.org/packages/amranidev/ajaxis) [![Total Downloads](https://poser.pugx.org/amranidev/ajaxis/downloads)](https://packagist.org/packages/amranidev/ajaxis) 9 | [![Latest Unstable Version](https://poser.pugx.org/amranidev/ajaxis/v/unstable)](https://packagist.org/packages/amranidev/ajaxis) 10 | [![License](https://poser.pugx.org/amranidev/ajaxis/license)](https://packagist.org/packages/amranidev/ajaxis) 11 | 12 | ## Overview 13 | 14 | Ajaxis is a PHP package for laravel that work with javascript plugins for materialize and bootstrap. Ajaxis is used for managing CRUD model with AJAX using Materialize or Bootstrap Modals that can generate inputs (text, radio, checkbox, file,etc..) automatically. 15 | 16 | Ajaxis allows you to control your HTML inputs, APIs, CRUD methods, through a model controller and define just one HTML block to define your modal that Ajaxis can use it for all operations of CRUD managing. 17 | 18 | ## Contribution 19 | 20 | Any ideas are welcome. Feel free to submit any issues or pull requests. 21 | 22 | ## Contact : amranidev@gmail.com 23 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "amranidev/ajaxis", 3 | "description": "To manage your crud in laravel 5.1", 4 | "homepage": "http://github.com/amranidev/ajaxis", 5 | "keywords": ["laravel", "framework", "files", "Ajax", "Ajaxis", "laravel ajax post", "laravel ajax reqeust", "laravel ajax token", "Laravel ajax get", "laravel modals", "laravel ajax modal", "laravel bootstrap", "laravel materialize", "amranidev", "Amrani Houssain", "amrnaihoussain"], 6 | "license": "MIT", 7 | "authors": [{ 8 | "name": "Amrani Houssain", 9 | "email": "amranidev@gmail.com" 10 | }], 11 | "require": { 12 | "php": ">=5.5.0" 13 | }, 14 | "require-dev": { 15 | "phpunit/phpunit": "~4.0|~5.0", 16 | "orchestra/testbench": "~3.0" 17 | }, 18 | "autoload": { 19 | "psr-4": { 20 | "Amranidev\\Ajaxis\\": "src/" 21 | } 22 | }, 23 | "autoload-dev": { 24 | "psr-4": { 25 | "Amranidev\\Ajaxis\\Tests\\": "tests/" 26 | } 27 | }, 28 | "extra": { 29 | "branch-alias": { 30 | "dev-master": "3.1.x-dev" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/ 14 | 15 | 16 | 17 | 18 | ./src/ 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /public/js/AjaxisBootstrap.js: -------------------------------------------------------------------------------- 1 | /*| 2 | *| jQuery File Ajaxis Plugin for Bootstrap 3 | *| https://github.com/amranidev/ajaxis 4 | *| 5 | *| Copyright 2015, Amrani Houssain 6 | *| amranidev@gmail.com 7 | *| 8 | *| Licensed under the MIT license: 9 | *| http://www.opensource.org/licenses/MIT 10 | *| 11 | */ 12 | 13 | $(document).on('click', '.delete', function() { 14 | GET($(this).data('link')); 15 | }) 16 | $(document).on('click', '.edit', function() { 17 | GET($(this).data('link')); 18 | }) 19 | $(document).on('click', '.display', function() { 20 | GET($(this).data('link')); 21 | }) 22 | $(document).on('click', '.create', function() { 23 | GET($(this).data('link')); 24 | }) 25 | $(document).on('click', '.destroy', function() { 26 | $.ajax({ 27 | async: true, 28 | type: 'get', 29 | url: baseURL + $(this).data('link'), 30 | success: function(response) { 31 | window.location = response; 32 | } 33 | }) 34 | }) 35 | $(document).on('click', '.save', function() { 36 | POST($('#AjaxisForm').serializeArray(), $(this).data('link')); 37 | }) 38 | 39 | function GET(dataLink) { 40 | $.ajax({ 41 | async: true, 42 | type: 'get', 43 | url: baseURL + dataLink, 44 | success: function(response) { 45 | $('.AjaxisModal').html(response); 46 | } 47 | }) 48 | } 49 | 50 | function POST(postData, dataLink) { 51 | $.ajax({ 52 | async: true, 53 | type: 'post', 54 | url: baseURL + dataLink, 55 | data: postData, 56 | success: function(response) { 57 | window.location = response; 58 | } 59 | }) 60 | } -------------------------------------------------------------------------------- /public/js/AjaxisMaterialize.js: -------------------------------------------------------------------------------- 1 | /*| 2 | *| jQuery File Ajaxis Plugin for Materialize 3 | *| https://github.com/amranidev/ajaxis 4 | *| 5 | *| Copyright 2015, Amrani Houssain 6 | *| amranidev@gmail.com 7 | *| 8 | *| Licensed under the MIT license: 9 | *| http://www.opensource.org/licenses/MIT 10 | *| 11 | */ 12 | 13 | $(document).on('ready', function() { 14 | $('.modal-trigger').leanModal(); 15 | }); 16 | $(document).on("click", ".closeModal", function() { 17 | $(this).parent().parent().parent().parent().closeModal(); 18 | }); 19 | $(document).on('click', '.show', function() { 20 | GET($(this).data('link')); 21 | }) 22 | $('body').on('click', '.delete', function() { 23 | GET($(this).data('link')); 24 | }); 25 | $("body").on('click', '.edit', function() { 26 | GET($(this).data('link')); 27 | }) 28 | $(document).on("click", ".create", function() { 29 | GET($(this).data('link')); 30 | }) 31 | $(document).on("click", ".update", function(e) { 32 | e.preventDefault(); 33 | POST($(this).parent().parent().serializeArray(), $(this).data('link')); 34 | }); 35 | $(document).on("click", ".save", function() { 36 | POST($(this).parent().parent().serializeArray(), $(this).data('link')); 37 | }) 38 | 39 | $('body').on('click', '.remove', function() { 40 | $.ajax({ 41 | async: true, 42 | method: 'get', 43 | url: baseURL + $(this).data('link'), 44 | success: function(response) { 45 | window.location = response; 46 | } 47 | }); 48 | }); 49 | 50 | function POST(postData, dataLink) { 51 | $.ajax({ 52 | async: true, 53 | type: 'post', 54 | url: baseURL + dataLink, 55 | data: postData, 56 | success: function(response) { 57 | window.location = response; 58 | } 59 | }) 60 | } 61 | 62 | function GET(dataLink) { 63 | $.ajax({ 64 | async: true, 65 | type: 'get', 66 | url: baseURL + dataLink, 67 | success: function(response) { 68 | $('.AjaxisModal').html(response); 69 | $('select').material_select(); 70 | $('.datepicker').pickadate({ 71 | selectMonths: true, 72 | selectYears: 15 73 | }); 74 | } 75 | }) 76 | } 77 | -------------------------------------------------------------------------------- /resources/views/bootstrap/display/body.blade.php: -------------------------------------------------------------------------------- 1 | 2 | @foreach ($input as $value) 3 | 4 | 5 | @endforeach 6 |

{{$value['key']}}

{{$value['value']}}

7 | -------------------------------------------------------------------------------- /resources/views/bootstrap/footer.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /resources/views/bootstrap/get/footer.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /resources/views/bootstrap/get/head.blade.php: -------------------------------------------------------------------------------- 1 |