This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$listOfUsers = User::whereHas('roles', function ($query) use($subuser) { | |
$query->where('name', 'like', $subuser); | |
}) | |
->whereHas('profile', function ($query) use($statesid) { | |
$query->where('state_id', '=',$statesid); | |
}) | |
->whereNotIn('id', $val)->get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"username": "2312321", | |
"user": { | |
"name": "tests214213s", | |
"email": "[email protected]", | |
"nric": "2312321", | |
"mobile_no": "0123923", | |
"office_phone_no": "1203912032", | |
"address": "asdladlkaldk", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function login(Request $request) | |
{ | |
$credentials = $request->only('username', 'password'); | |
if ( ! $token = JWTAuth::attempt($credentials)) { | |
return response([ | |
'status' => 'error', | |
'error' => 'invalid.credentials', | |
'msg' => 'Invalid Credentials.' | |
], 400); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
DocumentRoot /var/www/html/ | |
ServerName example.com | |
<Directory /var/www/html/ebiddi-api/public> | |
Options +FollowSymlinks | |
AllowOverride All | |
Require all granted | |
</Directory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function showOneUser($id) | |
{ | |
$users =User::findOrFail($id)->with('roles')->with('states_val')->get(); | |
$response['data'] = $users; | |
return response()->json($response,200); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function eDoc2a($id) | |
{ | |
// return view('co::eDoc2.show2'); | |
$am = DB::table('b_bancimain') | |
->where('bbanci_id', $id)->get(); | |
$side = DB::table('v_edoc2_side') | |
->first(); | |
$data['meta'] = $side; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="{{ route('update1',['id'=>$ih->b3b_Id]) }}" method="POST"> | |
@csrf | |
{{ method_field('PUT') }} | |
///routes.php | |
Route::put('edoc3b-edit/{id}', 'Edoc3bController@update1')->name('update1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function update1(Request $request,$id) | |
{ | |
$isirumah= DB::table('b_edoc3b') | |
->where('b3b_Id',$id)->get(); | |
$isirumah->b3b_nama=$request->namapenuh; | |
$isirumah->b3b_hubungan=$request->hubungankir; | |
$isirumah->b3b_jantina=$request->jantina; | |
$isirumah->b3b_tarikhLahir=$request->tarikhlahir; | |
$isirumah->b3b_umur=$request->umur; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class User extends Model | |
{ | |
/** | |
* The attributes that are mass assignable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$users = User::all(); | |
$response = []; | |
foreach($users as $user) { | |
$userArray = $user->toArray(); | |
$roles = $user->roles()->select(array('id', 'role_name'))->get(); | |
$states = $user->states_val()->select(array('id', 'state_name'))->get(); | |
$credits = $user->credits()->withPivot('amount')->get(); | |
$companies = $user->companies()->get(); | |
foreach($roles as $role) { | |
$userArray['roles'] = $role; |
NewerOlder