maaz

maaz

Member Since 8 Months Ago

Experience Points
3,050
Total
Experience

1,950 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
1
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
3,050 XP
Oct
28
2 days ago
Activity icon

Started a new Conversation How To Use Fiscal Printer To Print Invoice In Laravel.

Hey everyone. One of my clients is from Italy and he has a project called 'Point of sale'. Now he wants to print invoices on Fiscal Printer. Now how to achieve this. i got This Link but dont know how to use. did anyone implement this ? or something else

Sep
25
1 month ago
Activity icon

Replied to Cannot Login After Logout In Laravel 7

there are no typo erros dear :)

Activity icon

Started a new Conversation Cannot Login After Logout In Laravel 7

Hey, everyone, I register a new user after registration it homepage but when I log out the user and login to the same user with the correct credentials it says "These credentials do not match our records". So what is the problem? I use Laravel UI default authentication.

Sep
16
1 month ago
Activity icon

Replied to How To Generate Item Code For Different Products

thanks a lot let me try :)

Activity icon

Started a new Conversation How To Generate Item Code For Different Products

Hey there, I have a migration table like this

   public function up()
    {
        Schema::create('purchase_details', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('purchase_id');
            $table->string('item_code');
            $table->string('item_name');
            $table->float('unit_price');
            $table->float('qty');
            $table->flat('discount_on_all')->default(0);
            $table->float('net_amount');
            $table->timestamps();
        });
    }

i want to generate item_code for a product while insertion, the rest of the fields are dynamic. do I don't want random number generators, should be like this "item001", or any other prefer way

Sep
09
1 month ago
Activity icon

Replied to JQuery Add Data Multiple Times On Prepend.

thank you @sinnbeck ,it is working now, I get the value in the text box on change and do the rest of stuff inside click event.

Activity icon

Started a new Conversation JQuery Add Data Multiple Times On Prepend.

Hey everyone. I have some products on my database and I fetch it in a dropdown. when someone clicks on the product there are some text boxes where I fetch these things '' product-id, product-price, qty, total price, discount ''. When I click on the add button it prepends the product details in a table. after that when I select a new product and click on the add button it prepends the old product and the new one too, so how I can do this when I click on add button it should add the new product to the list, not the old one.

here is my code. blade

   <form action="">
                <div class="row justify-content-center">
                    <div class="col-md-5">
                        <div class="form-group">
                            <div class="form-group">
                                <label for="supplier">Select Supplier</label>
                                <select class="form-control select2bs4" id="supplier" style="width: 100%;">
                                    @foreach ($suppliers as $supplier)
                                    <option value="{{ $supplier->id}}"> {{$supplier->name}}</option>
                                    @endforeach
                                </select>
                            </div>
                        </div>
                    </div>
                    <!-- Date -->
                    <div class="col-md-5">
                        <div class="form-group">
                            <label for="date">Date:</label>
                            <input type="date" class="form-control" id="date" name="date">
                        </div>
                    </div>

                    <div class="col-md-5">
                        <div class="form-group">
                            <label for="ref">Reference No:</label>
                            <input type="text" class="form-control" id="ref" name="reference_no">
                        </div>
                    </div>
                    <div class="col-md-5">
                        <div class="form-group">
                            <label for="balance">Remaining Balance:</label>
                            <input type="text" class="form-control" id="balance" value="{{$supplier->opening_balance}}"
                                name="remaining" disabled>
                        </div>
                    </div>
                </div>


                <div class="div mt-5 ml-4 pt-5" style="border-top:1px solid rgba(128, 128, 128, 0.267);">
                    <div class="row ">
                        <div class="col-md-4">
                            <div class="form-group">
                                <div class="form-group">
                                    <label for="add-product">Select Product</label>
                                    <select class="form-control select2bs4" style="width: 100%;" id="add-product">
                                        @foreach ($products as $product)
                                        <option value="{{ $product->id}}" data-id="{{$product->id}}"
                                            data-pro-name="{{$product->name}}"
                                            data-sale-price="{{$product->retail_price}}"
                                            data-pro-qty="{{$product->current_qty}}">
                                            {{$product->name}}
                                        </option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                        </div>


                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="qty">Quantity</label>
                                <input type="number" name="qty" class="form-control" id="qty">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="store-qty">Store Quantity</label>
                                <input type="text" name="store_qty" class="form-control" id="store-qty" disabled>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="purchase_price">Purchase Price</label>
                                <input type="text" name="purchase_price" class="form-control" id="purchase_price">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="discount">Discount %</label>
                                <input type="text" name="discount" class="form-control" id="discount">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="total_price">Total Price</label>
                                <input type="text" name="total_price" class="form-control" id="total_price" disabled>
                            </div>
                        </div>
                        <div class="row justify-content-end">
                            <div class="col-md-12">
                                <button class="btn btn-info" id="add">Add</button>
                            </div>
                        </div>
                    </div>
                </div>


                <table class="table table-bordered m-3">
                    <thead class="bg-dark">
                        <tr>
                            <td>Product</td>
                            <td>Qty</td>
                            <td>Store Qty</td>
                            <td>Purchase Price</td>
                            <td>Discount %</td>
                            <td>Total Price</td>
                            <td>Remove</td>
                        </tr>
                    </thead>

                    <tbody id="tbody">
                    </tbody>
                </table>
            </form>

