moses

Experience

6,360

0 Best Reply Awards

  • Member Since 2 Years Ago
  • 0 Lessons Completed
  • 0 Favorites

16th September, 2018

moses started a new conversation Why `having` Only Worked On Fields That Are `group By` On Laravel Eloquent? • 3 days ago

My script laravel eloquent like this :

$query = $this->item->select('a.*','b.attribute_code')
    ->from('items as a')
    ->join('attr_maps as b','b.number','=','a.number')
    ->groupBy('a.number');

foreach($param as $key => $value) {
    $query = $query->having($key, '=', $value);
}

$query = $query->paginate(10);

If $param is array('number'=>'1234'), it works. No error

If $param is array('description'=>'test'), there exist error : Unknown column 'description' in 'having clause'

I tried all fields in the table items. Only the number field works. Apparently because the number field is group by

How can I solve this problem?

9th September, 2018

moses left a reply on Why POST Request From POSTMAN Returns Empty? • 1 week ago

@qiutuleng Okay thanks. I works. I want to ask again. How can I convert it to array?

moses started a new conversation Why POST Request From POSTMAN Returns Empty? • 1 week ago

My header in the postman like this :

enter image description here

My body like this :

enter image description here

In the routes laravel lumen, I check like this :

$router->group(['middleware' => 'auth'], function ($router) {
    ...
    $router->post('/sales-order', function (\Illuminate\Http\Request $request)
    {
        echo '<pre>';print_r($request->all());echo '</pre>';die();
    });
});

The result in the postman return empty array like this :

enter image description here

How can I solve the error?

3rd September, 2018

moses started a new conversation How Can I Solve "Fatal Error: Out Of Memory..." When I Run Command Schedule Laravel? • 2 weeks ago

My command like this :

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\ItemDetail;
class ImportItemDetail extends Command
{
    protected $signature = 'sync:item-detail';
    protected $description = 'sync item detail';
    public function __construct()
    {
        parent::__construct();
        ini_set('max_execution_time', 0);
        ini_set('memory_limit', '-1');
    }
    public function handle()
    {
        $path = storage_path('json/ItemDetail.json');
        $json = json_decode(file_get_contents($path), true);
        foreach ($json['value'] as $value) {
            ItemDetail::updateOrCreate(
                [ 'entry_number' => $value['Entry_Number'] ],
                [ 
                    'item_number' => $value['Item_Number'],
                    'description' => $value['Description'],
                    ....
                ]
            );
        }
    }
}

If I run the commmand, there exist error like this :

Fatal error: Out of memory (allocated 255852544) (tried to allocate 8192 bytes)

Whereas I had set ini_set('memory_limit', '-1'); in construct

How can I solve the error?

Note :

My record in the json file contains hundreds of thousands of data. So it takes a long time to check the fiel

moses left a reply on How Can I Call Command Schedule Via Url On The Laravel? • 2 weeks ago

@Snapey Can it be tried on localhost?

2nd September, 2018

moses started a new conversation How Can I Call Command Schedule Via Url On The Laravel? • 2 weeks ago

I using laravel 5.6

I set my schedule in the kernel.php like this :

<?php
namespace App\Console;
use App\Console\Commands\ImportLocation;
use App\Console\Commands\ImportItem;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
    protected $commands = [
        ImportLocation::class,
        ImportItem::class,
    ];
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('inspire')->dailyAt('23:00');

    }
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');
        require base_path('routes/console.php');
    }
}

So there are two command

I will show one of my commands like this :

namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Location;
class ImportLocation extends Command
{
    protected $signature = 'import:location';
    protected $description = 'import data';
    public function __construct()
    {
        parent::__construct();
    }
    public function handle()
    {
        ...
    }
}

I want to run the command via url. So it not run in the command promp

I try like this :

I add this script : Route::get('artisan/{command}/{param}', '[email protected]'); in the routes and I make a controller like this :

namespace App\Http\Controllers;
class CommandController extends Controller
{
    public function show($command, $param)
    {
        $artisan = \Artisan::call($command.":".$param);
        $output = \Artisan::output();
        return $output;
    }
}

And I call from url like this : http://myapp-local.test/artisan/import/location

It works. But it just run one command

I want to run all command in the kernel. So run import location and import item

How can I do it?

24th August, 2018

moses left a reply on How To Set Maximum Value Of Float In The Migration Laravel? • 3 weeks ago

@Cronix Thanks. I will change it to $table->decimal('amount', 12, 2);

