Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

55 Steps For build a project in php Laravel Framework.

1.laravel new project (open command prompt on xampp/htdocs directory)

[code language=”sql”]
composer create-project –prefer-dist laravel/laravel projectname
[/code]

2.cd projectname

3.[code language=”sql”]
php artisan make:auth
[/code]

4.Customise users table(database/migration/create_users_table.php)

[code language=”sql”]
$table->bigInteger(‘role_id’)->default(2);
$table->string(‘name’);
$table->string(‘username’)->unique();
$table->string(’email’)->unique();
$table->string(‘password’);
$table->string(‘image’)->default(‘default.png’);
$table->string(‘about’)->nullable();
[/code]

5.Make Model and Migration for Role Table

[code language=”sql”]
php artisan make:model Role -m
[/code]

6.Customise roles table(database/migration/create_roles_table.php)

[code language=”sql”]
$table->string(‘name’);
$table->string(‘slug’);
[/code]

7.Make Relationship between users and roles tables through Role Model and User Model

8. In Role Model create users() Function for Relationship

[code language=”sql”]
public function users()
{
return $this->hasMany(‘App\User’);
}
[/code]

9.In User Model create role() Function for relationship

[code language=”sql”]
public function users()
public function role()
{
return $this->belongsTo(‘App\Role’);
}

[/code]

10.Make UsersTableSeeder file for insert data in users table through migration

[code language=”sql”]
php artisan make:seed UsersTableSeeder
[/code]

11.Make RolesTableSeeder file for insert data in roles table through migration

[code language=”sql”]php artisan make:seed RoleTableSeeder[/code]

12.Edit RoleTableSeeder.php(database/seeds/RoleTableSeeder.php) file for insert data in roles table

[code language=”sql”]
use Illuminate\Support\Facades\DB;
public function run()
{
DB::table(‘roles’)->insert([
‘name’ => ‘Admin’,
‘slug’ => ‘admin’,
]);

DB::table(‘roles’)->insert([
‘name’ => ‘User’,
‘slug’ => ‘user’,
]);
}
[/code]

13.Edit UserTableSeeder.php(database/seeds/UserTableSeeder.php) file for insert data in users table

[code language=”sql”]
use Illuminate\Support\Facades\DB;
public function run()
{
DB::table(‘users’)->insert([
‘role_id’ => ‘1’,
‘name’ => ‘Admin’,
‘username’ => ‘admin’,
’email’ => ‘admin@blog.com’,
‘password’ => bcrypt(‘rootadmin’),
]);

DB::table(‘users’)->insert([
‘role_id’ => ‘2’,
‘name’ => ‘User’,
‘username’ => ‘user’,
’email’ => ‘user@blog.com’,
‘password’ => bcrypt(‘rootuser’),
]);
}
[/code]

14.Set Server and Database Name in .env file

[code language=”sql”]
DB_DATABASE=blog
DB_USERNAME=root
DB_PASSWORD=
[/code]

15.Migration of tables in database

[code language=”sql”]
php artisan migrate
[/code]

php artisan migrate

16.Define UsersTableSeeder and RoleTableSeeder Class on DatabaseSeeder.php file
	(database/seeds/DatabaseSeeder.php)

[code language=”sql”]
php artisan migrate
[/code]

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

What is CodeIgniter and use cases of CodeIgniter?

What is CodeIgniter? CodeIgniter is an open-source PHP web application framework designed to simplify and accelerate web development. It follows the Model-View-Controller (MVC) architectural pattern and provides…

Read More

What is Laravel and use cases of Laravel?

What is Laravel? Laravel is an open-source, free PHP web framework designed for the development of web applications following the model-view-controller (MVC) architectural pattern. It was generated…

Read More

What is PHP and use cases of PHP?

What is PHP? Are you wondering what PHP is and how it works? Look no further! In this article, we will explore the ins and outs of…

Read More

Complete guide of Laravel certification courses, tutorials & training

What is Laravel Laravel is a reliable and simple to use open-source PHP framework. It adheres to the model-view-controller pattern of design. Laravel makes use of pre-existing…

Read More

Complete guide on PHP certification courses, tutorials & training

What is PHP Hypertext Preprocessor is known as PHP. Many developers use PHP, an open-source server-side programming language, to create websites. In addition, it is a general-purpose…

Read More

Complete PHP with Laravel Certification Guide & tutorials

What is PHP with Laravel? PHP was visioned eventually in the fall of 1994 by Rasmus Lerdorf. PHP means Hypertext Preprocessor. It’s a extensively- used, open source…

Read More