js code.

  $(document).ready(function(){
    var trId = 1;
    $('body').on('change','#add-product',function(){
        var pro_id = $('#add-product').find(':selected').attr('data-id');
        var pro_name = $('#add-product').find(':selected').attr('data-pro-name');
        var pro_price = $('#add-product').find(':selected').attr('data-sale-price');
        var pro_qty = $('#add-product').find(':selected').attr('data-pro-qty');
        // alert(pro_qty);
        $('#qty').val(1);
        $('#store-qty').val(pro_qty);
        $('#purchase_price').val(pro_price);
        $('#total_price').val(pro_price);

 var row = '<tr id = ' + trId + '>\
                <td>\
                    ' + pro_name + '\
                    <input type="hidden" class="form-control form-control-sm" name="product_name[]" value=' + pro_id + ' readonly>\
                </td>\
                <td width="15%">\
                    <input type="number" class="form-control form-control-sm qty" name="qty[]" placeholder="Quantity" id="" value="1" min="1" >\
                </td>\
                <td width="15%">\
                    <input type="text" class="form-control form-control-sm store_qty" name="store_qty[]" value=' + pro_qty + ' readonly>\
                </td>\
                <td width="15%">\
                    <input type="text" class="form-control form-control-sm purchase_price" name="purchase_price[]" value=' + pro_price + '>\
                </td>\
                <td width="15%" class="number">\
                    <input type="text" class="form-control form-control-sm discount" name="discount[]" placeholder="Discount %">\
                </td>\
                <td class="number">\
                    <input type="text" class="form-control form-control-sm unit_cost"\
                        readonly name="unit_cost[]" value=' + pro_price + '>\
                </td>\
                <td class="actions">\
                    <a class="icon remove" href="">\
                        <i class="fa fa-trash"></i>\
                    </a>\
                </td>\
            </tr>';

            $('#add').click(function(event){
            event.preventDefault();
            $("#tbody").prepend(row);
            $("#qty").val("");
            $("#store-qty").val("");
            $("#purchase_price").val("");
            $("#discount").val("");
            $("#total_price").val("");

            });
trId++;


    });

Activity icon

Replied to Laravel 8 "Target Class [Auth\LoginController] Does Not Exist."

I think in laravel 8 they use jetstream not ui i guess take a look here.

https://laravel.com/docs/8.x/authentication#introduction

Sep
07
1 month ago
Activity icon

Replied to Want To Upload Maximum 20mb Zip File.

no its 20mb . 1mb = 1024kb so do 20mb will be round about 20000 Mb

Activity icon

Replied to Want To Upload Maximum 20mb Zip File.

try this

'product-zip' => 'required|mimes:zip|max:20000', 
Activity icon

Started a new Conversation Dynamic Dependent Dropdown Error

Hey everyone, i have a list of countries and states, when someone click on a country it will show the related states of that country. here is my code

route

Route::get('/getStates/{id}', '[email protected]')->name('getStates');

StateController.php

 public function getStates($id)
    {
        $states = State::where('country_id', $id)->pluck('name', 'id');
        return response()->json($states);
    }

blade.php

 <div class="form-group">
                            <label for="country">Country</label>
                            <select name="country" class="form-control" id="country">
                                <option value="" selected disabled>Select Country</option>
                                @foreach ($countries as $country)
                                <option value="{{$country->id}}">{{$country->name}}</option>
                                @endforeach


                            </select>
                        </div>

                        <div class="form-group">
                            <label for="state">State</label>
                            <select id="state" name="state" class="form-control">
                                <option value="" selected="false">State</option>
                            </select>
                        </div>

ajax

<script>
    // Dynamic dependent dropdowns for province
        $(document).ready(function (){
        $('select[name="country"]').on('change',function(){
        var countryID = $(this).val();
        if (countryID) {
        $.ajax({
        url:'/getStates/'+countryID,
        type: 'GET',
        dataType:'json',
        success:function(data){
        $('select[name="state"]').empty();
        $.each(data,function(key,value){
        $('select[name="state"]').append('<option value="'+ key +'">'+value+'</option>');
        });
        }
        });
        }
        else{
        $('select[name="state"]').empty();
        }
        });
        });
</script>

error in console

Failed to load resource: the server responded with a status of 404 (Not Found)
Activity icon

Awarded Best Reply on Paginate Through A Relationship

$products = $category->products()->paginate(8);

Activity icon

Replied to Paginate Through A Relationship

$products = $category->products()->paginate(8);

Sep
04
1 month ago
Activity icon

Replied to Laravel Livewire Data Not Updating

it is in a single div @snapey .

Activity icon

Replied to Laravel Livewire Data Not Updating

@snapey can you explain more how i can do this. If I need to make another component for e.g show-data etc

Activity icon

Replied to Laravel Livewire Data Not Updating

I just started livewire so i dont know much about it. :)

Activity icon

Started a new Conversation Laravel Livewire Data Not Updating

When i add data on the same page I have a table where I am showing records from DB, I want to update the table when new data is added, when I insert country it saves in DB but not showing in tables dynamically.


        <form role="form" wire:submit.prevent="submit">
            <div class="card-body">
                <div class="form-group">
                    <label for="name">Country Name</label>
                    <input type="text" class="form-control" wire:model="name" id="name" placeholder="country name">
                    @error('name')
                    <div class="alert alert-danger">{{$message}}</div>
                    @enderror
                </div>
            </div>
    </div>
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    </form>
</div> 

</div>

//table to show country list
<table id="example1" class="table table-bordered table-striped">
    <thead>
        <tr>
            <th>Id</th>
            <th>Category Name</th>
            <th>Edit</th>
            <th>Delete</th>
        </tr>
    </thead>
    <tbody>
        @foreach ($countries as $country)
        <tr>
            <td>{{$country->id}}</td>
            <td>{{$country->name}}</td>
        </tr>
        @endforeach
    </tbody>
</table>

class AddCountry extends Component
{

    public $name;

    public function submit()
    {
        $validatedData = $this->validate([
            'name' => 'required',
        ]);

        Country::create([
            'name' => $this->name,
        ]);
        $this->reset();
    }

    public function render()
    {
        $countries = Country::all();
        return view('livewire.add-country', compact('countries'));
    }
}
Sep
02
1 month ago
Activity icon

Started a new Conversation Laravel SweetAlert 2 Toast Message Not Hiding :

I am using this https://github.com/realrashid/sweet-alert for sweet alerts it works but not hiding after sometime what should i do.

Activity icon

Replied to Missing Required Parameters.

still it was not working i find that error too.. btw thanks.

Activity icon

Started a new Conversation Missing Required Parameters.

I want to edit a form when click on edit button, i don't know what is the problem with my code I think it looks oky but it is not working and also i am not getting any data from database, controller:

public function edit(ProductCategory $productCategory)
    {

        // dd($productCategory);
        return view('categories.edit', compact('productCategory'));
    }

view:

 <tbody>
                    @foreach ($categories as $cat)
                    <tr>
                        <td>{{$cat->id}}</td>
                        <td class="category-name">{{$cat->name}}</td>
                        <td>
//edit button
                            <a href="{{route('category.edit',$cat->id)}}">
                                <i class="fa fa-edit"></i> 
                            </a>
                        </td>
                        <td>
                            <a href="{{route('category.destroy',$cat->id)}}"
                                onclick="return confirm('Are you sure you want to delete')" class="fa fa-trash-alt"></a>
                        </td>
                    </tr>
                    @endforeach

edit form

<form role="form" action="{{route('category.updated',$productCategory->id)}}" method="post">
            @method('PATCH')
            @csrf
            <div class="card-body">
                <div class="form-group">
                    <label for="category">Category Title</label>
                    <input type="text" class="form-control" value="{{$productCategory->name}}" name="category"
                        id="category" placeholder="Category Title">
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary">Update</button>
                    <a href="" class="btn btn-warning ml-2">Back</a>
                </div>
            </div>
        </form>

routes:

 GET|HEAD  | dashboard/category                 | category.index   | App\Http\Controllers\[email protected]   | web        |
|        | POST      | dashboard/category                 | category.store   | App\Http\Controllers\[email protected]   | web        |
|        | GET|HEAD  | dashboard/category/create          | category.create  | App\Http\Controllers\[email protected]  | web        |
|        | GET|HEAD  | dashboard/category/{category}      | category.show    | App\Http\Controllers\[email protected]    | web        |
|        | PUT|PATCH | dashboard/category/{category}      | category.update  | App\Http\Controllers\[email protected]  | web        |
|        | DELETE    | dashboard/category/{category}      | category.destroy | App\Http\Controllers\[email protected] | web        |
|        | GET|HEAD  | dashboard/category/{category}/edit | category.edit    | App\Http\Controllers\[email protected]    | web  

Error i got

Missing required parameters for [Route: category.update] [URI: dashboard/category/{category}]. (View: C:\xampp\htdocs\PointOfSale\resources\views\categories\edit.blade.php)
Jul
29
3 months ago
Activity icon

Replied to Fatal Error - Allowed Memory Size.

try this , COMPOSER_MEMORY_LIMIT=-1 composer require laravel-notification-channels/twilio

Jul
26
3 months ago
Activity icon

Replied to Laravel Livewire Error 404.

I solved it... Thanks, everyone for your kind replies.😥

Activity icon

Started a new Conversation Laravel Livewire Error 404.

I approve or disapprove post on the admin side with laravel livewire without refreshing the page. but when I approve one post it approve or disapprove successfully but when I approve another post without reloading the page it gives me an error error 404 here is my code. approve.php

class ApprovePagination extends Component
{
    use WithPagination;

    public $approve;
    public $dis_approve;

    public function approve($id)
    {

        $approve = Business::find($id);
        // dd($approve);
        $this->approve = $approve;
        if ($approve) {
            $approve->is_approved = 1;
            $approve->save();
            return redirect()->back()->with('success', 'Business approved successfully');
        }
    }

    public function disApprove($id)
    {
        $dis_approve = Business::where('id', '=', e($id))->first();
        $this->dis_approve = $dis_approve;
        if ($dis_approve) {
            $dis_approve->is_approved = 0;
            $dis_approve->delete($dis_approve);
            return redirect()->back()->with('danger', 'Business rejected successfully');
        }
    }

    public function render()
    {

        $businesses = Business::where('is_approved', '0')->latest()->paginate(10);
        return view('livewire.admin.approve-pagination', compact('businesses'));
    }
}

approve blade component.

 @forelse ($businesses as $business)
                <tr>
                    <td>{{$business->name}}</td>
                    <td>

                        <form class="mb-3 d-inline" wire:submit.prevent>
                            <button class="btn  btn-success" wire:click="approve({{$business->id}})">
                                Approve
                            </button>
                            <button class="btn  btn-warning" type="submit" wire:click="disApprove({{$business->id}})">
                                Dis Approve
                            </button>
                        </form>
...
@endforelse
Activity icon

Started a new Conversation Laravel Livewire:: Unable To Call Component Method. Public Method [approve49] Not Found On Component: [admin.approve-pagination]

I am using laravel livewire for the first time. What i really wanna do is approve post on the admin side.I I click on the approve button it should approve and save into the database. approve component.blade

  @forelse ($businesses as $business)
                <tr>
                    <td>{{$business->name}}</td>
                    <td>

                        <form class="mb-3 d-inline" wire:submit.prevent="submit">
                            <button class="btn  btn-success" wire:click="approve{{$business->id}}">
                                Approve
                            </button>
                        </form>

all the posts are showing in table which is not approve so that's why i use forelse loop.

Approve.php

class ApprovePagination extends Component
{
    use WithPagination;

    public $approve;
    public $dis_approve;

    public function approve($id)
    {

        $approve = Business::find($id);
        dd($approve);
        $this->approve = $approve;
        if ($approve) {
            $approve->is_approved = 1;
            $approve->save();
            return redirect()->back()->with('success', 'Business approved successfully');
        }
    }

    public function dis_approve($id)
    {
    }

    public function render()
    {

        $businesses = Business::where('is_approved', '0')->latest()->paginate(10);
        return view('livewire.admin.approve-pagination', compact('businesses'));
    }
}

how to solve the error :)

