-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
337 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace App\Http\Requests; | ||
|
||
use Illuminate\Foundation\Http\FormRequest; | ||
|
||
class ContactSubmitRequest extends FormRequest | ||
{ | ||
/** | ||
* Determine if the user is authorized to make this request. | ||
*/ | ||
public function authorize(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> | ||
*/ | ||
public function rules(): array | ||
{ | ||
return [ | ||
'full_name' => ['required', 'string', 'max:255', 'min:3'], | ||
'phone' => ['required', 'string', 'max:15', 'min:8'], | ||
'subject' => ['nullable', 'string', 'max:255', 'min:4'], | ||
'email' => ['required', 'email', 'max:255', 'min:4'], | ||
'bodya' => ['required', 'string', 'max:4048', 'min:15'], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ main{ | |
} | ||
|
||
a,a:visited{ | ||
color: #cb00a5; | ||
color: white; | ||
&:hover{ | ||
color: #ff0067; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
129 changes: 129 additions & 0 deletions
129
resources/views/segments/contact/MeloContact/MeloContact.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
<section class='MeloContact'> | ||
<div class="{{gfx()['container']}}"> | ||
|
||
<h1 class="text-center fw-light mb-3"> | ||
{{getSetting($data->area->name.'_'.$data->part.'_title')}} | ||
</h1> | ||
<div class="row"> | ||
<div class="col-md-5"> | ||
<div class="pin-box p-3"> | ||
<i class="ri-mail-add-line icon"></i> | ||
@if(getGroupBySetting($data->area->name.'_'.$data->part)?->posts()->where('status',1)->where('is_pinned',1)->count() == 0) | ||
<h3 class="p-4 text-center"> | ||
{{__("You must add a pinned post to :GROUP",['GROUP' => getGroupBySetting($data->area->name.'_'.$data->part)?->name])}} | ||
</h3> | ||
@else | ||
<h3> | ||
{{getGroupBySetting($data->area->name.'_'.$data->part)?->posts()->where('status',1)->where('is_pinned',1)->first()->title}} | ||
</h3> | ||
{!! getGroupBySetting($data->area->name.'_'.$data->part)?->posts()->where('status',1)->where('is_pinned',1)->first()->body!!} | ||
|
||
<ul class="social text-center"> | ||
@foreach(getSettingsGroup('social_')??[] as $k => $social) | ||
<li class="d-inline-block mx-2"> | ||
<a href="{{$social}}"> | ||
<i class="ri-{{$k}}-line"></i> | ||
</a> | ||
</li> | ||
@endforeach | ||
</ul> | ||
@endif | ||
</div> | ||
</div> | ||
<div class="col-md-7"> | ||
|
||
@include('components.err') | ||
<form class="safe-form" method="post"> | ||
<input type="hidden" class="safe-url" data-url="{{route('client.send-contact')}}"> | ||
@csrf | ||
|
||
<div class="row"> | ||
<div class="col-md-6"> | ||
<div class="form-group"> | ||
<label for="full_name"> | ||
{{__('Name and lastname')}} | ||
</label> | ||
<input name="full_name" type="text" | ||
class="form-control @error('full_name') is-invalid @enderror" | ||
placeholder="{{__('Name and lastname')}}" | ||
value="{{old('full_name',auth('customer')->user()->name??null)}}"/> | ||
</div> | ||
</div> | ||
<div class="col-md-6"> | ||
<div class="form-group"> | ||
<label for="Phone"> | ||
{{__('Phone')}} | ||
</label> | ||
<input name="phone" type="tel" | ||
class="form-control @error('Phone') is-invalid @enderror" | ||
placeholder="{{__('Phone')}}" value="{{old('Phone',auth('customer')->user()->mobile??null)}}"/> | ||
</div> | ||
</div> | ||
<div class="col-md-6 mt-3"> | ||
<div class="form-group"> | ||
<label for="email"> | ||
{{__('Email')}} | ||
</label> | ||
<input name="email" type="email" | ||
class="form-control @error('email') is-invalid @enderror" | ||
placeholder="{{__('Email')}}" value="{{old('email',auth('customer')->user()->email??null)}}"/> | ||
</div> | ||
</div> | ||
<div class="col-md-6 mt-3"> | ||
<div class="form-group"> | ||
<label for="subject"> | ||
{{__('Subject')}} | ||
</label> | ||
<input name="subject" type="text" | ||
class="form-control @error('subject') is-invalid @enderror" | ||
placeholder="{{__('Subject')}}" | ||
value="{{old('subject')}}"/> | ||
</div> | ||
</div> | ||
<div class="col-md-12 mt-3"> | ||
<div class="form-group"> | ||
<label for="body"> | ||
{{__('Your message...')}} | ||
</label> | ||
<textarea name="bodya" style=" height: 150px;" | ||
class="form-control @error('bodya') is-invalid @enderror" | ||
placeholder="{{__('Question/Message')}}">{{old('body')}}</textarea> | ||
</div> | ||
</div> | ||
<div class="col-md-112"> | ||
<label> </label> | ||
<button class="btn btn-primary mt-2 w-100"> | ||
<i class="ri-send-plane-line"></i> | ||
{{__('Send')}} | ||
</button> | ||
</div> | ||
</div> | ||
|
||
</form> | ||
</div> | ||
</div> | ||
<div class="py-5"> | ||
|
||
@php($dir = langIsRTL(app()->getLocale() )?'rtl':'ltr' ) | ||
|
||
@foreach( getGroupBySetting($data->area->name.'_'.$data->part)?->posts()->where('status',1) | ||
->where('is_pinned',0)->orderByDesc('id')->get() as $i => $post) | ||
<div class="row mb-2" @if( ($i % 2) == 0) dir="rtl" @else dir="ltr" @endif> | ||
<div class="col-md-2"> | ||
<img src="{{$post->imgUrl()}}" alt="{{$post->title}}" class="img-fluid"> | ||
</div> | ||
<div class="col-md" dir="{{$dir}}"> | ||
<h3> | ||
<a href="{{$post->webUrl()}}"> | ||
{{$post->title}} | ||
</a> | ||
</h3> | ||
<p> | ||
{{$post->subtitle}} | ||
</p> | ||
</div> | ||
</div> | ||
@endforeach | ||
</div> | ||
</div> | ||
</section> |
Empty file.
10 changes: 10 additions & 0 deletions
10
resources/views/segments/contact/MeloContact/MeloContact.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "MeloContact", | ||
"version": "1.0", | ||
"author": "xStack", | ||
"email": "[email protected]", | ||
"license": "GPL-3.0-or-later", | ||
"url": "https:\/\/xstack.ir", | ||
"author_url": "https:\/\/4xmen.ir", | ||
"packages": [] | ||
} |
42 changes: 42 additions & 0 deletions
42
resources/views/segments/contact/MeloContact/MeloContact.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Resources\Views\Segments; | ||
|
||
use App\Models\Group; | ||
use App\Models\Part; | ||
use App\Models\Setting; | ||
|
||
class MeloContact | ||
{ | ||
public static function onAdd(Part $part = null) | ||
{ | ||
$setting = new Setting(); | ||
$setting->section = 'theme'; | ||
$setting->key = $part->area->name . '_' . $part->part; | ||
$setting->value = Group::first()->id; | ||
$setting->type = 'GROUP'; | ||
$setting->size = 6; | ||
$setting->title = $part->area->name . ' ' . $part->part; | ||
$setting->save(); | ||
|
||
$setting = new Setting(); | ||
$setting->section = 'theme'; | ||
$setting->key = $part->area->name . '_' . $part->part.'_title'; | ||
$setting->value = __("Contact us"); | ||
$setting->type = 'TEXT'; | ||
$setting->size = 6; | ||
$setting->title = $part->area->name . ' ' . $part->part . ' title'; | ||
$setting->save(); | ||
} | ||
public static function onRemove(Part $part = null) | ||
{ | ||
Setting::where('key',$part->area->name . '_' . $part->part)->first()?->delete(); | ||
Setting::where('key',$part->area->name . '_' . $part->part.'_title')->first()?->delete(); | ||
|
||
|
||
} | ||
public static function onMount(Part $part = null) | ||
{ | ||
return $part; | ||
} | ||
} |
Oops, something went wrong.