145 lines
4.9 KiB
PHP
145 lines
4.9 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<title>Laravel</title>
|
|
|
|
<!-- Fonts -->
|
|
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
|
|
|
|
<script src="{{ asset('js/jquery.min.js') }}"></script>
|
|
|
|
<!-- Styles -->
|
|
<style>
|
|
html, body {
|
|
background-color: #fff;
|
|
color: #636b6f;
|
|
font-family: 'Nunito', sans-serif;
|
|
font-weight: 200;
|
|
height: 100vh;
|
|
margin: 0;
|
|
}
|
|
|
|
.full-height {
|
|
height: 100vh;
|
|
}
|
|
|
|
.flex-center {
|
|
align-items: center;
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
|
|
.position-ref {
|
|
position: relative;
|
|
}
|
|
|
|
.top-right {
|
|
position: absolute;
|
|
right: 10px;
|
|
top: 18px;
|
|
}
|
|
|
|
.content {
|
|
text-align: center;
|
|
}
|
|
|
|
.title {
|
|
font-size: 84px;
|
|
}
|
|
|
|
.links > a {
|
|
color: #636b6f;
|
|
padding: 0 25px;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
letter-spacing: .1rem;
|
|
text-decoration: none;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.m-b-md {
|
|
margin-bottom: 30px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="flex-center position-ref full-height">
|
|
@if (Route::has('login'))
|
|
<div class="top-right links">
|
|
@auth
|
|
<a href="{{ url('/home') }}">Home</a>
|
|
@else
|
|
<a href="{{ route('login') }}">Login</a>
|
|
|
|
@if (Route::has('register'))
|
|
<a href="{{ route('register') }}">Register</a>
|
|
@endif
|
|
@endauth
|
|
</div>
|
|
@endif
|
|
|
|
<div class="content">
|
|
<div class="title m-b-md">
|
|
Laravel
|
|
</div>
|
|
|
|
<button onclick="login()">Login</button>
|
|
<button onclick="logout()">Logout</button>
|
|
|
|
<div class="links">
|
|
<a href="https://laravel.com/docs">Docs</a>
|
|
<a href="https://laracasts.com">Laracasts</a>
|
|
<a href="https://laravel-news.com">News</a>
|
|
<a href="https://blog.laravel.com">Blog</a>
|
|
<a href="https://nova.laravel.com">Nova</a>
|
|
<a href="https://forge.laravel.com">Forge</a>
|
|
<a href="https://vapor.laravel.com">Vapor</a>
|
|
<a href="https://github.com/laravel/laravel">GitHub</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
<script>
|
|
|
|
function login()
|
|
{
|
|
|
|
$.ajax({
|
|
method:'post',
|
|
url: 'http://e-arrahn.test/api/mobile/login',
|
|
data: {
|
|
email : "afiqbasari@outlook.com",
|
|
password : "Abc123"
|
|
},
|
|
success:function(data){
|
|
console.log(data);
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function logout()
|
|
{
|
|
$.ajax({
|
|
method:'post',
|
|
url: 'http://e-arrahn.test/api/mobile/logout',
|
|
headers: {
|
|
Authorization : "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiN2RiMTIxNjcwZDMxMzhkMDdkZTBmZGE0ODcwOGRkMDk2MTdlYzIyM2VkYjk5ZWE4ZTM5Mjg4YTk5YjQ4MDM3YjI0MWJjYzJkMWFmNzM3YzIiLCJpYXQiOjE2MDkyOTE5NzYsIm5iZiI6MTYwOTI5MTk3NiwiZXhwIjoxNjQwODI3OTc2LCJzdWIiOiIzOCIsInNjb3BlcyI6W119.XsDYDfxdb7DHHvF38nC7Mz-sKTZ1G5tLdHgOtdtPbK5-FaQyn9N4DuWsNjgLUS4gj2f3Hq4qojzCn8n3wunkLwA9WxguHKx2npvaw7lhyrLOLHeR2kpsnmHBN4xm9PHVjZyYJrdN6ud3rIfa01ZLRKiLcaPNEDIFpt6iPbemMa7bUTgUzQlKKgABwBcJeTgR5kqG79PP6j4twoysI6d03flugP5hkJOEnec-5zDOwIO8dbPcbkMOB4udJpSZ0CGcqqz7-8YXc_a-n_GRA3vRXjMh-3N58gLrw8RZv9Oj-A6l9KBoChJ7osLB47BcPppgdupzIsVGpmYaNfMisg6mbNVfml5x6WbhSv0xJ0fUvjQevuM3cLNQR4WZO_Y1YOCcDAyACvWSAUph8x53LXxZ-Z9tcBOZAWon1c5ISFTvwNhVn2zFTVH9iZddATOwRiapPwZxwZ2eZSlRqs6yiqBPC1BoVyhdxDG9AO4ua3QN-NIn7q16pqtEUmLcW2K9lVJXiz8Ux7nQSir1bn2UhiWjBA1mk2x9mTJpkWi_eRcG0rroqEEHNWIdfj0BJ27p2XGPo2u0dGYqXB5P9EKMs9d4_Px7q5Mo2euTaSsw8Z5gHXVvPk9eq9XBg0qkzlBe4VcH_ceyRO3oRSMra2Irl4tp2BuJB9Qleu1KVg4AxEgHlbA",
|
|
Accept: "application/json",
|
|
'Access-Control-Allow-Origin' : '*',
|
|
'Access-Control-Allow-Methods':'GET,PUT,POST,DELETE,PATCH,OPTIONS'
|
|
},
|
|
success:function(data){
|
|
console.log(data);
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
</html>
|