Jul
25
3 months ago
Activity icon

Replied to Target Class [RealRashid\SweetAlert\ToSweetAlert] Does Not Exist.

@michaloravec thanks, but I solved it by removing target class from kernel.php :)

Activity icon

Replied to Target Class [RealRashid\SweetAlert\ToSweetAlert] Does Not Exist.

Solved. I removed the target class from my kernel.php. it works now

Activity icon

Started a new Conversation Target Class [RealRashid\SweetAlert\ToSweetAlert] Does Not Exist.

I remove this RealRashid\SweetAlert package from my composer now I got this error

Illuminate\Contracts\Container\BindingResolutionException
Target class [RealRashid\SweetAlert\ToSweetAlert] does not exist.

my, I can't open any page in my project :(

Activity icon

Replied to How To Show Three Images Instead Of More Than Three.

Thank @michaloravec I just use $loop which didn't work :D. now it's working

Activity icon

Started a new Conversation How To Show Three Images Instead Of More Than Three.

Hello everyone. I am letting users upload multiple images but I want to show only three images in my view. my view

       <div class="business-gallery">
                        <div class="gallery">
                            {{-- {{dd($business->image)}} --}}
                            {{-- @json($business->image) --}}
                            @foreach(explode(',', $business->image) as $path)
                            <a href="{{ asset('storage/'.$path) }}" data-caption="Image caption">
                                <img src="{{ asset('storage/'.$path) }}" alt="{{ asset('storage/'.$path) }}" />
                            </a>
                            @endforeach
                        </div>
                    </div>

