Know How To Use SQLite In Ionic 2

Know How To Use SQLite In Ionic 2

Ionic 2

Ionic 2 is the upgraded version of ionic 1 and it has a lot of differences in it than the earlier one. Typescripts are introduced in this as well. Some new components are also included in ionic 2.

Let’s talk about the backend database with ionic 2. Nowadays requirements for offline application is becoming more popular. People want to have a quick and very much accurate application with or without internet connectivity. SQLite is a phenomenon, which can be useful in providing such feature.

SQLite

SQLite is a software library that implements SQL operations using SQL database engine. SQLite is the widely deployed SQL database engine in the world.

SQLite is a local storage for the applications, SQLite is used for storing data similarly we store data in server-side websites using MySQL. SQLite provides the similar functions and queries as we have in MySQL

SQLite provides faster access to the data in an application. One can fetch the data from the server and can save in SQLite database so that later on we can use it from SQLite only because of which application’s performance will good rather than normal application.

Note: SQLite stores its database on the local device so that you can’t find your data in another device also due to this the size of an application is also got increased.

Why we use SQLite 

  • In case you’re unfamiliar with local storage, it is key-value storage within your application.
  • This makes it difficult to query for data when you have a lot of it.
  • Not only is their query difficulties, but there are limitations. And local storage has a limitation of 10MB of data.

These reasons are what makes SQLite a better choice if we compare it against local storage.

Connection with SQLite 

For using SQLite in our application we need to add the SQLite plugin given by Cordova in our ionic v2 application. It can be added via the following:

$ ionic plugin add cordova-sqlite-storage
$ npm install –save @ionic-native/sqlite

pages/home/home.ts

import {Component} from '@angular/core';
import {NavController, Platform} from 'ionic-angular';
import {SQLite} from "ionic-native";
import { AddNote } from '../addnote/addnote';
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  public database: SQLite;
  public people: Array<Object>;
  addnote = AddNote;
  public username:any;
  public password:any;
  constructor(private navController: NavController, private platform: Platform) {
      this.platform.ready().then(() => {
          this.database = new SQLite();
          this.database.openDatabase({
            name: "data.db",
             location: "default"
           }).then((data) => {
              this.database.executeSql("CREATE TABLE IF NOT EXISTS people (id INTEGER PRIMARY KEY AUTOINCREMENT, firstname TEXT, lastname TEXT)", {})
                .then((data) => {
                    console.log("TABLE CREATED: ", data);
                   alert('db and table created ');
                }, (error) => {
                    console.error("Unable to execute sql", error);
                })
            }, (error) => {
                console.error("Unable to open database", error);
            });
      });
  }
  public add() {
    this.database.executeSql("INSERT INTO userdata (firstname, lastname) VALUES ('"+this.firstname+"', '"+this.lastname+"')", []).then((data) => {
            console.log("INSERTED: " + JSON.stringify(data));
            alert(JSON.stringify(data));

        }, (error) => {
            console.log("ERROR: " + JSON.stringify(error.err));
        });
  }
  Public select() {
       this.database.executeSql("SELECT * FROM userdata", []).then((data) => {
           this.people = [];
           if(data.rows.length > 0) {
               for(var i = 0; i < data.rows.length; i++) {
                   this.people.push({firstname: data.rows.item(i).firstname, lastname: data.rows.item(i).lastname});
                 }
           }
       }, (error) => {
           console.log("ERROR: " + JSON.stringify(error));
       });
   }

Here, in the platform.ready() function, we will create a new database and it will store in device, openDatabase() is a function for opening database, it has two cases if the Database does not exist then, it will create the DB and open it and if it already exists then, it will open that one. deleteDatabase() delete the database.  add() function will add the firstname and lastname in userdata table. executeSql() Execute SQL on the opened database.

Note, you must open/create DB first, and ensure it resolved and successfully opened.

pages/home/home.html

