Skip to main content

Posts

Showing posts from 2017

Getting Started with Laravel 5.4 with sample CURD

/* |----------------------------------------------------------------------------- | Getting Started with Laravel 5.4 |----------------------------------------------------------------------------- | | Laravel 5.4 has more features and Laravel is a free, open-source PHP web  | framework, created by Taylor Otwell and intended for the development of  | web applications following the model–view–controller (MVC) architectural pattern. | */ Database: Migrations #Generating Migrations ---------------------------- To create a migration, use the make:migration Artisan command: Syntax: php artisan make:migration create_users_table The new migration will be placed in your database/migrations directory. Each migration file name contains a timestamp which allows Laravel to determine the order of the migrations. Example: vagrant@homestead:~/sample$ php artisan make:migration create_student_table    Created Migration: 2017_08_01_044007_create_student_table ------------

PHP Artisan Commands

Laravel Framework 5.4.30 Usage: -------------------------   command [options] [arguments] Options: -------------------------   -h, --help            Display this help message   -q, --quiet           Do not output any message   -V, --version         Display this application version       --ansi            Force ANSI output       --no-ansi         Disable ANSI output   -n, --no-interaction  Do not ask any interactive question       --env[=ENV]       The environment the command should run under   -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Available commands: -------------------------   clear-compiled       Remove the compiled class file   down                 Put the application into maintenance mode   env                  Display the current framework environment   help                 Displays help for a command   inspire              Display an inspiring quote   list                 L

Issues Fixed in Laravel

-------------------------------------------------------------------------------------- 1. Missing routes.php File in New Laravel Project -------------------------------------------------------------------------------------- The lastest version of Laravel doesn't have a routes.php file. This 'routes.php' file was located in \app\Http in the older versions. In the newer version, Laravel 5.3, we have a folder named 'routes', where we can find the following files: api.php console.php web.php For this new version, the routes for your controllers, you can put inside web.php file See the documentation about routing here https://laravel.com/docs/5.3/routing#basic-routing The video lesson you are watching may be outdated. -------------------------------------------------------------------------------------- 2. Could not open input file: artisan -------------------------------------------------------------------------------------- You need to first cr

Difference between laravel and codeigniter

Yeah of course both languages are doing good. we have some advantages and the disadvantages too. It also need look based on the requirements from the user and satisfication. condeigniter has the version 3 and laravel 5.4 versions. It just goes on with the updates and features. Any how some differences should be down here!. The difference between laravel and codeigniter features                                                     LARAVEL CODEIGNITER 1. ORM(Object Relational Mapper) -  yes                   - 2. Active record -  Yes                 Yes 3. Packaged module                            -  yes                 - 4. Routing                                   -  yes                  Yes 5. Inbuild user auth                        -  yes                  - 6. Inbuild captcha -   -                  yes 7. Template engine

Laravel Installation and Configuration

--------------------------------------- Installation --------------------------------------- ***If your using laravel then it's highly recommended that you use Homestead as your local Laravel  development environment: 1. The directory permissions will be set if your having the homestead 2. Application key should be 32 characters long and it can be set in .evn file 3. And need to rename the environment file (i.e) .evn.example file to .env    Note: if the application key doesn't set, your user sessions and other encrypted data will not be secure! A).  Additional Configuration cofiguration in config/app.php file It may contains serveral options such as timezone and locale a). The additional componants => Cache => Session => Database 4.  Web Server Configuration   #Pretty URLs    A). Nginx If you are using Nginx, the following directive in your site configuration will direct to the index.php frontend controller. Of course, when usi

Make the directory in php basic

/********************************************************************************/ /* TITLE : Make the directory in php basic /* DESCRIPTION : To Make the directory in php basic /* CREATED BY   : Jemiris Selvi S /* CREATED ON : 12-July-2017 /* MODIFIED BY : Jemiris Selvi S /* MODIFIED ON : 12-july-2017 /********************************************************************************/ To make the directory dynamically if the directory exists it will not be created, otherwise it will create the directory dynamically where this code have been used. <?php // Desired folder structure $structure = "http://localhost:70/test"; // To create the nested structure, the $recursive parameter // to mkdir() must be specified. if(!file_exists($structure)) { die("Failed to create the floders"); } else { mkdir('directory_name', 0777, true); echo "File created success"; } ?>

Fastest way to implode an associative array with keys

