dimanche 27 mai 2018

problems with router in laravel

Based on the job, I need to create an advertisement sheet that belongs to one user. I created a routs resource

Route::resource('/users', 'Users/PreviewController', ['only' => [ 'show', 'create', 'edit','store', 'update', 'destroy']]);
Route::get('/users/{id}', 'Users\PreviewController@index');
Route::get('/users/show/{id}', 'Users\PreviewController@show')->name('users.show');

He does an excellent job. I had to redo the "show" method, in order that I could output a particular user along with his articles. The problem is when I do the redirect after authorization and add the user_name method "index" to the end of the address bar, takes the parameters. But if I remove the address from the address line, I get a conflict. How can I work around this problem or can change the structure of my routing?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2L2BbQ6
via IFTTT

using Localized Carbon with diffForHumans duplicate number of days

in my page i show posts and i use diffForHumans to display how mush time pass when post created and i translate it usin Localized Carbon in arabic language . it's working but in days he display number of days two times . for exemple instead of showing 5 days ago. he display 5 5 days ago

<div class="row" >
    <!-- properties -->
    @foreach($orderOffers as $key => $offer)
        <div class="col-lg-4 col-sm-6">
            <div class="properties">
                
                <div class="image-holder"><span><i class="fas fa-hourglass-start"></i></span>
                    <img src=""  class="img-responsive dimensions" alt="properties">
                    <div class="status sold">
                        @if($offer->negotiable)
                            <i class="far fa-thumbs-up"></i>  قابل للتفاوض
                        @else
                            <i class="far fa-thumbs-down"></i> غير قابل للتفاوض
                        @endif
                    </div>
                </div>
                <h4><a href="property-detail.php"></a></h4>
                <p class="price"><i class="fas fa-hand-holding-usd"></i></p>
                <p class="price"> <i class="fas fa-map-marker"></i></p>
                <?php
                $id = $hashids->encodeHex($offer->id);
                ?>
                <a class="btn btn-primary" href="">عرض المزيد</a>
            </div>
        </div>
    @endforeach
</div>



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2KYxFWI
via IFTTT

Bootstrap carousel won't slide when adding dynamic data

I added data from database but they show separately and won't change or slide as they should. I tried using some JavaScript but couldn't make it work.

 
            <div class="carousel-inner">
                @foreach ($news as $row)
                    <div class="item active" onclick="javascript:getimageid('')">
                        <img src="data:image/png;base64,">
                        <div class="carousel-caption">
                            <h4><a href="#"></a></h4>
                            <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
                                tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
                            </p>
                        </div>
                    </div>
                @endforeach
            </div>
            <ul class="list-group col-sm-4">
                @foreach ($news as $rows)
                    <li data-target="#myCarousel" data-slide-to="0" class="list-group-item active">
                        <h4></h4>
                    </li>
                @endforeach
            </ul>
            



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GRYF7X
via IFTTT

Laravel Cashier & Stripe Subscription Renewals

I have implemented a subscription package on my application using Laravel Cashier and Stripe.

I would greatly appreciate assistance with understanding the following things please?

  • Does Stripe automatically renew a subscription and generate / send an invoice at the start of a new billing cycle? Or would I have to setup a cron job to renew subscriptions and send invoices?
  • What is the recommended approach to sending the user an email when issues with renewing a subscription arise such as declined cards?

I have spent a long time looking for the answer and have been unable to find anything.

Thank you in advance for any help.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Jg3soK
via IFTTT

exception "ThrottleRequests" errors to many request in api laravel

Since many devices have the same ip address request on the api server, I have a bug to many requests, there is a way to customize the "throttle" that the request is from a single device sent to the server. help me



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2sfZZfy
via IFTTT

Nested query for getting distinct category and there associated sub-category Laravel

I am working on laravel code, i am finding difficulty in getting nested query for sub-category list. My table structure is, column name below id | category_name | cat_head 1 | ultra slim suit | suit 2 | slim suit | suit 3 | Shoes | shoes 4 | Hats | accessories 5 | Cufflinks | accessories

now i want cat_head as main menu and category_name under it. Kindly help me in laravel eloquent way.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2IM3LZf
via IFTTT

creating Multiple Authentication Laravel 5.5

I plan to develop a system that has three two types (admin, users). I want to have each user types information stored in a separate table for easy access and to reduce the number of blank fields (if they were all in one table).

i need all users login in the same login form not separated form for each one of them



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GSSUqw
via IFTTT