Note: Ignore Comments in my code :) thankyou

Jul
23
3 months ago
Activity icon

Replied to Facing Problem With Sending Mails In Laravel.

@antoine_l thank you so much, dear. it works now thanks a lot 😊

Activity icon

Replied to Facing Problem With Sending Mails In Laravel.

Argument 1 passed to App\Mail\ContactMail::__construct() must be an instance of App\User, string given, called in C:\xampp\htdocs\BusinessForSale\app\Http\Controllers\FrontEndControllers\SellerController.php on line 26
Activity icon

Started a new Conversation Facing Problem With Sending Mails In Laravel.

How to handle requests in laravel. I have a form where buyer can send email to a seller. It works but I want to send the message with mail coming from the request. I did something like this. sellercontroller.php from where I am sending an email to the seller and handling some requests. please read the comments in my code too.

class SellerController extends Controller
{
    public function index(User $user)
    {
        return view('front-end.contact', compact('user'));
    }

    public function send(Request $request, User $user)
    {
        $address = $request->email;
        // dd($address);

//my code to send email to the seller I temporary comment it.
        // Mail::to($address)->send(new ContactMail($user));

//note I found this code on StackOverflow but its not working giving an error
        Mail::to($address)
            ->send(new
                ContactMail($request->input('name'), $request->input('user_name')));
        return redirect()->back();
    }
}

