Guest User

Untitled

a guest
May 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. public function up()
  2. {
  3. Schema::create('users', function (Blueprint $table) {
  4. $table->increments('id');
  5. $table->string('name');
  6. $table->string('email')->unique();
  7. $table->string('password');
  8. $table->rememberToken();
  9. $table->timestamps();
  10. $table->string('section');
  11. $table->string('type');
  12. });
  13. }
  14.  
  15. public function up()
  16. {
  17. Schema::create('staffs', function (Blueprint $table) {
  18. $table->increments('id');
  19. $table->timestamps();
  20. $table->string('nama');
  21. $table->string('emel')->unique();
  22. $table->string('seksyen');
  23. $table->string('jawatan');
  24. $table->string('alamat');
  25. $table->string('no kakitangan');
  26. });
  27.  
  28. $data['data'] = DB::table('staffs')
  29. ->join('users', 'users.section', '=', 'staffs.seksyen')
  30. ->where('seksyen','=','Auth(section)')->get();
Add Comment
Please, Sign In to add comment