Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions project/app/Actions/Fortify/CreateNewUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\CreatesNewUsers;
use Laravel\Jetstream\Jetstream;
use App\Http\Requests\Request;

class CreateNewUser implements CreatesNewUsers
{
Expand All @@ -21,11 +22,11 @@ class CreateNewUser implements CreatesNewUsers
public function create(array $input)
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'name' => ['required', 'string', 'alpha_dash', 'max:32', 'unique:users'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => $this->passwordRules(),
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '',
])->validate();
], ['alpha_dash' => 'The user name must be a single word'])->validate();

return User::create([
'name' => $input['name'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
public function update($user, array $input)
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'name' => ['required', 'string', 'alpha_dash', 'max:32', 'unique:users'],
'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)],
'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'],
])->validateWithBag('updateProfileInformation');
Expand Down
107 changes: 0 additions & 107 deletions project/app/Http/Controllers/PostController.php__

This file was deleted.

6 changes: 3 additions & 3 deletions project/app/Http/Livewire/NewPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class NewPost extends Component

public $rules = [
'description' => 'required|min:3|max:255',
'user_id' => 'required',
'photo' => 'nullable|image|max:1024'
// 'user_id' => 'required',
'photo' => 'nullable|image|max:512|dimensions:min_width=500,min_height=500,max_width=1500,max_height=1500'
];

public function render()
Expand All @@ -45,7 +45,7 @@ public function save(Request $request)
if ($this->photo == null) {
$filename = null;
} else {
$filename = $this->photo->store('photos1');
$filename = $this->photo->store('public');
}

$this->validate();
Expand Down
6 changes: 3 additions & 3 deletions project/resources/views/admin/posts.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
<div class="flex">
@if ($post->image)
<a class="w-[50%]" href="{{ asset("../storage/app/$post->image") }}">
<img class="rounded-lg w-2/3" src="{{ asset("../storage/app/$post->image") }}"
<img class="rounded-lg w-2/3 max-h-screen" src="{{ asset("../storage/app/$post->image") }}"
alt="#">
</a>
@endif

<div class="w-[50%] pb-2">
<h5
class="font-extrabold text-gray-900 text-xl leading-tight font-medium mb-2 flex items-center justify-center">
User name: {{ $post->user->name }}</h5>
class="font-extrabold text-gray-900 text-xl leading-tight font-medium mb-2 flex items-center truncate">
User name: <br> {{ $post->user->name }}</h5>
<span class="flex items-center justify-center font-extrabold">Is it visible:</span>
<livewire:statuses :model="$post" field="status" key="{{ $post->id }}" />

Expand Down
4 changes: 2 additions & 2 deletions project/resources/views/admin/show-post.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

<div class="w-[50%] pb-2">
<h5
class="font-extrabold text-gray-900 text-xl leading-tight font-medium mb-2 flex items-center justify-center">
User name: {{ $post->user->name }}</h5>
class="font-extrabold text-gray-900 text-xl leading-tight font-medium mb-2 flex items-center truncate">
User name: <br> {{ $post->user->name }}</h5>
<span class="flex items-center justify-center font-extrabold">Is it visible:</span>
<livewire:statuses :model="$post" field="status" key="{{ $post->id }}" />
<span class="flex items-center justify-center">ID: {{ $post->id }}</span>
Expand Down
15 changes: 6 additions & 9 deletions project/resources/views/admin/show-user.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-xl sm:rounded-lg pb-4 pt-4 min-h-screen">
<div class="flex justify-center mt-2">
<div class="block p-6 rounded-lg shadow-lg bg-white min-w-[50%]">
<div class="block p-6 rounded-lg shadow-lg bg-white min-w-[50%] max-w-xl">
<h5
class="text-center text-gray-900 text-base font-extrabold leading-tight font-medium mb-2 border-b-2 pb-2">
Name: {{ $user->name }}
class="text-center text-gray-900 text-base font-extrabold leading-tight font-medium mb-2 border-b-2 pb-2 truncate ">
Name: <br> {{ $user->name }}
</h5>
<div class="flex-col justify-center mt-2 mb-4 border-b-2 pb-2">
<p class="text-gray-700 text-base text-center font-extrabold">
Expand All @@ -22,16 +22,13 @@ class="text-center text-gray-900 text-base font-extrabold leading-tight font-med
</p>
<livewire:statuses :model="$user" field="isbanned" key="{{ $user->id }}" />
</div>
<h5
class="text-center text-gray-900 text-base leading-tight font-medium mb-2 pb-2">
<h5 class="text-center text-gray-900 text-base leading-tight font-medium mb-2 pb-2">
ID: {{ $user->id }}
</h5>
<h5
class="text-center text-gray-900 text-base leading-tight font-medium mb-2 pb-2">
<h5 class="text-center text-gray-900 text-base leading-tight font-medium mb-2 pb-2">
mail: {{ $user->email }}
</h5>
<h5
class="text-center text-gray-900 text-base leading-tight font-medium mb-2 pb-2">
<h5 class="text-center text-gray-900 text-base leading-tight font-medium mb-2 pb-2">
Created: <br>{{ $user->created_at }}
</h5>
</div>
Expand Down
4 changes: 2 additions & 2 deletions project/resources/views/admin/users.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