<ion-content padding>
  <ion-item>
      <ion-input type="text" name="title"  placeholder="Firstname" [(ngModel)]="firstname"  required></ion-input>
  </ion-item>
  <ion-item>
     <ion-input type="text" placeholder="Lastname" [(ngModel)]="lastname" required></ion-input>
   </ion-item>
<button ion-button (click)="add()">Add</button>  <button ion-button (click)="select()">Select</button>

  <ion-card *ngFor="let peopl of people ">
      
{{peopl.firstname}}
     
{{peopl.lastname}}
  </ion-card> </ion-content>

Note: Access SQLite databases on the device.

Feel free to review this document for more details. Leave your vital feedback and we are readily available for any query resolving. Hope you had a quick solution for your purpose, feel free to Hire our Hybrid App Development service, provider.

Advertisements

Guidelines for Updating Node Fields Without node_save() In Drupal

Guidelines for Updating Node Fields Without node_save() In Drupal

Customization is nowadays common on Drupal site. Here you may need to save node programmatically at any time. For saving node programmatically we use node_save() hook which will save the whole node though we want to update only one field.

Drupal function field_attach_update() will replace node_save() in some way. It will update only that field which you want to update.

Benefits of field_attach_update()

  1. Reduces load time.
  2. Not update CCK fields.
  3. Easy to use.

Below is the code to use field_attach_update() hook.

// $arr_nids is array of node id that you want to update
$arr_nodes = node_load_multiple($arr_nids);
foreach ($arr_nodes as $key => $node) {
$node->field_fieldname1[LANGUAGE_NONE][0]['value'] = 'field1 value';
$node->field_fieldname2[LANGUAGE_NONE][0]['value'] = 'field2 value';
$node->field_fieldname3[LANGUAGE_NONE][0]['value'] = 'field3 value';

field_attach_update('node', $node);
entity_get_controller('node')->resetCache(array($node->nid));
}

entity_get_controller(‘node’)->resetCache(array($node->nid)) is used to clear cache for the entity.

For example:

Values before using field_attach_update():

Guidelines for Updating Node Fields Without node_save() In Drupal

Update Fields using field_attach_update():

$nid = '29';
$node = node_load($nid);
$node->field_fname[LANGUAGE_NONE][0]['value'] = 'Johnny1';
$node->field_lname[LANGUAGE_NONE][0]['value'] = 'Harper1';
$node->field_address[LANGUAGE_NONE][0]['value'] = '405, Silicon Tower, Above Freezland Restaurant, Law Garden, Off C.G. road, Ahmedabad, Gujarat - 380009 India.';

field_attach_update('node', $node);
entity_get_controller('node')->resetCache(array($node->nid));

Values after using field_attach_update():

Guidelines for Updating Node Fields Without node_save() In Drupal

Hope this helped you to get most out of the system. Need more assistance for Drupal Development Services then get in touch with us. Feel free to share your reviews and pick the best answer for your requirements. #WeDrupalEveryday

Introduction to Paragraphs Drupal 8

Precious Tips For Paragraphs In Drupal 8 Web Services
Paragraphs is a contributed module which allows creation, administration, and display of customization content components.

In other words, Paragraphs gives you cleaner data structures so you can give more editing power to your end-users.

This module replaces drupal’s standard body field with paragraph types. This allows any type of content to be added on

the page including but not limited to HTML, images, videos etc. All these can be added by users. Users can add as many

paragraphs as they like all the while keeping them all responsive. Developers can reuse paragraphs and layouts.

Paragraphs are basic Drupal entities. This allows site builder control over fields used in paragraphs and their display.

This also makes content saved in paragraphs compatible with Search API, views, and services.

Below is the step by step instructions to work with Paragraphs module:

1 – Download and enable the module
Paragraphs module follows standard process to download and enable.  Module depends on entity reference revision.

You can download and enable this module via drush as well.

2 – Add paragraph types
Paragraphs do not come with any predefined paragraph types. Developers can add as many paragraph types they want by going to admin > structure > paragraphs

To add a paragraph, click on “Add paragraph”. Add fields


