Saturday, 25 November 2017

Laravel Migrations Command Lines

I don't trust my memory well so I'll document some migrations command This line will create a book table migrations This line will add a migration script to add author_id Here are the list of data type columns that can be added

Wednesday, 8 November 2017

How to get the URL of the current page in C#

Lot of times I checked the URL for doing coding.   To get all the possible values put these codes


Monday, 6 November 2017

Using SQLite in Laravel Applications

 I have been playing with Laravel and MySQL just recently and I have been enjoying using it on one of my recent project.    It's an eCommerce system done with Laravel 5.3 with Paypal and Stripe Payment.  I have implemented a authorize and capture mechanism.   

I've been using MySQL for database which works as expected but my problem is I'm using 3 machines for my development.   I don't want to use any cloud database like AWS MySQL or Google cloud db, because it's a paid one and apparently I'm not online always.   Things like I can work even in train (really hardworking right?) wherein internet is superslow.

Now comes SQLite.   SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file.  Meaning a portable database which will solve my dillema.

To use SQLite on Laravel

Create a database laravel.sqlite file in the database folder of your laravel project.   You might need to download SQLite browser in


Open your database.php file in the config folder of your project and make sure what you see in the image below is the same in your project.

Go to your .env file and and change your DB_CONNECTION to
'sqlite'. Another thing you have to do is change DB_DATABASE to the path of your laravel.sqlite on your local computer.  You can leave the port, username and password.


Sunday, 5 November 2017

Laravel Default Env File Content

It is often helpful to have different configuration values based on
the environment where the application is running. For example, you
may wish to use a different cache driver locally than you do on your
production server.

To make this a cinch, Laravel utilizes the DotEnv PHP library by Vance
Lucas. In a fresh Laravel installation, the root directory of your application
will contain a .env.example file. If you install Laravel via Composer, this
file will automatically be renamed to .env. Otherwise, you should rename the
file manually.

Your .env file should not be committed to your application's source control,
since each developer / server using your application could require a different
environment configuration. Furthermore, this would be a security risk in the event
an intruder gain access to your source control repository, since any sensitive
credentials would get exposed.

If you are developing with a team, you may wish to continue including a .env.example
file with your application. By putting place-holder values in the example configuration
file, other developers on your team can clearly see which environment variables are
needed to run your application. You may also create a .env.testing file. This file will
override values from the .env file when running PHPUnit tests or executing Artisan commands
with the --env=testing option.

To add paypal or stripe you can check Laravel eCommerce with Paypal and Stripe Payment

Friday, 3 November 2017

Solr Sample Code and Articles

Monday, 11 September 2017

Sending Responsive Email Template using Rails and Postmark

Sending a responsive email template and Need to watch Get some template here add this in your gem file To make the postmark use environment variables please follow this steps Comment out the default "from:" in ApplicationMailer To create an environment variable and add this line in your secrets.yml in your application.rb add this lines

Thursday, 2 March 2017

Traverse in all files in directory using Java

Using apache collection to traverse all files in directory with regex

Popular Posts

Recent Posts


Powered by Blogger.