@foreach ($users as $user)
<div class="flex justify-center mt-2">
<div class="block p-6 rounded-lg shadow-lg bg-white min-w-[50%]">
<h5 class="text-center text-gray-900 text-base font-extrabold leading-tight font-medium mb-2 border-b-2 pb-2">Name: {{ $user->name }}
<div class="block p-6 rounded-lg shadow-lg bg-white min-w-[50%] max-w-xl">
<h5 class="text-center text-gray-900 text-base font-extrabold leading-tight font-medium mb-2 border-b-2 pb-2 truncate ">Name: <br> {{ $user->name }}
</h5>
<div class="flex-col justify-center mt-2 mb-4 border-b-2 pb-2">
<p class="text-gray-700 text-base text-center font-extrabold">
Expand Down
4 changes: 2 additions & 2 deletions project/resources/views/front/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<div class="bg-[#14202E] overflow-hidden shadow-xl sm:rounded-lg">
<div class="flex justify-center mb-2 rounded-md">
<div class="block p-6 rounded-lg shadow-lg bg-[#1F2C3C] w-64 max-w-sm md:max-w-lg sm:min-w-[50%]">
<h5 class="text-gray-100 text-xl leading-tight font-medium mb-2">{{ $post->user->name }}</h5>
<h5 class="text-gray-100 text-xl leading-tight font-medium mb-2 truncate">{{ $post->user->name }}</h5>
<p class="text-gray-100 text-md mb-4 break-words bg-[#253243] p-3 rounded-md">
{{ $post->description }}
</p>
<img class="rounded-lg" src="{{ asset("../storage/app/$post->image") }}" alt="">
<img class="rounded-lg" src="{{ asset("../storage/app/$post->image") }}" alt="#">
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions project/resources/views/livewire/all-posts.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
@foreach ($posts as $post)
<div class="flex justify-center mb-2 rounded-md">
<div class="block p-6 rounded-lg shadow-lg bg-[#1F2C3C] w-64 max-w-sm md:max-w-lg sm:min-w-[50%]">
<h5 class="text-gray-100 text-xl leading-tight font-medium mb-2">{{ $post->user->name }}</h5>
<h5 class="text-gray-100 text-xl leading-tight font-medium mb-2 truncate">{{ $post->user->name }}</h5>
<a href="{{ route('show-post', $post) }}"><p class="text-gray-100 text-xs mb-4 break-words bg-[#253243] p-3 rounded-md">
{{ $post->description }}
</p></a>
@if ($post->image)
<a href="{{ asset("../storage/app/$post->image") }}">
<img class="rounded-lg" src="{{ asset("../storage/app/$post->image") }}" alt="#" width="100%">
<img class="rounded-lg" src="{{ asset("../storage/app/$post->image") }}" alt="#" width="100%" style="max-height:100vh">
</a>
@endif

Expand Down
3 changes: 1 addition & 2 deletions project/resources/views/livewire/new-post.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ class="block p-6 rounded-lg shadow-lg bg-[#1F2C3C] w-64 max-w-sm md:max-w-lg sm:

<textarea wire:model="description"
class="mt-2 mb-0 text-sm sm:text-base pl-2 pr-4 rounded-lg border w-full py-2 focus:outline-none focus:border-[#29a8df] bg-[#253243] text-gray-100 placeholder:italic placeholder:text-gray-300 border-0"
placeholder="What's happening?" rows="1">
placeholder="What's happening?" rows="1" required>
</textarea>
</label>
<input type="hidden" name="user_id" wire:model="user_id">
@error('description')
<div class="text-sm text-red-500 ml-1">
{{ $message }}
Expand Down
6 changes: 3 additions & 3 deletions project/resources/views/navigation-menu-user.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div class="hidden sm:flex sm:items-center sm:ml-6 ">

<!-- Settings Dropdown -->
<div class="ml-3 relative ">
<div class="ml-3 relative">
<x-jet-dropdown align="right" width="48" class="bg-[#29a8df]">
<x-slot name="trigger">
@if (Laravel\Jetstream\Jetstream::managesProfilePhotos())
Expand All @@ -41,8 +41,8 @@
</button>
@else
<span class="inline-flex rounded-md">
<button type="button" class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-full text-gray-100 bg-[#29a8df] hover:text-white focus:outline-none transition">
{{ Auth::user()->name }}
<button type="button" class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-full text-gray-100 bg-[#29a8df] hover:text-white focus:outline-none transition max-w-[100px]">
<span class="truncate"> {{ Auth::user()->name }} </span>

<svg class="ml-2 -mr-0.5 h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
@props(['value'])

<label {{ $attributes->merge(['class' => 'block font-medium text-white text-lg']) }}>
<label
@if (Request::is('user/profile') || Request::is('livewire/message/profile.update-profile-information-form'))
{{ $attributes->merge(['class' => 'block font-medium text-gray-500 text-lg']) }}
@endif
{{ $attributes->merge(['class' => 'block font-medium text-white text-lg']) }}
>
{{ $value ?? $slot }}
</label>