Laravel Blog

  1. Create a new laravel project:


     
  2. Download the ready made laravel blog app from https://github.com/jacurtis/laravel-blog-tutorial. It’s better to donwload in zip file then extract the content in /works/laravel/laravel-blog-tutorial/ directory. Overwrite the existing files and directories.
  3. Install the laravel component required:


     
  4. edit .env file and fill the database account (DB name is laravel_blog)
  5. Create authentication scaffolding (login, register, forgot password, etc)
  6. Use ‘migration’ to add some new tables into the new database

    It should be ready to test the website.
  7. Dont forget to set the file permission in /public/ directory if we want to upload an image into it
  8. Test the website: http://localhost:8000/

    If i found an error like:

    Just stop the server then generate the new key:

    It’d create a new key in .env like

    ref: http://laravel.io/forum/08-25-2016-no-supported-encrypter-found-the-cipher-and-or-key-length-are-invalid-when-i-run-keygenerate.
    Then start the server back. If everything is okay, here is the screen look like:blog-tutorialSometimes you got an error about the file permission writeable or not like this

    Then you need to set the file permission in /public/ directory to 777

    Explore the Laravel Blog!!! (Add/edit users, add/edit posts, categories, tags, comments, send contact, login, register)
    If you have enough time to learn the nitty-gritty about laravel and how to create this blog step by step, then please watch this 47 youtube videos in How to Build a Blog with Laravel.
  9. NOTES about this app:
    The route file DONT lay in /routes/web.app BUT in /app/Http/routes.php. It used Route::group.

    The route for the root website (/) is pointing to ‘PagesController.php’ in /app/Http/Controllers/

    The ‘Post’ data is retrieved with a help from ‘Post’ model in /app/Post.php. The data then would be rendered by welcome.blade.php in /resources/views/pages/

Leave a Reply

Your email address will not be published. Required fields are marked *