contact.blade.php

 <form action="{{route('seller.contact',$user->id)}}" method="post">
                        @csrf
                        <div class="form-group">
                            <label for="name">Name</label>
                            <input type="text" name="name" class="form-control" value="{{$user->name}}">
                        </div>
                        <div class="form-group">
                            <label for="name">Seller Email</label>
                            <input type="text" class="form-control" name="email" value="{{$user->email}}">
                        </div>
                        <div class="form-group">
                            <label for="name">Your Name</label>
                            <input type="text" class="form-control" name="user_name" value="{{Auth()->user()->name}}">
                        </div>
                        <div class="form-group">
                            <label for="message">Message</label>
                            <textarea name="message" cols="30" class="form-control" rows="10"
                                placeholder="message"></textarea>
                        </div>
                        <input type="submit" value="Send" class="form-control button-primary">
                    </form>

contactMail.php

class ContactMail extends Mailable
{
    use Queueable, SerializesModels;
    public $user;
    public $message;
    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct(User $user, $message)
    {
        $this->user = $user;
        $this->message = $message;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->markdown('emails.contactSeller')->with([
            'message' => $this->message,
        ]);;
    }
}

markdown

@component('mail::message')


{{Auth()->user()->name}} wants to connect with you.

<p>
    {{$message}}
</p>
Please contact him with his Phone number which is {{Auth()->user()->phone}}

Thanks,<br>
{{ config('app.name') }}
@endcomponent

how I can handle requests in mail :) the above code give me an error.

