Sunday, June 19, 2016

How to delete index in MySql

How to delete index in MySql, first you need to know the exact name of the INDEX (Unique key in this case) to delete or update it. INDEX names are usually same as column names. In case of more than one INDEX applied on a column, MySQL automatically suffixes numbering to the column names to create unique INDEX names.

For example if 2 indexes are applied on a column named customer_id

  1. The first index will be named as customer_id itself.

  2. The second index will be names as customer_id_2 and so on.


To know the name of the index you want to delete or update


SHOW INDEX FROM <table_name>

To delete an index


ALTER TABLE <table_name> DROP INDEX <index_name>;

Thank u.  :lol:

Ref : stackoverflow

 

Tuesday, June 14, 2016

Installation and Running Lumen - Laravel

To the point Installation and Running Lumen - Laravel

Lumen is micro-framework by Laravel

Installation


1. Server Requirements



  • PHP >= 5.5.9

  • OpenSSL PHP Extension

  • PDO PHP Extension

  • Mbstring PHP Extension


2. Installing Lumen


Installing Lumen with Composer to manage its dependencies. Make sure you have Composer installed on your machine.



Via Lumen installer


Download Lumen installer via composer



$ composer global require "laravel/lumen-installer"

And then method of installation is much faster than installing via Composer:



$ lumen new name_your_project

Via Composer Create Project


Using the Composer create-project command in your terminal



$ composer create-project --prefer-dist laravel/lumen name_your_project

3. Configuration



All of the configuration options for the Lumen framework are stored in the .env file. Once Lumen is installed, you should also configure your local environment.



Application Key



The next thing you should do after installing Lumen is set your application key to a random string. Typically, this string should be 32 characters long. The key can be set in the .env environment file. If you have not renamed the .env.example file to .env, you should do that now. If the application key is not set, your user encrypted data will not be secure!



4. Running after installing Lumen


Configuration


Copy paste your .env.example, like this.




[caption id="attachment_409" align="aligncenter" width="302"]env-lumen-laravel env-lumen-laravel[/caption]

running first your lumen on browser.



http://localhost/lumen/public

or



- If you using windows, Open command Prompt or terminal if unix.
- Navigate to your project directory.
- execute this command: "php -S localhost:80 -t ./public".
- Open your borwser and visit http://localhost:port.

Thnk : Iginla Omotayo

if you got error, edited file index.php in folder public. Change



$app->run();

to



$app->run($app->make('request'));

if works, you will get output on you browser like this.



Lumen (5.2.7) (Laravel Components 5.2.*)

Add key application lumen on file .env


Edit file routes.php in folder Controllers and change, like this ( it`s up to u )



$app->get('/', function () use ($app) {
return $app->version();
});
$app->get('/key', function () use ($app) {
return str_random(32);
});

Ref : Lumen Laravel

Ok done. thank you.  :lol:  :lol: