feat: kariyer formu, mobil offcanvas menu ve blog modulu iyilestirmeleri
This commit is contained in:
@@ -106,9 +106,19 @@ class BlogController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
// Kategorileri al (filtreleme için)
|
||||
$categories = class_exists(\App\Models\BlogCategory::class) ? \App\Models\BlogCategory::where('is_active', true)->orderBy('sort_order')->get() : collect();
|
||||
|
||||
if ($request->ajax()) {
|
||||
return view('blog.partials.posts', [
|
||||
'posts' => $posts
|
||||
]);
|
||||
}
|
||||
|
||||
return view('blog.index', [
|
||||
'settings' => $settings,
|
||||
'posts' => $posts,
|
||||
'categories' => $categories,
|
||||
'renderedHeader' => $renderedHeader,
|
||||
'renderedFooter' => $renderedFooter,
|
||||
'meta' => [
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\CareerApplication;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class CareerController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('front.career.index', [
|
||||
'meta' => [
|
||||
'title' => __('career.title', ['default' => 'Kariyer']),
|
||||
'description' => __('career.description', ['default' => 'Ekibimize katılmak için aşağıdaki formu doldurarak CV\'nizi iletebilirsiniz.']),
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'required|email|max:255',
|
||||
'phone' => 'nullable|string|max:20',
|
||||
'cv' => 'required|file|mimes:pdf,doc,docx|max:5120', // Max 5MB
|
||||
'message' => 'nullable|string',
|
||||
]);
|
||||
|
||||
$cvPath = null;
|
||||
if ($request->hasFile('cv')) {
|
||||
$cvPath = $request->file('cv')->store('cvs', 'public');
|
||||
}
|
||||
|
||||
CareerApplication::create([
|
||||
'name' => $request->name,
|
||||
'email' => $request->email,
|
||||
'phone' => $request->phone,
|
||||
'cv_path' => $cvPath,
|
||||
'message' => $request->message,
|
||||
'status' => 'pending',
|
||||
]);
|
||||
|
||||
return redirect()->back()->with('success', __('career.success_message'));
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,7 @@ class ProductController extends Controller
|
||||
$meta = [
|
||||
'title' => $product->translate('title'),
|
||||
'description' => \Str::limit(strip_tags($product->translate('content')), 160),
|
||||
'image' => $product->hero_image ? asset('storage/' . $product->hero_image) : null,
|
||||
];
|
||||
|
||||
// Use custom view template if specified
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Page;
|
||||
use App\Models\Blog;
|
||||
use App\Models\Product;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class SitemapController extends Controller
|
||||
{
|
||||
public function index(): Response
|
||||
{
|
||||
$urls = [];
|
||||
|
||||
// 1. Static & Main Pages
|
||||
$urls[] = [
|
||||
'loc' => url('/'),
|
||||
'lastmod' => now()->startOfDay()->toAtomString(),
|
||||
'changefreq' => 'daily',
|
||||
'priority' => '1.0',
|
||||
];
|
||||
|
||||
$urls[] = [
|
||||
'loc' => route('blog.index'),
|
||||
'lastmod' => now()->startOfDay()->toAtomString(),
|
||||
'changefreq' => 'weekly',
|
||||
'priority' => '0.8',
|
||||
];
|
||||
|
||||
$urls[] = [
|
||||
'loc' => route('career.index'),
|
||||
'lastmod' => now()->startOfMonth()->toAtomString(),
|
||||
'changefreq' => 'monthly',
|
||||
'priority' => '0.5',
|
||||
];
|
||||
|
||||
// 2. Dynamic Pages
|
||||
$pages = Page::where('status', 'published')
|
||||
->where('is_homepage', false)
|
||||
->get();
|
||||
foreach ($pages as $page) {
|
||||
$urls[] = [
|
||||
'loc' => url($page->slug),
|
||||
'lastmod' => $page->updated_at->toAtomString(),
|
||||
'changefreq' => 'weekly',
|
||||
'priority' => '0.7',
|
||||
];
|
||||
}
|
||||
|
||||
// 3. Blog Posts
|
||||
if (class_exists(Blog::class)) {
|
||||
$posts = Blog::published()->get();
|
||||
foreach ($posts as $post) {
|
||||
$urls[] = [
|
||||
'loc' => route('blog.show', $post->slug),
|
||||
'lastmod' => $post->updated_at->toAtomString(),
|
||||
'changefreq' => 'weekly',
|
||||
'priority' => '0.6',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Products
|
||||
if (class_exists(Product::class)) {
|
||||
$products = Product::where('is_active', true)->get();
|
||||
foreach ($products as $product) {
|
||||
$urls[] = [
|
||||
'loc' => route('products.show', $product->slug),
|
||||
'lastmod' => $product->updated_at->toAtomString(),
|
||||
'changefreq' => 'weekly',
|
||||
'priority' => '0.7',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return response()->view('sitemap', compact('urls'))
|
||||
->header('Content-Type', 'text/xml');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user