Fixed blade references.

This commit is contained in:
Sebastian Davaris 2020-06-22 10:08:18 +02:00
parent e056567f57
commit 9c3796220f
9 changed files with 35 additions and 20 deletions

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\ExternalLink;
use Illuminate\Http\Request;
class ExternalLinkController extends Controller
@ -9,11 +10,14 @@ class ExternalLinkController extends Controller
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
* @param Request $request
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
public function index(Request $request)
{
//
$externalLink = ExternalLink::query()->paginate($request->input("limit", 20));
return view("external-link.index", [ "externalLink" => $externalLink ]);
}
/**

View File

@ -169,7 +169,7 @@ class UserController extends Controller
if(Auth::attempt($data)) {
//TODO: Implement home?
return view("admin.users.home", [ "user" => Auth::user() ]);
return view("admin.users.index", [ "user" => Auth::user() ]);
}
return redirect()->back(303);

View File

@ -18,7 +18,7 @@ class WashingMachineController extends Controller
{
$machines = WashingMachine::query()->paginate($request->query("page", 1));
return view("washing-machine.index", [ "machines" => $machines ]);
return view("admin.washing-machines.index", [ "machines" => $machines ]);
}
/**
@ -28,7 +28,7 @@ class WashingMachineController extends Controller
*/
public function create()
{
return view("washing-machine.create");
return view("admin.washing-machines.create");
}
/**
@ -46,7 +46,7 @@ class WashingMachineController extends Controller
$machine = new WashingMachine($data);
$machine->save();
return view("washing-machine.store");
return view("admin.washing-machines.store");
}
/**
@ -59,7 +59,7 @@ class WashingMachineController extends Controller
{
$machine = WashingMachine::find($id);
return view("washing-machine.show", [
return view("admin.washing-machines.show", [
"machine" => $machine
]);
}
@ -74,7 +74,7 @@ class WashingMachineController extends Controller
{
$machine = WashingMachine::find($id);
return view("washing-machine.edit", [
return view("admin.washing-machines.edit", [
"machine" => $machine
]);
}
@ -98,7 +98,7 @@ class WashingMachineController extends Controller
$machine->save();
return view("washing-machine.edit", [
return view("admin.washing-machines.edit", [
"machine" => $machine
]);
}
@ -114,6 +114,6 @@ class WashingMachineController extends Controller
$machine = WashingMachine::find($id);
$machine->delete();
return view("washing-machine.destroy");
return view("admin.washing-machines.destroy");
}
}

View File

@ -6,6 +6,8 @@ use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
@ -39,4 +41,8 @@ class User extends Authenticatable
protected $casts = [
'email_verified_at' => 'datetime',
];
public function setPasswordAttribute($password) {
$this->attributes["password"] = Hash::make($password);
}
}

View File

@ -4,9 +4,9 @@
@auth
<a href="" class="btn btn-dark text-white m-0 ml-auto">User: {{ Auth::user()->name }}</a>
<a href="{{ route('user.logout') }}" class="btn btn-dark text-white m-0 ml-1 mr-1">Log ud</a>
<a href="{{ route('users.logout') }}" class="btn btn-dark text-white m-0 ml-1 mr-1">Log ud</a>
@else
<a href="{{ route('user.login') }}" class="btn btn-dark text-white m-0 ml-auto mr-1">Log ind</a>
<a href="{{ route('users.login') }}" class="btn btn-dark text-white m-0 ml-auto mr-1">Log ind</a>
@endauth
</header>

View File

@ -12,6 +12,7 @@
@section("content")
<h1>Opret Bruger:</h1>
<form method="post" action="/users">
@csrf
<label for="name_first">Fornavn:</label>
<input type="text" name="name_first" id="name_first" required>
<label for="name_last">Efternavn:</label>

View File

@ -12,6 +12,7 @@
@section("content")
<h1>Rediger Bruger:</h1>
<form method="post" action="">
@csrf
<label for="name_first">Fornavn:</label>
<input type="text" name="name_first" id="name_first" value="{Fornavn}" required>
<label for="name_last">Efternavn:</label>

View File

@ -21,13 +21,15 @@
<th style="width: 1px;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
</tr>
<tr>
<td>{ID}</td>
<td>{Fornavn}</td>
<td>{Efternavn}</td>
<td>{Email}</td>
<td>{TLF}</td>
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a></td>
@foreach($users as $user)
<td>{{ $user->id }}</td>
<td>{{ $user->name_first }}</td>
<td>{{ $user->name_last }}</td>
<td>{{ $user->email }}</td>
<td>{{ $user->phone }}</td>
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a></td>
@endforeach
</tr>
</table>
@endsection

View File

@ -10,6 +10,7 @@
<img src="{{URL::asset('/images/logos/Logo-hvid.svg')}}" alt="Syddansk Erhvervsskole">
</div>
<form action="" method="post">
@csrf
<input class="appinput" type="email" name="email" placeholder="Email" required>
<input class="appinput" type="password" name="password" placeholder="Password" required>
<label class="toggle">