Commit 4d3d97ba authored by raphael.peim's avatar raphael.peim

Add sign in feature

parent e2fba607
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'eslint:recommended'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# exercice2
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
This diff is collapsed.
{
"name": "exercice2",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11",
"vue-router": "^3.2.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<div id="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</div>
<router-view/>
</div>
</template>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
#nav {
padding: 30px;
}
#nav a {
font-weight: bold;
color: #2c3e50;
}
#nav a.router-link-exact-active {
color: #42b983;
}
</style>
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
import Vue from 'vue'
import App from './App.vue'
import router from './router'
Vue.config.productionTip = false
new Vue({
router,
render: h => h(App)
}).$mount('#app')
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'Home',
component: Home
},
{
path: '/about',
name: 'About',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
}
]
const router = new VueRouter({
routes
})
export default router
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
</template>
<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
export default {
name: 'Home',
components: {
HelloWorld
}
}
</script>
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'eslint:recommended'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# exercice3
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
This diff is collapsed.
{
"name": "exercice3",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"bootstrap": "^4.5.3",
"bootstrap-vue": "^2.19.0",
"core-js": "^3.6.5",
"vue": "^2.6.12",
"vue-router": "^3.2.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<router-view/>
</div>
</template>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
</style>
#home {
display: flex;
flex-direction: column;
}
#navbar b-collapse {
display: flex;
}
\ No newline at end of file
<template>
<div id="navbar">
<!-- primary, success, info, warning, danger, dark, or light -->
<b-navbar toggleable="lg" type="dark" variant="primary">
<b-navbar-brand>TP2</b-navbar-brand>
<b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
<b-collapse id="nav-collapse" is-nav>
<b-navbar-nav class="ml-auto">
<b-nav-item-dropdown text="Utilisateur" right>
<b-dropdown-item>Profil</b-dropdown-item>
<b-dropdown-item @click="onClick">Déconnexion</b-dropdown-item>
</b-nav-item-dropdown>
</b-navbar-nav>
</b-collapse>
</b-navbar>
</div>
</template>
<script>
export default {
name: 'Navbar'
}
</script>
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import BootstrapVue from 'bootstrap-vue'
import '@/assets/css/style.css'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
Vue.use(BootstrapVue)
Vue.config.productionTip = false
new Vue({
router,
render: h => h(App)
}).$mount('#app')
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'Home',
component: Home
}
]
const router = new VueRouter({
routes
})
export default router
<template>
<div id="home">
<Navbar/>
</div>
</template>
<script>
import Navbar from '@/components/Navbar'
export default {
name: 'Home',
components: {
Navbar
}
}
</script>
<style>
#home {
display: flex;
flex-direction: column;
}
</style>
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class MigrateInOrder extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'migrate_in_order';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This method migrate tables in order';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$migrations = [
'2020_11_27_080001_users_table',
'2020_11_27_080002_category_table',
'2020_11_27_080003_game_table',
'2020_11_27_080004_tournament_table',
'2020_11_27_080005_part_table',
'2020_11_27_080006_participation_table',
'2020_11_27_080007_play_table'
];
foreach($migrations as $migration)
{
$basePath = 'database/migrations/';
$migrationName = trim($migration);
$path = $basePath.$migrationName;
$this->call('migrate:refresh', [
'--path' => $path ,
]);
}
}
}
\ No newline at end of file
...@@ -12,9 +12,7 @@ class Kernel extends ConsoleKernel ...@@ -12,9 +12,7 @@ class Kernel extends ConsoleKernel
* *
* @var array * @var array
*/ */
protected $commands = [ protected $commands = [ Commands\MigrateInOrder::class ];
//
];
/** /**
* Define the application's command schedule. * Define the application's command schedule.
......
...@@ -6,6 +6,10 @@ use Illuminate\Http\Request; ...@@ -6,6 +6,10 @@ use Illuminate\Http\Request;
class MyController extends Controller { class MyController extends Controller {
public function home() { public function home() {
return view('child'); return view('home');
}
public function login() {
return view('login');
} }
} }
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Game extends Model
{
use HasFactory;
protected $connection = 'esport';
protected $table = 'game';
protected $primaryKey = 'id';
public $incrementing = true;
public $timestamps = false;
}
...@@ -14,12 +14,10 @@ class CreateUsersTable extends Migration ...@@ -14,12 +14,10 @@ class CreateUsersTable extends Migration
public function up() public function up()
{ {
Schema::create('users', function (Blueprint $table) { Schema::create('users', function (Blueprint $table) {
$table->id(); $table->increment('id');
$table->string('name'); $table->string('name');
$table->string('email')->unique(); $table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable(); $table->string('firstname');
$table->string('password');
$table->rememberToken();
$table->timestamps(); $table->timestamps();
}); });
} }
......
...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; ...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration class CategoryTable extends Migration
{ {
/** /**
* Run the migrations. * Run the migrations.
...@@ -13,10 +13,10 @@ class CreatePasswordResetsTable extends Migration ...@@ -13,10 +13,10 @@ class CreatePasswordResetsTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('password_resets', function (Blueprint $table) { Schema::create('category', function (Blueprint $table) {
$table->string('email')->index(); $table->increments('id');
$table->string('token'); $table->string('description')->nullable();
$table->timestamp('created_at')->nullable(); $table->timestamps();
}); });
} }
...@@ -27,6 +27,6 @@ class CreatePasswordResetsTable extends Migration ...@@ -27,6 +27,6 @@ class CreatePasswordResetsTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('password_resets'); //
} }
} }
...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; ...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration class GameTable extends Migration
{ {
/** /**
* Run the migrations. * Run the migrations.
...@@ -13,14 +13,13 @@ class CreateFailedJobsTable extends Migration ...@@ -13,14 +13,13 @@ class CreateFailedJobsTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('failed_jobs', function (Blueprint $table) { Schema::create('game', function(Blueprint $table) {
$table->id(); $table->increments('id');
$table->string('uuid')->unique(); $table->integer('id_category')->unsigned();
$table->text('connection'); $table->string('title');
$table->text('queue'); $table->integer('version');
$table->longText('payload'); $table->foreign('id_category')->references('id')->on('category')->onDelete('restrict')->onUpdate('cascade');
$table->longText('exception'); $table->timestamps();
$table->timestamp('failed_at')->useCurrent();
}); });
} }
...@@ -31,6 +30,6 @@ class CreateFailedJobsTable extends Migration ...@@ -31,6 +30,6 @@ class CreateFailedJobsTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('failed_jobs'); //
} }
} }
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class TournamentTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tournament', function (Blueprint $table) {
$table->increments('id');
$table->string('description')->nullable();
$table->date('tournament_date');
$table->integer('id_game')->unsigned();
$table->foreign('id_game')->references('id')->on('game')->onDelete('restrict')->onUpdate('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class PartTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('part', function (Blueprint $table) {
$table->increments('id');
$table->integer('id_tournament')->unsigned();
$table->integer('level');
$table->foreign('id_tournament')->references('id')->on('tournament')->onDelete('restrict')->onUpdate('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ParticipationTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('participation', function (Blueprint $table) {
$table->bigInteger('id_user')->unsigned();
$table->integer('id_tournament')->unsigned();
$table->primary(['id_user', 'id_tournament']);
$table->foreign('id_user')->references('id')->on('users')->onDelete('restrict')->onUpdate('cascade');
$table->foreign('id_tournament')->references('id')->on('tournament')->onDelete('restrict')->onUpdate('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class PlayTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('play', function (Blueprint $table) {
$table->increments('id');
$table->bigInteger('id_user')->unsigned();
$table->integer('id_part')->unsigned();
$table->integer('score');
$table->foreign('id_user')->references('id')->on('users')->onDelete('restrict')->onUpdate('cascade');
$table->foreign('id_part')->references('id')->on('part')->onDelete('restrict')->onUpdate('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/*!
* Bootstrap Reboot v4.5.3 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors
* Copyright 2011-2020 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([class]){color:inherit;text-decoration:none}a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit;text-align:-webkit-match-parent}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* All */
body { body {
display: flex; display: flex;
flex-direction: row; flex-direction: column;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.sidebar { #header {
display: flex; display: flex;
height: 100%; background-image: url('../../resources/img/header.jpg');
margin-right: 20px; height: 50px;
margin-bottom: 10px;
} }
.container { .container {
display: flex; display: flex;
flex-direction: column; justify-content: center;
}
#center {
text-align: center;
}
/* Login */
#login-card {
width: 400px;
text-align: center;
} }
\ No newline at end of file
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
@section('title', 'Accueil') @section('title', 'Accueil')
@section('sidebar') @section('header')
@parent @parent
@endsection @endsection
@section('content') @section('content')
<p>Hello</p> <h1>Bienvenue</h1>
<a href="{{ url('/login') }}"><button type="button" class="btn btn-dark">Connectez-vous</button></a>
@endsection @endsection
\ No newline at end of file
@extends('template')
@section('title', 'Accueil')
@section('header')
@parent
@endsection
@section('content')
<div class="card">
<h5 class="card-header">Connectez-vous</h5>
<div id="login-card" class="card-body">
<form>
<div class="form-group row">
<input type="text" class="form-control" id="name" placeholder="Nom">
</div>
<div class="form-group row">
<input type="password" class="form-control" id="password" placeholder="Mot de passe">
</div>
<button class="btn btn-primary" type="submit">Connexion</button>
</form>
</div>
</div>
@endsection
\ No newline at end of file
<html> <html>
<head> <head>
<title>@yield('title')</title> <title>@yield('title')</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="csrf-token" content="{{ csrf_token() }}">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<link rel="stylesheet" href="../resources/css/app.css"> <link rel="stylesheet" href="../resources/css/app.css">
</head> </head>
<body> <body>
@section('sidebar') @section('header')
<div class="sidebar"> <div id="header"></div>
<img src="../resources/img/sidebar.png"/>
</div>
@show @show
<div class="container"> <div class="container">
@yield('content') <div id="center">
@yield('content')
</div>
</div> </div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="../resources/bootstrap/js/bootstrap.bundle.min.js"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -13,20 +13,22 @@ use Illuminate\Support\Facades\Route; ...@@ -13,20 +13,22 @@ use Illuminate\Support\Facades\Route;
| |
*/ */
Route::get('/tp', 'App\Http\Controllers\MyController@home'); Route::get('/', 'App\Http\Controllers\MyController@home');
Route::get('/login', 'App\Http\Controllers\MyController@login');
Route::get('/', function () { // Exemples
return 'Hello world'; // Route::get('/', function () {
}); // return 'Hello world';
// });
Route::get('/{firstname}/{name}', function ($firstname, $name) { // Route::get('/{firstname}/{name}', function ($firstname, $name) {
return "Welcome $firstname $name"; // return "Welcome $firstname $name";
}) -> name('welcome'); // }) -> name('welcome');
Route::get('/firstView', function () { // Route::get('/firstView', function () {
return view('myView'); // return view('myView');
}); // });
Route::get('/template', function () { // Route::get('/template', function () {
return view('child'); // return view('child');
}); // });
This diff is collapsed.
...@@ -8,10 +8,17 @@ ...@@ -8,10 +8,17 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"aws-sdk": "^2.799.0",
"axios": "^0.21.0",
"bcrypt": "^5.0.0",
"bcryptjs": "^2.4.3",
"bootstrap": "^4.5.3", "bootstrap": "^4.5.3",
"bootstrap-vue": "^2.19.0", "bootstrap-vue": "^2.19.0",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"cors": "^2.8.5",
"jquery": "^3.5.1",
"vue": "^2.6.12", "vue": "^2.6.12",
"vue-axios": "^3.2.0",
"vue-router": "^3.2.0" "vue-router": "^3.2.0"
}, },
"devDependencies": { "devDependencies": {
......
<?php <?php
header("Access-Control-Allow-Origin: http://localhost:8080");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
header("Access-Control-Allow-Headers: Content-Type, Authorization");
$rootDirectoryPath = realpath(dirname(__FILE__)); $rootDirectoryPath = realpath(dirname(__FILE__));
define ('__ROOT_DIR', $rootDirectoryPath ); define ('__ROOT_DIR', $rootDirectoryPath );
......
...@@ -50,8 +50,7 @@ ...@@ -50,8 +50,7 @@
$response = Response::okResponse("Utilisateur ajouté"); $response = Response::okResponse("Utilisateur ajouté");
} }
else { else {
// $response = Response::notFoundResponse("Aucun utilisateur ajouté"); $response = Response::notFoundResponse("Aucun utilisateur ajouté");
$response = Response::notFoundResponse(var_dump($post));
} }
return $response; return $response;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
':lastname' => $post->lastname, ':lastname' => $post->lastname,
':login' => $post->login, ':login' => $post->login,
':email' => $post->email, ':email' => $post->email,
':password' => password_hash($post->password, PASSWORD_BCRYPT), ':password' => $post->password,
':role' => $post->role]); ':role' => $post->role]);
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment