Showing posts with label data. Show all posts
Showing posts with label data. Show all posts

2014-02-09

Level Up - Webmaster: Setting Up Your First Laravel Website Or App

(For webmasters, a continuation on my last post Level Up - Webmaster: Installing Laravel and Composer on Bluehost.)

This walkthrough contains all the instructions I would have needed on one page, rather than looking through twenty different pages. This is a blunt how-to for connecting to a database with Laravel and displaying information. At the end are links for more specific and advanced info.

The following has explicit instructions and commands for a shared hosting provider like Bluehost, but the instructions should be the roughly the same for other providers and setups. I suggest to follow the steps explicitly the first time through, then run through it a second time with your specific project's names.

0. This simple "tutorial" assumes that you already know a little bit about Laravel and have possibly read my first install and setup walkthrough.

Setup the database:
1. Create a database on your server with a user and password.
2. From your root project folder, edit app/config/database.php to match your new database credentials.
3. In your root project directory, run php-cli artisan migrate:make create_users_table
4. You should now have the file that looks something like: app/database/migrations/2014_02_09_195357_create_users_table.php. Edit the up() and down() function to look like:
    public function up()
    {
        Schema::create('users', function($table)
        {
            $table->increments('id');
            $table->string('email')->unique();
            $table->string('name');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::drop('users');
    }
5. Now, back in the project root dir, run: php-cli artisan migrate
6. At this time, your tables in the database will be automatically created. Add some data manually so that we can test that retrieving data works.

Create a view:
7. Create a route (subdirectory pointer) in app/routes.php by adding the following code:
    Route::get('users', function()
    {
        $users = User::all();

        return View::make('users')->with('users', $users);
    });
8. Create two new views in app/views. Call the first one layout.blade.php and add this code:
   
       
           

Laravel Quickstart



            @yield('content')
        
    
Create the second view, called users.blade.php:
    @extends('layout')

    @section('content')
        @foreach($users as $user)
            {{ $user->name }}
        @endforeach
    @stop
9. Go to your doman.com/users and you should have all the user names from the database displayed on the page.


Note:
- If the php-cli command doesn't work for you, then try just php


More info:

2013-12-28

My Migration from Dual-Boot Win7/Win8 to only Windows 8

1. Meticulously back up data
2. Download full Windows 8.1 iso to burn to disk
3. Refresh myself on how to factory restore and install new operating system (OS)
4. Factory restore computer
4. Popped in the Win 8.1 disc and with that I deleted all the partitions before installing 8.1. This was a really great experience! It was very fast. Also, the start-up process for Windows 8.1 from nothing was tremendously faster than what I was expecting. Got Windows 8.1 installed
4.1. During the setup process, I also created two addition 50GB partitions separate from Win8 so that I could experiment with different OSes with ease.
5. During setup I logged in with my MS account, and in the Start screen I noticed that my setup was saved from my old Win8 setup. Even the desktop wallpaper carried over! And the position of the Taskbar vertical on the left side.
6. Bug found. During the entire setup/install process, I had my second monitor plugged in. Now, the OS only recognizes the second monitor. I hope a restart without the second monitor plugged in will fix this. (Update: Yes, restarting fixed this problem)
7. Went through all of the Windows settings and personalized it to my liking.
8. Used Internet Explorer to install Google Chrome (plus Java plugin).
9. Add my important files from before the wipe.
10. Install programs
  • Common Tools
    • Notepad++ (with ZenCoding plugin and Compare plugin)
    • Paint.NET (with Photoshop plugin)
    • VLC Media Player
    • Microsoft Office
    • Adobe (unfortunately) and/vs Foxit
  • Specialized Tools
    • AutoHotKey (for creating macros)
    • FileZilla (for FTP)
    • Audacity (for music editing)
    • 7-Zip
    • Git
    • Inkscape (for editing vector files)
    • Skitch (for quick screenshots with overlays and fast getting a link to share)
    • Putty
    • WinSCP
  • App Building Programs
    • Android + Eclipse + Java SE Development Kit (JDK)
    • Visual Studio 2012 + 2013 + Azure
    • Construct 2
  • Others
    • Dropbox
  • Programs NOT installed this time
    • iTunes (mainly because I haven't used it in awhile and Apple installs way too many separate things along with it)
11. Fixed bug where everything seemed blurry. Windows required a graphics card driver update and a restart. There was no need to limit DPI scaling anywhere.
12. Set keyboard shortcuts

  • Ctrl + Alt + c = Calculator
  • Ctrl + Alt + p  = Paint
  • Ctrl + Alt + Shift + P  = Paint.NET
  • Ctrl + Alt + n  = Notepad (Very rarely used)
  • Ctrl + Alt + Shift + N  = Notepad++
  • Ctrl + Alt + Shift + F  = FileZilla

13. Reassign file types. E.g. Make sure TXT and XML files open with Notepad++. Here's a Windows Command Line Prompt Cheat Sheet.

And, now I finally have a brand new clean system that I can work efficiently on. Later I will be customizing each of my programs again, to my liking.

It could have been worse. But, there still has got to be a better way of doing all of this...

There's about 100GB of programs and data I've added to this computer that I need for my different work/projects. And, that doesn't even include any of my music, videos, pictures, or 35 extra gigabytes of data from Db which I will be downloading tonight, or maybe not this time. Also, these programs I've installed in the beginning are just most of the ones that I have used in the past month and will need to use within the next month.

  • About 7.5 GB of program installers in my Downloads folder
  • About 1.0 GB of data on my Desktop
  • About 0.3 GB of data in my Documents folder
  • About 43 GB of data in my Developer folder
That's about 52 GB of data out of ~95 GB memory used. So, 43 GB used for programs.

~ Danial Goodwin ~