-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the Larablade Wiki
This is a Laravel 4.2 web app that demonstrates
- Configuring your environment
- Basic user authentication
- Using Laravel blade templating
- Creating simple forms with laravel
- Sending mails with Laravel
- Flashing messages to session and displaying them to user
If you're developing with laravel homestead or forge this step is mostly irrelevant. If you're not, however, the three most important files you usually need to modify are
- start/global.php
- bootstrap/start.php
- app/config/database.php or app/config/local/database.php
Ensure that your database is configured properly and that your bootstrap/start.php
has your hostname properly included. You can run
hostname
on your PC to find out your hostname.
Laravel authentications are pretty straight forward but ensure that your users's password field length is 64 or be prepared to face the wrath of Sango.
Laravel offers a powerful templating engine called Blade which allows you to easily build themes/control view layout for your site. The demo shows how you can have a unified header, navbar, footer, and sidebar as well as dynamially load 'Page Title' for your pages.
The authenticate and registerUser methods in UserController show how to process input data from the login and register form views.
The mail function enables you to easily send mail with Laravel as well as to configure how your mails are sent. In this demo, when a user signs up, we send the user an email along with a custom message. Note the use($usr)
on line 53. This enables us to use $usr in the scope of the Mail::send
function
There are two major ways to send your data to views in laravel. Using the Session::flash method which sets a temporary data to the session or using View::make('some.view')->withData($data)
which sends some $data
directly to your specified view file.
It is important to note that Redirect::to('some/view')->withData($data)
works in a different way from View::make('some.view')->withData($data)
. The first puts the data in the session while the second passes the $data
directly as a variable to the view file.