Jul
17
3 months ago
Activity icon

Replied to How To Solve This Composer Error.

Thank you. I find that answer too, now working fine thank you :)

Activity icon

Replied to How To Solve This Composer Error.

@mkojoa no I am using window 10;

Activity icon

Replied to How To Solve This Composer Error.

plz, help :)

Activity icon

Replied to How To Solve This Composer Error.

i did it two times. but let me try again

Activity icon

Started a new Conversation How To Solve This Composer Error.

I am installing spatie/newletter package. After running this command

composer require spatie/laravel-newsletter

it is installed but with this error

Content-Length mismatch received 409337 bytes out of the expected 595319
https://repo.packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date

after installing this package, my composer.json got this

"spatie/laravel-newsletter": "^4.8"

now when I published config files with this

php artisan vendor:publish --provider="Spatie\Newsletter\NewsletterServiceProvider"

I got this error

$ php artisan vendor:publish --provider="Spatie\Newsletter\NewsletterServicePro
vider"
Unable to locate publishable resources.
Publishing complete.

nothing published with the name ''newsletter.php'' as mention on package documentation. how to solve this

Jul
16
3 months ago
Activity icon

Replied to How To Query Search With Related Model.

Okay, thanks again. You always help me here :) I will go through the documentation :)

Activity icon

Replied to How To Query Search With Related Model.

Thanks a lot, it works fine now :) Can you highlight what is happening in the query @michaloravec ? let me understand this I am getting this a little bit but not so much 🙂

Activity icon

Replied to How To Query Search With Related Model.

@michaloravec it's okay. Now the thing is when I didn't select the province and just enter the business name it doesn't give the output, but when I select both it shows me the required output.

Activity icon

Replied to How To Query Search With Related Model.

@michaloravec now when i enter the business name it doesn't show the desired output.

Activity icon

Replied to How To Query Search With Related Model.

Thank you so much it works @michaloravec 😍

Activity icon

Started a new Conversation How To Query Search With Related Model.

Hello everyone. I have a search box where the user will enter the business name and a dropdown where the user will select the state/province as shown in the dropdown. The business model has a relationship with the Province model. How I can do a search based on province only. if user leaves a search bar empty and only select province I want to show all the businesses based on states/provinces. here is my: Index view:

 <form method="get" action="{{route('search.business')}}">
                        <div class="inner-form">
                            <div class="input-field first-wrap">
                                <input type="text" placeholder="What are you looking for?" name="search" />
                            </div>
                            <div class="input-field second-wrap">
                                <select name="search" id="" class="form-control" style="height:inherit;">
                                    @foreach ($provinces as $province)
                                    <option value="{{$province->id}}">{{$province->name}}</option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="input-field third-wrap">
                                <button class="btn-search" type="submit">Search</button>
                            </div>
                        </div>
                    </form>

my search controller

   public function search(Request $request)
    {
        $businesses = Business::with('provinces')
            ->where('name', 'LIKE', '%' . $request->input('search') . '%')
            ->paginate(10);
        // dd($businesses);
        return view('front-end.search-details', compact('businesses'));
    }

plz, tell me a query for the province to this is my first time to use search functionality that's why I am stuck here.

Jul
13
3 months ago
Activity icon

Replied to How To Show Only Four Records In View If I Have List Of Records Coming From Database.

@deepu07 no I don't want to use pagination. cox I am only showing four categories. not all. and I don't want to query the model two times.

Activity icon

Started a new Conversation How To Show Only Four Records In View If I Have List Of Records Coming From Database.

I fetch a list of categories somewhere on my home page, now on the same page but the different section I want to show only four records how I can do it. here is my code from my view file.

  @forelse ($categories as $cat)
                <div class="col-lg-3 col-md-4 col-6">
                    <a href="#" class="d-block mb-4 h-100">
                        <div class="img-container"><img class="img-fluid img-thumbnail img-hover"
                                src="{{asset('front-end-assets/img/hotels.jpg')}}" alt="" />
                            <h3 class="cat-title">{{$cat->name}}</h3>
                        </div>
                    </a>
                </div>
                @empty
                <h2>Sorry!! Categories not available.</h2>
                @endforelse
Jul
08
3 months ago
Activity icon

Replied to How To Query Popular Posts/Category In Laravel ?

@michaloravec I thought it would be a bit tricky but that's so easy 😁 Btw Thank you so much dear 😍 it helps me a lot.