Add fields that you want in this paragraph. Go to manage form display and manage display to adjust field display.

3 – Add paragraph field in the content type

paragraph-field.png

Allow this field to have multiple values. Select which paragraphs you want available in this field on field settings and save.

4 – Add content

Add content. In paragraph field, you get a list of all the paragraphs you have created and are available for this field.

Add as many paragraphs as you need.

You can change the order as well.

5 – Theme your paragraphs

Paragraphs can be themed separately. You can use the same template everywhere this paragraph is used.

The file name needs to

“Paragraph–machine-name-of-your-paragraph.html.twig”

Summary

Paragraph provides various advantages to all users of the site. Site owners get content that is responsive and works on all platforms.

Content authors can choose on the fly between predefined paragraph types. They get more structured content creation process.

Developers have full control over fields to include and paragraphs and how they should look.

Stay tuned for more on paragraphs!

Hope this helped you to get most out of the system. Feel free to share your reviews or need assistance for

Drupal Website Migration then gets in touch with us. Pick the best answer for your requirements.

All You Need To Know About Blade Templates In Laravel

Blade Templates In Laravel
Let’s start with the introduction of Blade and how Laravel supports it strongly. Laravel provides a simple and powerful templating engine like as blade. You can also use PHP code in blade template views.
In fact, all blade views are compiled into plain PHP code. Blade view files use the “.blade.php “  extension and it stored in “ resources/views “
directory.

Template Inheritance:

When defining a view you use the Blade @extends directive to extend the blade layout and blade all section using
@section directives.
@extends('layouts.app')
 
@section('title', 'Page sidebar')
 
@section('sidebarDemo')
@parent
 
<p>This is sidebar demo.</p>
@endsection
 
@section('content')
<p>This is body content.</p>
@endsection
Here, we are extending layouts.app blade view so we use all section @section directives @parent directive is an append
directive to the layout’s sidebar.
Blade view may be returned from routes.
Route::get(blade/name, function () {
    return view('blade.name');
});
Displaying Data:-
You may Display data in blade bypass the variable in curly braces like:
 Route::get('bladeDemo', function () {
        return view('welcome', ['name' => 'Addweb']);
});
Here, we add the ‘Data’ in name variable so, we display the name like,
 Hello {{ $name }}.
It has not limited to displaying content, in fact, you can also put any PHP code and result of any PHP functions inside of blade echo statement.
{{ isset($name) ? $name : Test }}
Here, we use the ternary operator to check the name is exist or not. if a name exists and set so it displays name and not set name so it can display Default.

Control Structures:-

The blade provides the displaying data but in additionally blade also provides the convenient shortcut of PHP control

structure such as conditional statement and loops.
If statement:-
You may use the @if, @elseif, @else, @endif directives for the if construct.These directives function identically to their PHP counterparts.
@if (count($records) === 1)
    I have one record!
@elseif (count($records) > 1)
    I have multiple records!
@else
    I don't have any records!
@endif    
Loops:-

Blade provides simple directive parts for a looping and it is identical to their PHP counterparts

@for ($i = 0; $i < 10; $i++)
        The current value is {{ $i }}
@endfor
 
@foreach ($demos as $demo)
    <p>This is demo{{ $demo->id }}</p>
@endforeach
 
@forelse ($demos as $demo)
    <li>{{ $demo->name }}</li>
@empty
    <p>No users</p>
@endforelse
 
@while (true)
    <p>I'm looping forever.</p>
@endwhile
The Loop variables:-

When a loop is working a $loop is available inside of a loop. This variable provides some variable to use bits of information such as the current loop of an index and first or last iteration of a loop.

Hope this helped you to get most out of the system. Feel free to share your reviews or need assistance for Hire Laravel Developer then get in touch with us. Pick the best answer for your requirements.

USEFUL TIPS FROM EXPERTS FOR CSS PSEUDO SELECTORS

CSS Pseudo Selectors

