Changeset d795fa6 for database


Ignore:
Timestamp:
10/17/21 18:39:50 (3 years ago)
Author:
Berat Kjufliju <kufliju@…>
Branches:
develop, master
Children:
bd9e8e3
Parents:
120759b
Message:

added validation to blades

Location:
database
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • database/factories/DepartmentFactory.php

    r120759b rd795fa6  
    2828        return [
    2929            'id' => $this->faker->unique()->randomNumber(),
    30             'name' => $this->faker->domainName(),
     30            'name' => $this->faker->name(),
    3131            'code' => $location,
    3232            'location' => 'Departments/' . $location,
  • database/factories/UserFactory.php

    r120759b rd795fa6  
    2929            'password' => $this->faker->password(),
    3030            'email' => $this->faker->email(),
    31             'mobile_number' => $this->faker->phoneNumber(),
     31            'phone_number' => $this->faker->phoneNumber(),
    3232            'role_id' => $this->faker->numberBetween(1, 2),
    3333            'is_online' => $this->faker->boolean,
    3434            'is_confirmed' => $this->faker->boolean,
    3535            'is_forgot_password' => $this->faker->boolean,
     36            'created_by' => "1",
    3637            'created_at' => Carbon::now()
    3738        ];
  • database/migrations/2021_09_27_171107_create_users_table.php

    r120759b rd795fa6  
    2222            $table->string('password');
    2323            $table->string('email')->unique();
    24             $table->string('mobile_number')->unique();
     24            $table->string('phone_number')->unique();
    2525            $table->string('avatar')->nullable();
    2626            $table->integer('role_id')->unsigned();
     
    3232            $table->integer('security_code')->nullable();
    3333            $table->string('verify_token')->nullable();
     34            $table->integer("created_by")->unsigned();
    3435            $table->rememberToken();
    3536            $table->timestamps();
     37
     38            $table->foreign("created_by")->references("id")->on("users")->onDelete("cascade")->onUpdate("cascade");
    3639        });
    3740    }
  • database/migrations/2021_09_29_121244_create_departments_table.php

    r120759b rd795fa6  
    2323
    2424            $table->foreign("user_id")->references("id")->on("users")->onDelete("cascade")->onUpdate("cascade");
    25 
    2625        });
    2726    }
  • database/seeders/PermissionsTableSeeder.php

    r120759b rd795fa6  
    2727            ["name" => "delete_all_documents"],         // Delete all document/s
    2828            ["name" => "delete_document"],              // Delete your document/s
     29            ["name" => "manage_file_types"],    // Access all file_types to manage
    2930        ]);
    3031    }
  • database/seeders/RolesPermissionsTableSeeder.php

    r120759b rd795fa6  
    2626            ["role_id" => 1, "permission_id" => 9],
    2727            ["role_id" => 1, "permission_id" => 10],
     28            ["role_id" => 1, "permission_id" => 11],
    2829
    2930            // Referent
     
    3637            ["role_id" => 2, "permission_id" => 9],
    3738            ["role_id" => 2, "permission_id" => 10],
     39            ["role_id" => 2, "permission_id" => 11],
    3840
    3941            // Viewer
  • database/seeders/UsersTableSeeder.php

    r120759b rd795fa6  
    2222            "password" => bcrypt("123456"),
    2323            "email" => "kufliju@gmail.com",
    24             "mobile_number" => "+38971201239",
     24            "phone_number" => "+38971201239",
    2525            "role_id" => 1,
    2626            "is_active" => true,
    2727            "is_confirmed" => true,
     28            "created_by" => "1",
    2829            "created_at" => Carbon::now()
    2930        ]);
Note: See TracChangeset for help on using the changeset viewer.