Installation
A social network API is created in Laravel that allows developers to get the basics of social network and then customize it as per they want. It also benefits if you are frontend developer, you do not have to worry about learning and creating all the backend for a social network.
In this Social Network, we also have an admin panel from where you can manage users, SMTP settings etc. We also have a chat system between user and admin so if user have any question, they can ask directly from admin.
Users will also be able to create friends, upload posts, like, comment and share on posts. While uploading a post, user can also mention their activities like Eating, Reading, Playing etc. User can also add attachments (image/video) with the post as well.
While liking the post, user can give a reaction as well. For example, like, love, angry, sad, laugh etc. Then on frontend, you can show relevant icons based on user’s reaction.
You can download the source code from here:
After download, extract the files in your htdocs folder if you are using XAMPP/MAMP or www if you are using WAMP. After that, goto file “config/database.php” and set your database credentials.
'mysql' => [
...
'host' => '127.0.0.1',
'port' => '3306',
'database' => 'social_network',
'username' => 'root',
'password' => '',
...
],
Then create a database named “social_network” in your phpMyAdmin.
After that, you need to rename the file “.env.example” to just “.env”.
Once the rename is done, you need to run the following commands at the root of your project:
(You can write any name, email or password of your choice for super admin while running 5th command)
1) COMPOSER_MEMORY_LIMIT=-1 composer update
2) php artisan key:generate
3) php artisan storage:link
4) php artisan migrate
5) name="Admin" email="admin@adnan-tech.com" password="admin" php artisan db:seed --class=DatabaseSeeder
6) php artisan serve
Once you have ran all the commands, you will be able to access the social network from:
http://localhost:8000
You can access your admin panel by accessing the following URL:
http://localhost:8000/admin
Make sure to use the credentials you have set on step 5 above.
That will work on your localhost, but if you want to deploy this on a live server, follow our guide to deploy a Laravel project on a live server.