Pseudo-class selectors are CSS selectors used to define a special state of an element or display elements in a different way. It allows us to apply a special style to any element in context of the actions being performed on it. All the different selectors that are used commonly are described in the following sections.

Content selectors
::after
::before

  • Displays content text or img after and before the defined element/tag (Note: It is not working for input tags).
  • It contains ‘Content’ property to display any text or image.

:empty

  • It counts any element as empty if it does not have any text or child tags.

:not()

  • It is negation class selector. We can ignore some tags by using :not selector.
  • For example:  :not(.class-name) { /* code */ }

=> Child selectors
:first-child

  • It will target the tag only if it is the first child of its parent.

:first-of-type

  • It will target the first element of its parent, of particular type.

:last-child

  • It will target the tag only if it is the last child of its parent.

:last-of-type

  • It will target the last element of its parent, of particular type.

:nth-child()
:nth-last-child()
:nth-last-of-type()
:nth-of-type()
:only-child
:only-of-type

  • These elements are used to find the specific child of its parent.
  • For example:

<ul>       <li>First list item</li>       <li>Second list item</li>       <li>Third list item</li>       <li>Fourth list item</li> <li> last list item</li>     </ul>     li:first-child {       color: deepPink;     }     li:nth-child(3) {       background-color: red;     }     li:last-child {       text-decoration: underline;     }

::placeholder

  • It represents the text in input/textarea fields and provides a hint to the user about the data to be filled in the form element.
  •  For example:

