The Author hand helds & takes you to create an end-to-end world class app like Facebook.
For creating a Facebook like website from the start with a clear-cut explanation in a step by step manner
Completely explaining the process involved in creating a Facebook like site and have it online.
To instantly build a social media site like Facebook on your own.
All the information and fine points to learn and create a social media site on your own.
Necessary coding and procedures to create a chat feature in a website.
The ideal tutorial to learn the most popular php framework – Laravel.
Learn to build and control an expert admin panel and control all site features, different pages, users etc.
To create a user panel for a social media site like Facebook with features to share, like and comment on posts.
Even entrepreneurs without any knowledge about coding can simply download the tutorial + complete source code and have an amateur developer build a social media site like Facebook and have it online in hours.
The tutorial comes with all the steps to help a beginner or newbie developer to build a user friendly social media website with ease.
These days Social Media plays a prominent role in overall development of business,
marketing, education etc. It acts as an interface between mass group of
people to interact and share the views and ideas with each other. Since past few years
it has gained the attention of billions of subscribers.
We can find many Social Media sites but only few serve the purpose. Each of them has their own specialty in certain fields and features. To find a completely perfect application with all the features well established is bit difficult.
Here comes an application, build with a goal oriented approach. We have come up with such a flexible and easily usable app; various advanced features are integrated to obtain world class application. Details of an app are explained clearly in this tutorial, entire source code is explained so that any individual can build an app by referring this tutorial. Come let us start our learning plus developing process.
For any application, registration process becomes crucial step for authentication purpose. When user tries to Login for the first time, below page appears so that he gets registered by entering the valid credentials. Below shown is the screen shot of Login page.
2. public function register()
4. $rules = array('email' => 'required|email|unique:user','first_name' => 'required','last_name' => 'required','password' => 'required|min:8');
5. $validator = Validator::make(Input::all(),$rules);
6. if ($validator->passes())
8. $user = new User;
9. $user->first_name = Input::get('first_name');
10. $user->last_name = Input::get('last_name');
11. $user->openfire_id =generate_openfire_id(strtolower(Input::get('first_name')),strtolower(Input::get('last_nam')));
12. $user->email = Input::get('email');
13. $user->password = Hash::make(Input::get('password'));
14. $user->hash_key = generateRandomString(10);
15. $user->dob = Input::get('year')."-".Input::get('month')."-".Input::get('day');
16. if (Input::get('gender')==='male')
18. $user->gender = 'M';
22. $user->gender = 'F';
24. $user->activation_key = Hash::make(strval(Carbon::now()));
26. $activationLink = URL::route('activate')."?email=".$user->email."&code=".$user->activation_key;
27. Mail::send('emails.activation',array('activationLink' => $activationLink,'name' => Input::get('first_name')." ".Input::get('last_name'),'email' => Input::get('email')), function($message)
29. $message->to(Input::get('email'),Input::get('first_name')." ".Input::get('last_name'))->subject('Just one more step to get started on '.Config::get('app.website_title'));
31. $url = "http://".Config::get('app.openfire_ip').":9090/plugins/userService/userservice?secret=".Config::get('app.openfire_user_service_key')."&type=add&username=".$user->openfire_id."&password=".$user->hash_key."&name=".$user->first_name."&email=".$user->email;
32. $ch = curl_init();
37. return Redirect::back()->with('flash_success','activate');
41. return Redirect::back()->with('email_error','already_taken');
Registration process is carried out for the users who login for first time. When the user tries to login a Route is called, it directs the user to execute register function from UserController. In register function we create an array with fields as email ,first_name, last_name and password. These fields are to be filled by the user without skipping, as they are set as required fields. We validate the inputs given by the user and if the details are valid we assign it to a variable called validator. We execute passes function by using validator variable . We assign the user with new User and fetch the values for first_name, last_name, email and password using get method and store in the variable called user .Also a hash key generated and date of birth (dob) of the user is fetched and stored. Gender of the user is also saved i.e. if the user is male the gender is assigned to M and if the user is female the gender is assigned to F.A hash value for activation is fetched and save function is executed. An activation mail is send to user to his email id entered while registering. The curl_init() function is used to initialize the url session. The curl_setopt function is used to set an option for url transfer. The curl_exec function which is used to perform an url session is assigned to a variable output. On finishing the activation process, a success message is displayed to user else an error message is displayed.
Once the user is successfully registered he can log in into app any time he wishes . When the user tries to login he must enter valid email id and password.
5. return Redirect::route('home');
9. return View::make('login')->with('website_title', 'FaceBook');
When the user tries to login a Route is called to redirect the user to welcome page.
We check for user authentication, if the user is authenticated he is redirected to login page else
he is redirected to main page of website.
If the user is authenticated a Route is called to execute login function from the UserController. In login function we fetch the email id and password entered by the user and check for validation. If the entered email id and password is correct, user is redirected to home page else he is redirected to root.
When the user wants to search for any particular individual he can make use of search option, at the text box if the user enters the name of an individual the search function is executed and displays the details of particular individual. Below shown is the screen shot for search function,
2. public function search()
4. $user = User::find(Auth::user()->id);
5. $profiles= User::where('first_name','LIKE','%'.Input::get('key').'%')->where('id','!=',Auth::user()->id)->get();
6. if (isset($profiles))
8. $result_array = array();
9. foreach ($profiles as $profile)
11. $mutual_friend = 0;
12. $request_send = 0;
13. $friend_request = 0;
14. $work = Works::where('user_id',$profile->id)->whereNull('deleted_at')->orderBy('id','desc')->first();
15. $college = Colleges::where('user_id',$profile->id)->whereNull('deleted_at')->orderBy('id','desc')->first();
16. $school = Schools::where('user_id',$profile->id)->whereNull('deleted_at')->orderBy('id','desc')->first();
17. $request_send = Friends::where('user_one_id',Auth::user()->id)->where('user_two_id',$profile->id)->whereNull('deleted_at')->first();
18. $friend_request = Friends::where('user_one_id',$profile->id)->where('user_two_id',Auth::user()->id)->whereNull('deleted_at')->first();
19. if (isset($friend_request)&&isset($request_send))
21. $mutual_friend = 1;
23. else if (isset($request_send))
25. $request_send = 1;
27. else if(isset($friend_request))
29. $friend_request = 1;
31. $res = array('profile'=>$profile,'work'=>$work,'college'=>$college,'school'=>$school,'mutual_friend'=>$mutual_friend,'request_send'=>$request_send,'friend_request'=>$friend_request);
32. array_push($result_array, $res);
34. return View::make('search')->with('results',$result_array)->with('query',Input::get('key'))->with('user',$user);
38. return Redirect::back();
39. } 40. }
In search function we fetch for id of authenticated user and assign to variable user. From the database we retrieve the first_name of the user using get method and store the result in variable profiles. We check for profiles in an array and an instance of an array is assigned to a variable called result_array. For each profile in profiles we set the values as zero for mutual_friend, request_send and friend_request. We fetch user_id and perform search in descending order to find the work place of the user and assign to a variable work. Similarly we find the college studied and assign to variable college. The details about schooling is fetched and assigned to variable school. If the values of user_one_id and user_two_id are not NULL then the result is obtained and stored in request_send variable. Similarly we find the friend request and assign to variable friend_request. Further if the values of friend_request and request_send are equal, the status of mutual_friend is set to one. If the value is set to request_send, then the status of request_send is set to one. If the value is set to friend_request, the status of friend_request is set to one. We store the values of work, college, mutual_friend, request_send and friend_request and assign to an instance of an array. This array is stored at variable called res. We push the values of res into result_array. The details stored in an array are fetched and returned to View. Else if the values for profiles does not match user is redirected to execute back function.
Can this day get any better ?
Not convinced? scroll down further!GET IT NOW!
With the objective to facilitate any developer newbie or pro, create a social media site like Facebook, the tutorial comes with easy to understand steps
In addition to the basics, the author also covers every not so important point in creating a social media website.
With the full source code coming with the tutorial, you can create and launch a social media site instantly.
The author takes you to all possible screens and features to create each and every page and provides you with screenshots and sample codes from the start to finish.
The eBook comes with complete installation techniques to guide any developer install the site in a server and have it online.
You get to learn all the knacks in integrating your website with a messaging or chat feature.
With the simple steps that come in the tutorial learn to design and organize your website in the most attractive way possible.
Learn and get skilled in managing the user profiles in your Facebook like social media site with the complete set of user management instructions.
The tutorial comes with tested codes and enables any beginner build a social media site like Facebook with the social media script in hours.
Learn everything you need to create a social media site with our PHP tutorial and Laravel Framework.
Users at a social media site are more interested in what others do and from our tutorial learn to integrate your website with share and like features.
Learn to enable users to create fan pages and different groups for organizations, universities, friends etc.
Learn to build the site with features to add pictures to the user profiles as well as edit them.
"Learning how to build a social media site has always been my desire and with the tutorial from ScriptMode I am now contented."
"A social media script with the tutorials and full source code just for $9!!That is something that I will never let go"
"Kudos to such a well scripted eBook and source code. It guided me to build my own wonderful social media website"