vendredi 21 juillet 2017

"Pay with Amazon Express" error help in PHP Laravel

I have integrated "Pay with Amazon Express" in my PHP Laravel Project It works fine in native PHP but in Laravel it shows following error "

We're sorry, but there's a problem processing your payment from this website.

Your account has not been charged. Please contact seller for assistance."

Can you help me that how can I debug it because I am unable to find what thing is causing error . Or what is causing this error?

I have used the following code http://ift.tt/2uh0neh and error snapshot is as follows: screen shot of error screen



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

How to achieve this on laravel 5 eloquent

How can i achieve something like this?

public function getInformation($model) {
  $result = $model::with(['province', 'city']);

  if($model == 'App\Models\Business') {
    $result->with(['businessProvince', 'businessCity']);
  }

  $result->get();
}

// call the function
$information->getInformation(\App\Models\Business::class);

i'm getting error

Object of class Illuminate\Database\Eloquent\Builder could not be converted to string

on the sample code above. Any suggestion is really appreciated.



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

Accessing collection froma relationship

So I have 2 tables.

DirtyEvent model and Event model.

I am retrieving DirtyEvent with Event which works fine

In blade I have:

    @if (\Request::is('profile/event'))
      @foreach ($events as $event)
        @if (empty( $event->image ))
        <div class="card-header">
          <span class="card-title"><a href=""> </a></span>
        </div>
        @else
        <div class="card-image">
          <img class="img-responsive" src=""></img>
          <span class="card-title"><a href=""> </a></span>
        </div>
        @endif
        <div class="card-content">
          <p><strong>Starts: </strong>@php echo ($startdate) @endphp - </p>
        <br>
        @if ($startdate != $enddate)
          <p><strong>Ends: </strong>@php echo ($enddate) @endphp - </p>
        <br>
        @endif
        <p><strong>Description:</strong></p>
        <br>
        <p></p>
        </div>

        <div class="card-action">
          <a href=""><i class="fa fa-pencil-square-o fa-2x" aria-hidden="true"></i></a>
          <form method="POST" action=>
            
            
            <button type="submit" class="delete" style="border:none;"><i class="fa fa-trash-o fa-2x" aria-hidden="true"></i></button>
          </form>
        </div>
      @foreach ($events->publicevents as $eventss)
      
      @endforeach
      @endforeach

However dd($events) gives me:

DirtyEvent Collection -> relations -> publicevents -> Event collection

but it is saying that publicevents do not exist in current collection.

ControlleR:

public function index()
{
    $id = Auth::id();
    $events = DirtyEvent::where('user_id', $id)
        ->with('publicevents')
        ->get();
    return view('events.viewEvent', compact('events'));
}

model:

public function publicevents()
{
    return $this->hasMany('App\Event', 'event_id');
}



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

How to use raw query in join clause in laravel5?

I am using multiple condition in join clause in laravel5 and there is one condition that is passed as a raw condition. How to pass it ?

I am getting this error Call to undefined method Illuminate\Database\Query\JoinClause::whereRaw()

Code is

->leftjoin('log_simple_calory as LC',
function($join)use($tz_lccreated_date,$dateRange){
  $join->on('LC.user_id_fk','=','UA.user_id_fk');
  $join->on('LC.is_active','=',DB::raw('1'))
  ->whereRaw('date('.$tz_lccreated_date.')'. $dateRange);
})



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

Apache in Docker won't deliver laravel site

I have a problème with docker-compose. I am using a developpement configuration with docker-compose.

my docker-compose.yml : version: '3' services: # base de données mysql database: image: mysql:5.7 container_name: mysql57_SnptesAdhesion ports: - 3306:3306 expose: - 3306 volumes: - /data/dev/docker/composePhpSnptesAdhesion/database:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=myPassword

  # apache 2.4 et php 5.6 fourni par le fichier Dockerfile
  php:
    build: .
    container_name: apache24_php56_SnptesAdhesion
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /data/devPhp/workspace:/var/www/html
    links:
      - database
    environment:
      PMA_HOST: database
      PMA_PORT: 3306

I mount apache /var/www/html to a specific directory /data/devPhp/workspace on the machine.

It works pour simple apache conf file (000-default.conf) with :

   DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html>
            Options Indexes FollowSymLinks Includes ExecCGI
            AllowOverride All
            Require all granted
    </Directory>

In this case :

works.

But for laravel 5 i need a specific documentroot directory :

   DocumentRoot /var/www/html/adhesion/public

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html/adhesion/public>
            Options Indexes FollowSymLinks Includes ExecCGI
            AllowOverride All
            Require all granted
            # RewriteEngine On
            # RewriteRule ^(.*)$ public/$1 [L]
    </Directory>

and it doesn't work ... This urls :

fail with 404 error ...

Thanks in advance for any idea.



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

How to redirect to route logout when session timeout in laravel 5.4

i want to redirect to logout route when session hastimeout in laravel 5.4

i try this in app\exception\handler.php

    if ($e instanceof TokenMismatchException) {                       
         return redirect()->route('logout');
    }

but it still not working. what can i do



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

Google Docs integration in Laravel

Im trying to implement Google Docs Viewer in Laravel 5.4 Does anyone have idea how to do this in best possible way ?

Thanks in advance



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