moses left a reply on How To Set Maximum Value Of Float In The Migration Laravel? • 3 weeks ago

@pardeepkumar I had solve it. Like this : $table->float('amount', 12, 2);

moses started a new conversation How To Set Maximum Value Of Float In The Migration Laravel? • 3 weeks ago

I want the maximum value entered into the field amount is 900000000

In the migration I set this :

$table->float('amount', 10, 2);

If I input data 900000000 in the mysql, there exist error :

Out of range value for column 'amount'

I give some example from my data amount :

900000000

800100200,2

1000300,32

10100000,44

etc

How an I solve this problem?

21st August, 2018

moses started a new conversation How Can I Install Git Extension In Mac OS? • 4 weeks ago

I use Mac OS High Sierra version 10.13.6

I want to instal git extension

I read here : https://git-extensions-documentation.readthedocs.io/en/latest/getting_started.html#installation-macos-2-5x-only

If I run : mono GitExtensions.exe in the terminal there exist error like this :

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Process 767 detached
(lldb) quit
Abort trap: 6

How can I solve the error?

19th August, 2018

moses started a new conversation How Can I Pass Parameter Using Dynamic Breadcrums Laravel? • 1 month ago

My breadcrumbs view like this :

Home / Dashboard / Summary / Summary Detail

If link summary detail is active, the url link like this :

http://my-app.test/admin/summary-detail?item_number=123&vendor_code=V123&from_date=2018-01-01&to_date=2018-08-01

If I click link summary, the url like this :

http://my-app.test/admin/summary

I want if I click link summary, it will get all parameter from summary detail. So I want the url like this :

http://my-app.test/admin/summary?item_number=123&vendor_code=V123&from_date=2018-01-01&to_date=2018-08-01

How can I do it?

Note

I use dynamic breadcrumbs

documentation : https://github.com/davejamesmiller/laravel-breadcrumbs

In my \routes\breadcrumbs\summary.php like this :

<?php
Breadcrumbs::for('admin.summary.index', function ($trail) {
    $trail->parent('admin.dashboard');
    $trail->push(__('Summary'), route('admin.summary.index'));
});
Breadcrumbs::for('admin.summary-detail.index', function ($trail) {
    $trail->parent('admin.summary.index');
    $trail->push(__('Summary Detail'), route('admin.summary-detail.index'));
});

I using {!! Breadcrumbs::render() !!} in view blade to get it

My routes like this :

Route::resource('summary', 'SummaryController');
Route::resource('summary-detail', 'SummaryDetailController');

17th August, 2018

moses left a reply on How Can I Display Dinamyc Key Of Array In The Laravel Blade? • 1 month ago

@burlresearch There exist error htmlspecialchars() expects parameter 1 to be string, array given Seems it's no array of array. Try to see the collection again

moses started a new conversation How Can I Display Dinamyc Key Of Array In The Laravel Blade? • 1 month ago

My array like this :

$data = array(
    array('item_number' => 'AB-0001','total_quantity' => '1000', 'location-a' => '500', 'location-b' => '500'),
    array('item_number' => 'AB-0002','total_quantity' => '9000', 'location-a' => '5000', 'location-b' => '4000'),
    array('item_number' => 'AB-0003','total_quantity' => '6000', 'location-a' => '2000', 'location-b' => '4000'),
);

In the view blade laravel like this :

