Skip to content

Commit

Permalink
view update
Browse files Browse the repository at this point in the history
  • Loading branch information
nasirkhan committed Jul 30, 2023
1 parent 2ce1a66 commit 51cf8df
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 61 deletions.
12 changes: 11 additions & 1 deletion src/stubs/Http/Controllers/Frontend/stubFrontendController.stub
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ use Illuminate\Support\Str;

class {{moduleNamePlural}}Controller extends Controller
{
public $module_title;

public $module_name;

public $module_path;

public $module_icon;

public $module_model;

public function __construct()
{
// Page Title
Expand All @@ -17,7 +27,7 @@ class {{moduleNamePlural}}Controller extends Controller
$this->module_name = '{{moduleNameLowerPlural}}';

// directory path of the module
$this->module_path = '{{moduleNameLower}}::backend';
$this->module_path = '{{moduleNameLower}}::frontend';

// module icon
$this->module_icon = 'fa-regular fa-sun';
Expand Down
29 changes: 6 additions & 23 deletions src/stubs/Resources/views/frontend/stubViews/index.blade.stub
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,12 @@
@php
$details_url = route("frontend.$module_name.show",[encode_id($$module_name_singular->id), $$module_name_singular->slug]);
@endphp

<div class="">
<div class=" bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700">
<div class="p-5 flex flex-col items-stretch">
<a href="{{$details_url}}">
<h2 class="mb-2 text-2xl tracking-tight text-gray-900 dark:text-white">
{{$$module_name_singular->name}}
</h2>
</a>
<p class="flex-1 h-full mb-3 font-normal text-gray-700 dark:text-gray-400">
{{$$module_name_singular->description}}
</p>
<div class="text-end">
<a href="{{$details_url}}" class="inline-flex items-center text-sm outline outline-1 outline-gray-800 text-gray-700 hover:text-gray-100 bg-gray-200 hover:bg-gray-700 py-2 px-3 focus:outline-none rounded">
Read more
<svg class="ml-2 -mr-1 w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path>
</svg>
</a>
</div>
</div>
</div>
</div>

<x-frontend.card :url="$details_url" :name="$$module_name_singular->name">
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400">
{{$$module_name_singular->description}}
</p>
</x-frontend.card>

@endforeach
</div>
Expand Down
41 changes: 4 additions & 37 deletions src/stubs/Resources/views/frontend/stubViews/show.blade.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@section('content')

<section class="bg-gray-100 text-gray-600 py-20">
<section class="bg-gray-100 text-gray-600 py-10 sm:py-20">
<div class="container mx-auto flex px-5 items-center justify-center flex-col">
<div class="text-center lg:w-2/3 w-full">
<p class="mb-8 leading-relaxed">
Expand All @@ -24,44 +24,11 @@
</div>
</section>

<section class="bg-white text-gray-600 py-20 px-20">
<section class="bg-white text-gray-600 p-6 sm:p-20">
<div class="grid grid-cols-1 sm:grid-cols-2 gap-6">
@foreach ($posts as $post)
@php
$details_url = route("frontend.posts.show",[encode_id($post->id), $post->slug]);
@endphp

<div class="">
<div class=" bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700">
<a href="{{$details_url}}">
<img class="rounded-t-lg" src="{{$post->featured_image}}" alt="{{$post->name}}" />
</a>
<div class="p-5 flex flex-col items-stretch">
<a href="{{$details_url}}">
<h2 class="mb-2 text-2xl tracking-tight text-gray-900 dark:text-white">
{{$post->name}}
</h2>
</a>
<p class="flex-1 h-full mb-3 font-normal text-gray-700 dark:text-gray-400">
{{$post->intro}}
</p>

<div class="text-end">
<a href="{{$details_url}}" class="inline-flex items-center text-sm outline outline-1 outline-gray-800 text-gray-700 hover:text-gray-100 bg-gray-200 hover:bg-gray-700 py-2 px-3 focus:outline-none rounded">
Read more
<svg class="ml-2 -mr-1 w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path>
</svg>
</a>
</div>
</div>
</div>
<div>
Content area.
</div>

@endforeach
</div>
<div class="d-flex justify-content-center w-100 mt-4">
{{$posts->links()}}
</div>
</section>

Expand Down

0 comments on commit 51cf8df

Please sign in to comment.