diff --git a/laravel/app/Models/Shortlink.php b/laravel/app/Models/Shortlink.php index 884f77e..69532fd 100644 --- a/laravel/app/Models/Shortlink.php +++ b/laravel/app/Models/Shortlink.php @@ -40,9 +40,9 @@ class Shortlink extends Model $this->save(); } - function generateNewId(int $length = 6): string { + function generateNewId(int $length = 5): string { $characters = 'qwrtypsdfghjklzxcvbnmQWRTYPSDFGHJKLZXCVBNM256789_'; - // try n x 2 times to generate a new id, if it finds an id, return it, otherwise, try to look for an id of length + 1 + // try n x 2 times to generate a new id, if it finds an id, return it, otherwise, try to look for an id of length n + 1 for ($i = 0; $i < $length * 2; $i++) { $id = ''; for ($i = 0; $i < $length; $i++) { diff --git a/laravel/public/css/default.css b/laravel/public/css/default.css index d1b7f89..88de47f 100644 --- a/laravel/public/css/default.css +++ b/laravel/public/css/default.css @@ -395,6 +395,7 @@ button { table { font-size: 1.5em; border-collapse: collapse; + margin-bottom: 40px; } table td, table th { @@ -420,10 +421,6 @@ table th:last-child, table td:last-child { border-right: none; } -table { - margin-bottom: 40px; -} - footer { margin-top: auto; height: 50px; diff --git a/laravel/resources/views/profile.blade.php b/laravel/resources/views/profile.blade.php index 89f5555..dcb1270 100644 --- a/laravel/resources/views/profile.blade.php +++ b/laravel/resources/views/profile.blade.php @@ -5,22 +5,28 @@ @endsection @section('content') -

Profile

-

Username: {{ Auth::user()->name }}

-

Email: {{ Auth::user()->email }}

-

Created at: {{ Auth::user()->created_at }}

- - - - - - - @foreach ($shortlinks as $shortlink) +
+

Profile

+
+
+

Username: {{ Auth::user()->name }}

+

Email: {{ Auth::user()->email }}

+

Created at: {{ Auth::user()->created_at }}

+
+
+
LinkDestinationCreated at
- - - + + + - @endforeach -
shortid) }}">{{ $shortlink['shortid'] }}{{ $shortlink['destination'] }}{{ Carbon\Carbon::parse($shortlink->created_at)->format('M jS Y') }}LinkDestinationCreated at
+ @foreach ($shortlinks as $shortlink) + + shortid) }}">{{ $shortlink['shortid'] }} + {{ $shortlink['destination'] }} + {{ Carbon\Carbon::parse($shortlink->created_at)->format('M jS Y') }} + + @endforeach + + @endsection \ No newline at end of file