<table>
    <tr>
        <th>ITEM NUMBER</th>
        <th>TOTAL QUANTITY</th>
        <th>LOCATION-A</th>
        <th>LOCATION-B</th>
    </tr>
        @foreach($data as $value) {
        <tr>
            <td>{{ $value['item_number']; }}</td>
            <td>{{ $value['total_quantity']; }}</td>
            <td>{{ $value['location-a']; }}</td>
            <td>{{ $value['location-b']; }}</td>
        </tr>
        @endforeach
</table>

It works. But my key of array is dinamyc. The key can change

So the array can change like this :

$data = array(
    array('item_number' => 'AB-0001','total_quantity' => '500', 'location-a' => '500'),
    array('item_number' => 'AB-0002','total_quantity' => '5000', 'location-a' => '5000'),
    array('item_number' => 'AB-0003','total_quantity' => '2000', 'location-a' => '2000'),
);

Or can change like this :

$data = array(
    array('item_number' => 'AB-0001','total_quantity' => '1500', 'location-a' => '500', 'location-b' => '500', 'location-c' => '500'),
    array('item_number' => 'AB-0002','total_quantity' => '9500', 'location-a' => '5000', 'location-b' => '4000', 'location-c' => '500'),
    array('item_number' => 'AB-0003','total_quantity' => '6500', 'location-a' => '2000', 'location-b' => '4000', 'location-c' => '500'),
);

How do I set it in the laravel view blade so that it can adjust to dynamic arrays?

Update :

Actually my array $data is collection and pagination like this :

enter image description here

15th August, 2018

moses left a reply on How Can I Convert Many Statement Mysql To Laravel Eloquent? • 1 month ago

@jlrdw It seems you don't want to give specific answers. No problem, I will try it

14th August, 2018

moses left a reply on How Can I Convert Many Statement Mysql To Laravel Eloquent? • 1 month ago

@jlrdw Yes I have seen that. As I talked about above. I just find PREPARE and EXECUTE on the reference. But I didn't find the SET and DEALLOCATE PREPARE there

moses left a reply on How Can I Convert Many Statement Mysql To Laravel Eloquent? • 1 month ago

@jlrdw If you use PDO, why don't you give specific answers to my case?

moses left a reply on How Can I Convert Many Statement Mysql To Laravel Eloquent? • 1 month ago

@jlrdw Okay thanks. Now I'm looking at that. I find PREPARE and EXECUTE . But I didn't find the PREPARE and DEALLOCATE PREPARE there

moses left a reply on How Can I Convert Many Statement Mysql To Laravel Eloquent? • 1 month ago

@jimmck If I can do that, I won't ask here

moses left a reply on How Can I Convert Many Statement Mysql To Laravel Eloquent? • 1 month ago

@jlrdw Before I had never used it. But my problem is there are a lot of statements in my case. That made me difficult to convert it. So I hope you can answer with the script. So I can easily understand your answer

moses left a reply on How Can I Convert Many Statement Mysql To Laravel Eloquent? • 1 month ago

@jlrdw What do you mean?

moses started a new conversation How Can I Convert Many Statement Mysql To Laravel Eloquent? • 1 month ago

Mysql query like this :

SELECT
  GROUP_CONCAT(DISTINCT
    CONCAT(
      'ifnull(SUM(case when location_code = ''',
      location_code ,
      ''' then quantity end),0) AS `',
      location_code , '`'
    )
  ) INTO @sql
FROM
  item_details;
SET @sql = CONCAT('SELECT item_number,SUM(quantity) as "total_quantity", ', @sql, ' 
                  FROM item_details
                   GROUP BY item_number');

PREPARE stmt FROM @sql;
EXECUTE stmt;

DEALLOCATE PREPARE stmt;

I want to convert it to laravel eloquent, but i'm confused. Because there exist many statement. There exist PREPARE, EXECUTE, SET, DEALLOCATE etc. You can see query above

How can I convert it to laravel eloquent?

1st August, 2018

moses started a new conversation How Can I Solve "Relation 'a' Is Not Instance Of HasOne Or BelongsTo." In The Laravel? • 1 month ago

My laravel eloquent like this :

$query = ItemDetail::selectRaw('a.item_number, sum(abs(a.quantity)) as "total_quantity"')
              ->from('item_detail as a')
              ->join('items as b', 'b.id', '=', 'a.item_number');

if(isset($param['vendor'])) {
    $query = $query->where('b.vendor_id', '=', $param['vendor']);
}

$query = $query->groupBy('a.item_number')
               ->paginate($paged);

return $query;

If the query executed, there exist error like this :

Relation 'a' is not instance of HasOne or BelongsTo.

How can I solve this problem?

Update

My item model like this :

class Item extends Model
{
    ...
    protected $fillable = [
        'name',
        'vendor_id'
    ];
    public function item_details() 
    {
        return $this->hasMany(ItemDetail::class, 'id', 'item_number');
    }
}

My item detail model like this :

class ItemDetail extends Model
{
    ....
    protected $fillable = [
        'item_number',
        'name',
        'posting_date'
    ];
    public function item()
    {
        return $this->belongsTo(Item::class, 'id', 'item_number');
    }
}

8th April, 2018

moses left a reply on How Can I Solve Case-sensitive Where Like Statement On Json Data In Laravel Eloquent? • 5 months ago

@jlrdw I try this : Order::whereRaw('LOWER(information->"$.owner") like "%?%"', strtolower($receipt)) ->paginate(5);. But it's the same

moses left a reply on How Can I Solve Case-sensitive Where Like Statement On Json Data In Laravel Eloquent? • 5 months ago

@jlrdw I need a spesific answer. Because I had try it. But it's the same

7th April, 2018

moses started a new conversation How Can I Solve Case-sensitive Where Like Statement On Json Data In Laravel Eloquent? • 5 months ago

I use Laravel 5.6 and mysql database.

My Laravel eloquent query is like this:

Order::where('information->owner', 'like', '%'.$receipt.'%')->paginate(5);

Information field is a JSON type.

{"owner": "Chelsea"}

If $receipt is Chel, the query returns a result.

But if $receipt is chel or CHEL, the result is empty

How can I solve this problem?

14th March, 2018

moses left a reply on How Can I Validation Object String With Validation Laravel? • 6 months ago

@jcmargentina There exist error like this : The given data was invalid. The selected data.name field is required. The selected data.gender field is required. etc. Whereas I had fill the data

moses started a new conversation How Can I Validation Object String With Validation Laravel? • 6 months ago

I use laravel 5.6

I use https://laravel.com/docs/5.6/validation#form-request-validation to validation server side

My controller like this :

<?php
....
use App\Http\Requests\UserUpdateRequest;

class UserController extends Controller
{
    ...
    public function update(UserUpdateRequest $request)
    {
        // dd($request->all());
    }
}

Before run statement in the update method, it will call UserUpdateRequest to validation server side

The validation like this :

namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UserUpdateRequest extends FormRequest
{
    ....
    public function rules()
    {
        dd($this->request->all());
        return [
            'name'          => 'required|max:50',
            'gender'        => 'required',
            'birth_date'    => 'required',
            'address'       => 'required',
            'status'        => 'required'
        ];
    }
}

The result of dd($this->request->all()); like this :

Array
(
    [selected_data] => {"name":"agis","gender":"2","birth_date":"2018-03-13","address":"london"}
)

How can I validation if the data is object array like that?

moses started a new conversation How Can I Upload File Using Vuex Store On The Vue Component? • 6 months ago

If I using ajax in vue component like this :

<template>
    <div>
        ...
    </div>
</template>
<script>
    export default {
        methods: {
            submitForm() {
                ...
                formData.append('file', files)
                axios.post(this.baseUrl+'/member/profile/update',
                formData,
                {
                    headers: {
                        'Content-Type': 'multipart/form-data'
                    }
                }
                ).then(function(response) {
                    console.log('success')
                })
                .catch(function(error) {
                    console.log('fail')
                })
            }
        }
    }
</script>

It works. I successfully get the file

But here I want to using vuex store

My pattern of vuex store like this :

I change my vue component like this :

<template>
    <div>
        ...
    </div>
</template>
<script>
    export default {
        methods: {
            submitForm() {
                ...
                formData.append('file', files)
                this.updateProfile({formData, reload: true})
            }
        }
    }
</script>

In the component vue, it will call updateProfile method in modules user

The modules user like this :

import { set } from 'vue'
import users from '../../api/users'
import * as types from '../mutation-types'
// initial state
const state = {
    addStatus:null
}
// getters
const getters = {
    updateProfileStatus: state =>  state.addStatus,
}
// actions
const actions = {
    updateProfile ({ dispatch,commit,state },{user,reload})
    {
        users.updateProfile(user,
            response => {
                commit(types.UPDATE_PROFILE_SUCCESS)
            },
            errors => {
                commit(types.UPDATE_PROFILE_FAILURE)
            }
        )
    }
}
// mutations
const mutations = {
    [types.UPDATE_PROFILE_SUCCESS] (state){
        state.addStatus = 'success'
    },
    [types.UPDATE_PROFILE_FAILURE] (state){
        state.addStatus = 'failure'
    }
}
export default {
    state,
    getters,
    actions,
    mutations
}

From the modules user, it will call updateProfile method in api users

The api users like this :

import Vue from 'vue'
export default {

    updateProfile (user, cb, ecb = null) {
        axios.post('/member/profile/update', user)
            .then(response => cb(response))
            .catch(error => ecb(error))
    }
}

So my pattern like that. So i'm using pattern of vuex store

My problem here is I'm still confused to send file data

If I console.log(user) in the updateProfile method on modules user, the result is undefined

How can I send file data using vuex store?

8th March, 2018

moses left a reply on Why Return Is Not Working In The Img.onload On The Vue Component? • 6 months ago

@topvillas I'm still confused to implement the promise. Please answer with the code

moses started a new conversation Why Return Is Not Working In The Img.onload On The Vue Component? • 6 months ago

I have vue component like this :

<template>
    <section>
        ...
    </section>
</template>
<script>
    export default {
        ...
        data() {
            return {
                allowableTypes: ['jpg', 'jpeg', 'png'],
                maximumSize: 4000000
            }
        },
        methods: {
            ...
            onFileChange(e) {
                if (this.validate(e.target.files[0])) {
                    let files = e.target.files,
                        reader = new FileReader()
                    // if any values
                    if (files.length){
                        reader.onload = (e) => {
                            this.image = e.target.result
                        }
                        reader.readAsDataURL(files[0])
                    }
                }
            },
            validate(image) {
                // validation file type  
                if (!this.allowableTypes.includes(image.name.split(".").pop().toLowerCase())) {
                    return false
                }
                // validation file size
                if (image.size > this.maximumSize) {
                    return false
                }
                // validation image resolution
                let img = new Image()
                img.src = window.URL.createObjectURL(image)
                let self = this
                img.onload = function() {
                    let width = img.naturalWidth,
                        height = img.naturalHeight

                    window.URL.revokeObjectURL(img.src)

                    if(width != 850 && height != 350) {
                        return false
                    }
                }
                return true
            }
        }
    }
</script>

If user upload image, it will call onFileChange method. Before display the image, it will call method validate to validate the image

I try validate file size and file type and it works

My problem here is validate the resolution

From my code, it seems my code is true

But I try like this :

I upload image with width = 100, height = 100

From the code, should it return false

But when I run my code, it return true

Seems return is not working in the img.onload

How can I solve this problem?

3rd March, 2018

moses started a new conversation How Can I Upload Image Using Storage::put On The Laravel? • 6 months ago

My code to upload image like this :

$file = $file->move($path, $fileName);

The code works

But I want to change it using Storage::put like this reference :

https://laravel.com/docs/5.6/filesystem#storing-files

I try like this :

Storage::put($fileName, $path);

It does not works

I'm confused, where I must put $file on the code

How can I solve this problem?

24th February, 2018

moses left a reply on How Do I Upload Files On 2 Folders At Once In One Method On The Laravel? • 6 months ago

@skliche Thanks a lot. It works

moses started a new conversation How Do I Upload Files On 2 Folders At Once In One Method On The Laravel? • 6 months ago

I use laravel 5.6

I want to upload files on 2 folders at once. So if the image uploaded successfully in the product folder, I want the image uploaded in the thumbs folder as well

I try like this :

public function uploadImage($file)   
{
    if($file) {
        $fileName = str_random(40) . '.' . $file->guessClientExtension();
    }

    $destinationPath = storage_path() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'product';

    if(!File::exists($destinationPath)) {
        File::makeDirectory($destinationPath, 0755, true);
    }

    $file->move($destinationPath, $fileName);

    $destinationPathThumb = storage_path() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'product' . DIRECTORY_SEPARATOR . 'thumb';

    if(!File::exists($destinationPathThumb)) {
        File::makeDirectory($destinationPathThumb, 0755, true);
    }

    $image_resize = Image::make($file->getRealPath());  
    $image_resize->resize(300, 300);
    $image_resize->save($destinationPathThumb . DIRECTORY_SEPARATOR . $fileName);
    
    return $fileName;
}

If the code run, it just success to upload in the product folder. It did not upload in the thumbs folder

There exist error like this :

message Unable to find file (/tmp/phpUSxbEJ).

exception Intervention\Image\Exception\NotReadableException

I try run this code :

public function uploadImage($file) 
{
    if($file) {
        $fileName = str_random(40) . '.' . $file->guessClientExtension();
    }
    $destinationPathThumb = storage_path() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'product' . DIRECTORY_SEPARATOR . 'thumb';

    if(!File::exists($destinationPathThumb)) {
        File::makeDirectory($destinationPathThumb, 0755, true);
    }
    $image_resize = Image::make($file->getRealPath());  
    $image_resize->resize(300, 300);
    $image_resize->save($destinationPathThumb . DIRECTORY_SEPARATOR . $fileName);
    return $fileName;
}

So I remove code to upload in product folder. I try it and it works. It success upload on the thumbs folder

So I think in one process, it only upload in one folder

Is there any other way to upload on 2 folders?

21st February, 2018

moses started a new conversation How Can I Call View Blade Laravel In Vue Component? • 6 months ago

My view blade laravel like this :

<section class="content">
    <product-list :product-data="{{json_encode($products)}}"></product-list>
</section>

In the view blade call vue component

The vue compoponent like this :

<template>
    <div class="box">
        ...
        <div class="box-body">     
            <div class="box-footer">
                <!-- call view blade -->
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        ...
    }
</script>

In the vue component, I want to call view blade laravel

The view blade like this :

{{$products->links()}}

I want to call it because the pagination only run in view blade

How can I do it?

moses started a new conversation How Can I Display Pagination Laravel On The Vue Component? • 6 months ago

My controller like this :

public function index()
{
    $products = $this->product->list(); 
    dd($products);
    return view('admin.product.index',compact('products'));
}

The result of dd($products); like this : https://postimg.org/image/w39usbfrv/

My view blade laravel like this :

<section class="content">
    <product-list :product-data="{{json_encode($products)}}" :page="{{json_encode($products->links())}}"></product-list>
</section>

My vue component product list like this :

<template>
    <div class="box">
        ...
            <table class="table table-list">
                ...
                <tr v-for="item in products" :key="item.id">
                    <td>{{item.name}}</td>
                    <td>{{item.createdAt}}</td>
                    <td>{{item.updatedAt}}</td>
                </tr>
                ...
            </table>
            <div class="box-footer">
                ...
                    {{this.page}}
                ...
            </div>
        ...
    </div>
</template>
<script>
    export default {
        props: ['productData','page'],
        data(){
            return {
                ...
                products: this.productData.data,
            }
        },
        ...
    }
</script>

If I run the code, the result of {{this.page}} is empty

If this : {{$products->links()}} placed in view laravel it works

But if it passed on the vue component, the result is empty

How can I solve this problem?

Note :

I know how to use ajax request. But I don't use it. Here I just want to try the another way

moses left a reply on How Can I Pass Pagination Data And Array From Controller Laravel To Vue Component? • 6 months ago

@bobbybouwmann I just want to try it. There exist error like this : "htmlspecialchars() expects parameter 1 to be string, array given (View: /home/vagrant/code/my-app/resources/views/admin/product/index.blade.php)"

moses started a new conversation How Can I Pass Pagination Data And Array From Controller Laravel To Vue Component? • 6 months ago

My controller like this :

public function index()
{
    $products = $this->product->list(); 
    dd($products);
    return view('admin.product.index',compact('products'));
}

The result of dd($products); like this : https://postimg.org/image/w39usbfrv/

My view blade laravel like this :

<section class="content">
    <product-list :products="{{$products}}" test="test"></product-list>
</section>

My vue component product list like this :

<template>
    <div class="box">
        ...
    </div>
</template>
<script>
    export default {
        props: ['products','test'],
        mounted(){
            console.log(this.test)
            console.log(this.products)
        }
        ...
    }
</script>

If I run the code, on the console just display result ofconsole.log(this.test)

The result of console.log(this.products) is not display

Why it not display?

How can I solve this problem?

15th February, 2018

14th February, 2018

moses left a reply on How Can I Solve "Connection Could Not Be Established With Host Smtp.gmail.com"? • 7 months ago

@sutherland I am still confused. Because when I try on my localhost, it works. This just does not work when run the send mail on the staging server

moses left a reply on How Can I Solve "Connection Could Not Be Established With Host Smtp.gmail.com"? • 7 months ago

@Snapey In my localhost, it works. This just does not work on the staging server.

moses left a reply on How Can I Solve "Connection Could Not Be Established With Host Smtp.gmail.com"? • 7 months ago

@Snapey Then what is the right solution to solve my problem?

13th February, 2018

moses left a reply on How Can I Solve "We Were Unable To Obtain A LetsEncrypt SSL Certificate On Your Server" On The Forge Laravel? • 7 months ago

@bobbybouwmann I want to try it first. My server using digital ocean, forge laravel and gitlab. Where can I add sub domains in my dns? Is it in digital ocean? Or using ssh via putty?

moses left a reply on How Can I Solve "We Were Unable To Obtain A LetsEncrypt SSL Certificate On Your Server" On The Forge Laravel? • 7 months ago

@bobbybouwmann So, what should I do? Do I have to add my domain in DNS? How to? I need a detailed answer. Because I just first take care of the problem on the server. Before I just write code only

moses left a reply on How Can I Solve "Connection Could Not Be Established With Host Smtp.gmail.com"? • 7 months ago

@VijayKadiyam No. I don't remove it. I had run it. But it's the same

12th February, 2018

moses left a reply on How Can I Solve "Connection Could Not Be Established With Host Smtp.gmail.com"? • 7 months ago

@biishmar Like description in my question above. I had try it all, but it's the same

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.