/********************************************************************************/ /* TITLE : Fastest way to implode an associative array with keys /* DESCRIPTION : To Get the details fastest way to implode an associative array with keys /* CREATED BY   : Jemiris Selvi S /* CREATED ON : 11-July-2017 /* MODIFIED BY : Jemiris Selvi S /* MODIFIED ON : 11-july-2017 /********************************************************************************/ <?php $attributes = array(     'data-href'   => 'http://example.com',     'data-width'  => '300',     'data-height' => '250',     'data-type'   => 'cover', ); $dataAttributes = array_map(function($value, $key) {     return $key.'="'.$value.'"'; }, array_values($attributes), array_keys($attributes)); $dataAttributes = implode(' ', $dataAttributes); ?> <div class="image-box"

Parse associative array to url in php

<?php $params = array ( ' query ' => ' something ' , ' page ' => 1 , ' items ' => 10 ); $url = ' http://someapi.com/search ' ; if ( count ( $params ) > 0 ) { $url .= ' ? ' . implode ( ' & ' , array_map ( function ( $item ) { return $item [ 0 ] . ' = ' . $item [ 1 ]; }, array_map ( null , array_keys ( $params ), $params ))); } echo $url ; // http://someapi.com/search?query=something&page=1&items=10 ? >

XAMPP - Port 80 in use by “Unable to open process” with PID 4! 12

down vote Open a CMD prompt and type in the command: net stop was /y Run Dialog Box (press keys  Win+R ) .. then type:  services.msc I then scrolled down to World Wide Web Publishing Service Double clicked on it and clicked STOP) (if this service status is Started) 3. Start Apache again with XAMPP :) Link Ref: http://www.sitepoint.com/unblock-port-80-on-windows-run-apache/ https://stackoverflow.com/questions/20558410/xampp-port-80-in-use-by-unable-to-open-process-with-pid-4-12

Logging In with ProcessMaker's WSDL Web Services

      login()  Web Service After instantiating a SOAP client object, then use the login() function to start a web services session in ProcessMaker: loginResponse login(string userid, string password) The userid is the name of the user and password is the user's password. Note that the function parameters for web service functions have to be passed as an associative array within an array. For instance, if the user ID is 'andy' and the password is 'foobar', then log in using the following script in PHP:      Example:    ini_set("soap.wsdl_cache_enabled", "0");       $client = new SoapClient($params['clientUrl']);    $values = array   (array('userid'=> 'admin', 'password'=> 'pass2017!'));    $result = $client->__SoapCall('login', $values);    $sessionId  = $result->message;    print_r($result->message);

Processmaker WSDL Web Services Functions

userList() returns a list of the users. For privileges to see the list, the user logged must have the PM_USERS permission in their role. userListResponse userList(string sessionId)   Parameters: string sessionId: The session ID, which was obtained during login Example: // get the users list   $user_values = array(array('sessionId'=> $sessionId));   $user_result  = $client->__SoapCall('userList', $user_values);  $data    = $user_result->users;  if(is_array($data))  {   foreach ($data as $user) {    print "$user->name and $user->guid\n";   }  }  else  {   print "$data->name\n";  } groupList() returns a list of the groups. For privileges to see the list, the user logged in must have the PM_USERS permission in their role. groupListResponse groupList(string sessionId) Parameters: string sessionId: The session ID, which was obtained during login. Example:  // get the

Calling a function within a Class method?

example 1 class TestClass { public function __call ( $name , $arg ){ call_user_func ( $name , $arg ); } } class test { public function newTest (){ function bigTest (){ echo 'Big Test Here' ; } function smallTest (){ echo 'Small Test Here' ; } $obj = new TestClass ; return $obj ; } } $rentry = new test ; $rentry -> newTest ()-> bigTest ();

The Processmaker 2.0 Version Backup the workflow

/* * The Processmaker 2.0 Version Backup the workflow */ D:\PM>cd processmaker D:\PM\processmaker>processmaker.bat workspace-backup workflow backup1.tar Backing up to D:/PM/processmaker/shared/backups/backup1.tar Backing up database... Saving database wf_workflow LOCK TABLES                                                               [OK] Dump of table additional_tables                                819 Bytes Saved Dump of table app_cache_view                                 13513 Bytes Saved Dump of table app_delay                                        334 Bytes Saved Dump of table app_delegation                                  8498 Bytes Saved Dump of table app_document                                   21590 Bytes Saved Dump of table app_event                                          0 Bytes Saved Dump of table app_folder                                      5163 Bytes Saved Dump of table app_history                                    14396 Bytes Saved