begin mmc
This commit is contained in:
84
app/Http/Controllers/AUKController.php
Normal file
84
app/Http/Controllers/AUKController.php
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class AUKController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
84
app/Http/Controllers/DocumentController.php
Normal file
84
app/Http/Controllers/DocumentController.php
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class DocumentController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
122
app/Http/Controllers/MMCController.php
Normal file
122
app/Http/Controllers/MMCController.php
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Models\Project;
|
||||||
|
|
||||||
|
class MMCController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*
|
||||||
|
* @param int $project_id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function index($project_id)
|
||||||
|
{
|
||||||
|
$project = Project::find($project_id);
|
||||||
|
return view('mmc.show', ['project' => $project]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*
|
||||||
|
* @param int $project_id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function create($project_id)
|
||||||
|
{
|
||||||
|
$project = Project::find($project_id);
|
||||||
|
return view('mmc.create',['project' => $project]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*
|
||||||
|
* @param int $project_id
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function store($project_id,Request $request)
|
||||||
|
{
|
||||||
|
// $request->validate([
|
||||||
|
// 'username' => ['required', 'string', 'max:255'],
|
||||||
|
// 'name' => ['required', 'string', 'max:255'],
|
||||||
|
// 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||||
|
// 'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
// // $user =
|
||||||
|
// MMC::create([
|
||||||
|
// 'username' => $request->username,
|
||||||
|
// 'name' => $request->name,
|
||||||
|
// 'email' => $request->email,
|
||||||
|
// 'is_admin' => false,
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
// return redirect(route('mmc.index',$project_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*
|
||||||
|
* @param int $project_id
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function show($project_id,$id)
|
||||||
|
{
|
||||||
|
// $user = User::find($id);
|
||||||
|
// return view('admin.users.show', ['user' => $user]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
// $user = User::find($id);
|
||||||
|
// return view('admin.users.edit', ['user' => $user]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
// $request->validate([
|
||||||
|
// 'username' => 'required|string|max:255|unique:users,username,' . $id,
|
||||||
|
// 'name' => 'required|string|max:255',
|
||||||
|
// 'email' => 'required|email|unique:users,email,' . $id,
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
// $user = User::find($id);
|
||||||
|
|
||||||
|
// $user->username = $request->username;
|
||||||
|
// $user->name = $request->name;
|
||||||
|
// $user->email = $request->email;
|
||||||
|
// $user->save();
|
||||||
|
|
||||||
|
// return redirect(route('users.index'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
// User::findOrFail($id)->delete();
|
||||||
|
// return redirect()->route('users.index');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -836,6 +836,9 @@ select {
|
|||||||
.shrink-0 {
|
.shrink-0 {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
.basis-1\/2 {
|
||||||
|
flex-basis: 50%;
|
||||||
|
}
|
||||||
.origin-top-left {
|
.origin-top-left {
|
||||||
transform-origin: top left;
|
transform-origin: top left;
|
||||||
}
|
}
|
||||||
@@ -870,6 +873,9 @@ select {
|
|||||||
.grid-cols-1 {
|
.grid-cols-1 {
|
||||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||||
}
|
}
|
||||||
|
.flex-row {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
.flex-col {
|
.flex-col {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
@php
|
||||||
|
use App\Models\Project;
|
||||||
|
$projects = Project::all()->sortBy('id');
|
||||||
|
@endphp
|
||||||
<x-app-layout>
|
<x-app-layout>
|
||||||
<x-slot name="header">
|
<x-slot name="header">
|
||||||
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
|
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
|
||||||
@@ -9,7 +13,33 @@
|
|||||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||||
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
|
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
|
||||||
<div class="p-6 bg-white border-b border-gray-200">
|
<div class="p-6 bg-white border-b border-gray-200">
|
||||||
You're logged in!
|
Select Project:
|
||||||
|
<div align="center" class="pt-4">
|
||||||
|
<table class="table table-sm border-b border-gray-200">
|
||||||
|
<tr class="border border-gray-200">
|
||||||
|
<th class="p-2 border border-gray-200">
|
||||||
|
{{ __('Title') }}
|
||||||
|
</th>
|
||||||
|
<th class="p-2 border border-gray-200">
|
||||||
|
{{ __('Comment') }}
|
||||||
|
</th>
|
||||||
|
<th class="p-2 border border-gray-200">
|
||||||
|
{{ __('MMC Path') }}
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
@forelse ($projects as $project)
|
||||||
|
<tr class="border border-gray-200">
|
||||||
|
<td class="p-2 border border-gray-200"><a href="{{ route('mmc.index',$project->id) }}" class="underline">{{ $project->name }}</a></td>
|
||||||
|
<td class="p-2 border border-gray-200">{{ $project->description }}</td>
|
||||||
|
<td class="p-2 border border-gray-200">{{ $project->mmc_path }}</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td colspan="3" class="p-2 border border-gray-200 text-center">No Projects!</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -28,6 +28,23 @@
|
|||||||
{{ __('Projects') }}
|
{{ __('Projects') }}
|
||||||
</x-nav-link>
|
</x-nav-link>
|
||||||
</div>
|
</div>
|
||||||
|
@isset($project)
|
||||||
|
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
|
||||||
|
<x-nav-link :href="route('mmc.index')" :active="request()->routeIs('mmc.index')|request()->routeIs('mmc.create')|request()->routeIs('mmc.show')|request()->routeIs('mmc.edit')">
|
||||||
|
{{ __('MMC') }}
|
||||||
|
</x-nav-link>
|
||||||
|
</div>
|
||||||
|
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
|
||||||
|
<x-nav-link :href="route('documents.index')" :active="request()->routeIs('documents.index')|request()->routeIs('documents.create')|request()->routeIs('documents.show')|request()->routeIs('documents.edit')">
|
||||||
|
{{ __('Documents') }}
|
||||||
|
</x-nav-link>
|
||||||
|
</div>
|
||||||
|
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
|
||||||
|
<x-nav-link :href="route('auk.index')" :active="request()->routeIs('auk.index')|request()->routeIs('auk.create')|request()->routeIs('auk.show')|request()->routeIs('auk.edit')">
|
||||||
|
{{ __('AUK') }}
|
||||||
|
</x-nav-link>
|
||||||
|
</div>
|
||||||
|
@endisset
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Settings Dropdown -->
|
<!-- Settings Dropdown -->
|
||||||
|
|||||||
0
resources/views/mmc/create.blade.php
Normal file
0
resources/views/mmc/create.blade.php
Normal file
24
resources/views/mmc/show.blade.php
Normal file
24
resources/views/mmc/show.blade.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<x-slot name="header">
|
||||||
|
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
|
||||||
|
<div class="flex flex-row">
|
||||||
|
<div class="basis-1/2">
|
||||||
|
{{ __('Selected project') }}: {{ $project->name }}
|
||||||
|
</div>
|
||||||
|
<div class="basis-1/2">
|
||||||
|
{{ __('MMC path') }}: {{ $project->mmc_path }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</h2>
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
<div class="py-12">
|
||||||
|
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||||
|
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
|
||||||
|
<div class="p-6 bg-white border-b border-gray-200">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-app-layout>
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Http\Controllers\AUKController;
|
||||||
|
use App\Http\Controllers\DocumentController;
|
||||||
|
use App\Http\Controllers\MMCController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use App\Http\Controllers\UserController;
|
use App\Http\Controllers\UserController;
|
||||||
use App\Http\Controllers\ProjectController;
|
use App\Http\Controllers\ProjectController;
|
||||||
@@ -32,4 +35,12 @@ Route::prefix('admin')->middleware(['admin'])->group(function () {
|
|||||||
// Projects
|
// Projects
|
||||||
Route::resource('/projects', ProjectController::class)->middleware(['auth']);
|
Route::resource('/projects', ProjectController::class)->middleware(['auth']);
|
||||||
|
|
||||||
|
Route::get('project/{project}/mmc', [MMCController::class, 'index'])->middleware(['auth'])->name('mmc.index');
|
||||||
|
Route::get('project/{project}/mmc/create', [MMCController::class, 'create'])->middleware(['auth'])->name('mmc.create');
|
||||||
|
Route::get('project/{project}/mmc/{mmc}', [MMCController::class, 'show'])->middleware(['auth'])->name('mmc.show');
|
||||||
|
|
||||||
|
Route::resource('/documents', DocumentController::class)->middleware(['auth']);
|
||||||
|
Route::resource('/auk', AUKController::class)->middleware(['auth']);
|
||||||
|
|
||||||
|
|
||||||
require __DIR__ . '/auth.php';
|
require __DIR__ . '/auth.php';
|
||||||
|
|||||||
Reference in New Issue
Block a user