MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

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 Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

HOW TO CREATE EVENT CALENDAR IN LARAVEL? PART-2

Step 1.Create a Laravel Project Firstly, Create a new project in laravel, so we open Git Bash,  Go to My Computer/This PC–>LocalDisk(C:)–>Xampp–>Htdocs (Press right click on Mouse)…

Read More

How to display a table in a Verticle or Horizontal form in the Laravel PHP Framework? Part-1

How to display a table in a Verticle or Horizontal form in the Laravel PHP Framework? How to Store Seed file into Database. Click There are two…

Read More

HOW TO CREATE EVENT CALENDAR IN LARAVEL? PART-3

Step 1.Create a Database in phpMyAdmin. (Write the same name of database which was written in .enf databse name). Step 2.  We use the migrate command to…

Read More

How to file upload in DB With local folder using laravel 5.8

Step:1 you have to make these(A) – php artisan make:controller ImageUploadController(B) – php artisan make:model ImageUpload -m Step:2 Open the welcome.blade.php page then write this code. Step:3…

Read More

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP? (Part-3)

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP Part-1 Part- 2 Step 1. Create a City seeder file. Write down the…

Read More

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP? (Part-1)

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP? Part- 2 Part- 3 Step 1. Create a Country seeder file. Write down…

Read More