::placeholder {       color: #0c496d;       font-size: 14px;     }    ::-moz-placeholder {       color: #0c496d;       font-size: 14px;    }

:disabled
:enabled

  • It accepts or rejects a user interaction on a form control.
  • It is used for button, select, input, textarea…
  • For example:

HTML

<input type=”checkbox” id=”checkbox-1″ disabled><label for=”checkbox-1″>First Choice (disabled)</label> <br>         <input type=”checkbox” id=”checkbox-2″><label for=”checkbox-2″>Second Choice</label>

CSS

input[type=”checkbox”]:disabled + label{               text-decoration: line-through;                cursor: not-allowed;     color: grey;         }

:checked

  • It is used to select and style checkbox and radio-button that are checked.
  • For example:

<input type=”checkbox” name=”checks” id=”box-1″ checked> <label for=”box-1″>Initially checked.</label> <br/> <input type=”checkbox” name=”checks” id=”box-2″><label for=”box-2″>Not Checked</label>

:read-only

  • It selects any input type and textarea that is not editable.

:read-write

  • It selects any input type and textarea that is editable.

:required

  • Required is used to select form elements that have the required attribute set.

:optional

  • Optional is used to select form elements that are optional.

=> Event selectors

  • It specifies an element based on a specific state and is used to apply styles to an element when it matches that specified state.
  • These pseudo elements are used to style link elements and define different behaviors like: active, hover,  focus, visited.

:active 

  • This pseudo-class is a dynamic class which applies when an element is being activated by the user. It is used to style an element when it’s active.
  • For example:

p:active { background-color: #AAA; }

:blank

  • It is a CSS pseudo-class selector used to select pages of a printed document, such as a book, that are empty as a result of a forced page break.

:focus

  • It is used for elements that accept keyboard events or other user inputs or receive focus.
  • For example:

a:focus {     outline: 0;     background-color: black; }

Read more: https://goo.gl/5Kgm1b

Hope this helped you to get most out of the system. Feel free to share your reviews or need assistance for Web Design Services then get in touch with us. 🙂

Create Custom Multistep Form Using Ajax

Multistep Form Using Ajax
Don’t want long forms on your website? Convert it into multi-step form, as it is more convenient and provides step by

step procedure to follow by user. This blog will provide a way to create of multi step form using ajax.

https://goo.gl/P1BrVx 1. Create a menu item using hook_menu()

/** * Implementation of hook_menu(). */ function custom_menu() { $menu[‘multistep_form’] = array ( ‘title’ => ‘Multistep Form’, ‘description’ => ‘To create multistep form’, ‘page callback’ => ‘drupal_get_form’, ‘page arguments’ => array(‘ajax_multistep_form’), ‘access callback’ => TRUE, ); return $menu; }

  1. Define a callback functionIt includes stepwise fields. It contains fieldset for each step with their respective fields. Then It will includes buttons for each step.

We have called ajax_multistep_form_ajax_callback function it returns the entire form each time the function is called. Added a wrapper div “ajax_multistep_form’” to update the form using AJAX.

$form[‘buttons’][‘next’] = array ( ‘#type’ => ‘submit’, ‘#value’ => t(‘Next’), ‘#ajax’ => array ( ‘wrapper’ => ‘ajax_multistep_form’, ‘callback’ => ‘ajax_multistep_form_ajax_callback’, ), );

 

 

function ajax_multistep_form($form, &$form_state) {   // If $form_state[‘step’] is not set then set default to 1 $form_state[‘step’] = isset($form_state[‘step’]) ? $form_state[‘step’] : 1; // Add a wrapper div to update the form using AJAX $form[‘#prefix’] = ‘

‘; $form[‘#suffix’] = ‘

‘;   switch($form_state[‘step’]) { // Step 1 case 1: $fname_default_value = $lname_default_value = ”; if(isset($form_state[‘values’][‘step_1’])) { $fname_default_value = $form_state[‘values’][‘step_1’][‘fname’]; $lname_default_value = $form_state[‘values’][‘step_1’][‘lname’]; } elseif(isset($form_state[‘storage’][‘step_1’])) { $fname_default_value = $form_state[‘storage’][‘step_1’][‘fname’]; $lname_default_value = $form_state[‘storage’][‘step_1’][‘lname’]; }   $form[‘step_1’] = array( ‘#type’ => ‘fieldset’, ‘#title’ => t(”), ‘#collapsible’ => false, ‘#collapsed’ => false, ); $form[‘step_1’][‘fname’] = array( ‘#type’=>’textfield’, ‘#required’ => true, ‘#title’=>t(‘First Name’), ‘#default_value’ => $fname_default_value, ); $form[‘step_1’][‘lname’] = array( ‘#type’=>’textfield’, ‘#required’ => true, ‘#title’=>t(‘Last name’), ‘#default_value’ => $lname_default_value, ); break; // Step 2 case 2: $phone_default_value = ”; if(isset($form_state[‘values’][‘step_2’])) { $phone_default_value = $form_state[‘values’][‘step_2’][‘phone’]; } elseif(isset($form_state[‘storage’][‘step_2’])) { $phone_default_value = $form_state[‘storage’][‘step_2’][‘phone’]; }   $form[‘step_2’] = array( ‘#type’ => ‘fieldset’, ‘#title’ => t(”), ‘#collapsible’ => false, ‘#collapsed’ => false, ); $form[‘step_2’][‘phone’] = array( ‘#type’=>’textfield’, ‘#required’ => true, ‘#title’=>t(‘Phone Number’), ‘#default_value’ => $phone_default_value, ); break; // Step 3 case 3: $city_default_value = $city_default_value = ”; if(isset($form_state[‘values’][‘step_3’])) { $street_default_value = $form_state[‘values’][‘step_3’][‘street’]; $city_default_value = $form_state[‘values’][‘step_3’][‘city’]; } elseif(isset($form_state[‘storage’][‘step_3’])) { $street_default_value = $form_state[‘storage’][‘step_3’][‘street’]; $city_default_value = $form_state[‘storage’][‘step_3’][‘city’]; }   $form[‘step_3’] = array( ‘#type’ => ‘fieldset’, ‘#title’ => t(”), ‘#collapsible’ => false, ‘#collapsed’ => false, ); $form[‘step_3’][‘street’] = array( ‘#type’=>’textfield’, ‘#required’ => true, ‘#title’=>t(‘Street Address’), ‘#default_value’ => $street_default_value, );   $form[‘step_3’][‘city’] = array( ‘#type’=>’textfield’, ‘#required’ => true, ‘#title’=>t(‘City’), ‘#default_value’ => $city_default_value, );   }     // Form Buttons $form[‘buttons’] = array ( ‘#type’ => ‘container’, ); // If we are on step 1, we do not want a back button if($form_state[‘step’] !== 1) { $form[‘buttons’][‘back’] = array ( ‘#type’ => ‘submit’, ‘#value’ => t(‘Back’), ‘#limit_validation_errors’ => array(), ‘#submit’ => array(‘ajax_multistep_form_back_submit’), ‘#ajax’ => array ( ‘wrapper’ => ‘ajax_multistep_form’, ‘callback’ => ‘ajax_multistep_form_ajax_callback’, ), ); }   if($form_state[‘step’] !== 3) { $form[‘buttons’][‘next’] = array ( ‘#type’ => ‘submit’, ‘#value’ => t(‘Next’), ‘#ajax’ => array ( ‘wrapper’ => ‘ajax_multistep_form’, ‘callback’ => ‘ajax_multistep_form_ajax_callback’, ), ); } else { $form[‘buttons’][‘submit’] = array ( ‘#type’ => ‘submit’, ‘#value’ => t(‘Submit’), ‘#ajax’ => array ( ‘wrapper’ => ‘ajax_multistep_form’, ‘callback’ => ‘ajax_multistep_form_ajax_callback’, ), ); } return $form; }

  1. Add validation for your fieldsIt will add validation for phone number field in step 2. You can add validations for other steps too.

function ajax_multistep_form_validate($form, &$form_state) { switch($form_state[‘step’]) { case “2”: $contact_phone = $form_state[‘values’][‘phone’]; $contact_errror = ‘”‘.$contact_phone .'”‘ . ‘ is not a valid North American phone number. Please enter a valid ten-digit phone number with optional extension in this format 123 456 7891.’; if (!preg_match(‘/([0-9]{3}?\s?[0-9]{3}?\s?[0-9]{4})/’, $contact_phone)) { form_set_error(‘phone’, $contact_errror); } break; } }

  1. Final submit function

function ajax_multistep_form_submit($form, &$form_state) {   $step = $form_state[‘step’];   //$form_state[‘storage’][‘step_’ . $step] = $form_state[‘step’];   if($form_state[‘step’] == 1) { $form_state[‘storage’][‘step_’ . $step][‘fname’] = $form_state[‘values’][‘fname’]; $form_state[‘storage’][‘step_’ . $step][‘lname’] = $form_state[‘values’][‘lname’];   } if($form_state[‘step’] == 2) { $form_state[‘storage’][‘step_’ . $step][‘phone’] = $form_state[‘values’][‘phone’]; }   if(isset($form_state[‘values’][‘next’]) && $form_state[‘values’][‘op’] == $form_state[‘values’][‘next’]) { // Goto next step $form_state[‘step’]++; }   if(isset($form_state[‘values’][‘back’]) && $form_state[‘values’][‘op’] == $form_state[‘values’][‘back’]) { // Goto next step $form_state[‘step’]–; } // Check if it is last step elseif(isset($form_state[‘values’][‘submit’]) && $form_state[‘values’][‘op’] == $form_state[‘values’][‘submit’]) {   $form_state[‘storage’][‘step_’ . $step][‘street’] = $form_state[‘values’][‘street’]; $form_state[‘storage’][‘step_’ . $step][‘city’] = $form_state[‘values’][‘city’];   $items = array($form_state[‘storage’][‘step_1’][‘fname’], $form_state[‘storage’][‘step_1’][‘lname’], $form_state[‘storage’][‘step_2’][‘phone’], $form_state[‘storage’][‘step_3’][‘street’], $form_state[‘storage’][‘step_3’][‘city’]); drupal_set_message(t(‘You submitted the following values:!values’, array(‘!values’ => theme(‘item_list’, array(‘items’ => $items)))));   $form_state[‘step’] = 1; $form_state[‘storage’] = array(); } $form_state[‘rebuild’] = TRUE; }

  1. Ajax callback function for every buttons in our form

function ajax_multistep_form_ajax_callback($form, &$form_state) { return $form; }

This it just an example, you store all steps value in “$form_state[‘storage’]” and use it.

$step = $form_state[‘step’]; $form_state[‘storage’][‘step_’ . $step][‘values’] = $form_state[‘values’];

Hope this helped you to get most out of the system. Feel free to share your reviews or need assistance regarding our

CakePHP development services then get in touch with us. #WeDrupalEveryday. Pick the best answer for your requirements.

ENHANCE YOUR ADMINLTE IMPLEMENT SKILLS IN LARAVEL 5

AdminLTE Implement Skills In Laravel 5
Let me walk you through AdminLTE Introduction:

  • AdminLTE is a popular open source WebApp template for admin Dashboard and control panel.It is responsive template using Bootstrap 3 and CSS framework.
  • AdminLTE is now used by thousands of users around the world.
  • AdminLTE is a based on modular design and it easily customizes and built upon.
  • This package is switched default laravel scaffolding / boilerplate to adminLTE template.
  • In laravel AdminLTE is managed by “ Bower “.

Feature of AdminLTE:

  • AdminLTE provides Sidebar mini feature to the user with the ability to collapse the sidebar without losing accessibility to side navigation.
  • Control sidebar is a new section of the layout. This sidebar use for many purposes in right sidebar
    • AdminLTE provides the 6 new skin originally. That switch the color of sidebar in dashboard.

Integrate AdminLTE:

  • If you have integrated AdminLTE so first you have to create a new project using laravel because it is easy to use and more comfortable.
  • First, You have to use laravel installer, In the terminal type the command.

composer global require “laravel/installer=~1.1”

  • Here, this command will install composer in few minutes. Then get the fresh copy of laravel using below command.

laravel new myapp

  • Here,  we create new laravel copy and its name is myapp.
  • Laravel setup is completely installed in your system then you have able to see the welcome page on your site.
  • Once, it’s process is done then after you have navigated to the public directory in a terminal command.
  • After you have navigated to the public directory you have to install AdminLTE using Bower

    bower install admin-lte

  •  Once, you have to successfully installed adminLTE in laravel then you should have folder called bower_componets and inside it you will find admin-lte.
  • Laravel is provide the greate templating system out of the box called Blade. Then after we have to convert the regular HTML page to Blade.
  • First you have to create a new blade in “ resources/view “ directory and then you have to create route for this blade.
  • If you have to create the route and blade then you will copy the “ bower_components/admin-lte/starter.html ” in new view and modify the code. Then after you will visit the page so it has blank.
  • Then after you will split the template into the three files like sidebar.blade.php, header.blade.php, footer.blade.php . so you have create new blade in view directory.
  • Then after you have create a new controller using the controller command

    php artisan make:controller TestController –plain

  • After creating controller you will do work in controller and you will create the new route for this controller

    Route::get(‘test’, ‘TestController@index‘);

  • After creating route you will check your test page so you will display the output for your developing view.

Install AdminLTE template:

  • A laravel 5 package that switch the default  Laravel scaffolding / boilerplate to adminLTE template with bootstrap 3.0.
  • AdminLTE is the so simple to install and use.
  • AdminLTE is install globally with compose

       composer global require “acacha/adminlte-laravel-installer=~2.0”

  • And convert any fresh laravel installation to AdminLTE to use with:-

    laravel new laravel-with-admin-lte cd laravel-with-admin-lte adminlte-laravel install

  • It successfully installed so you can use AdminLTE if you are use llum.
  • You are start to using AdminLTE project. Llum will be configure database (sqlite), execute migrations , install devtools and serve for you to use it.

Hope this helped you to get most out of the system. Feel free to share your reviews and need assistance for Hire Laravel Developer.