haizone

Experience

5,100

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 6 Lessons Completed
  • 0 Favorites

27th August, 2018

haizone started a new conversation FullUrlWithQuery Didnt Work Current • 3 weeks ago

i use that function fullUrlWithQuery

like that:

<a href="{{request()->fullUrlWithQuery([$field->id => $val])}}">

in the first time its get good Query like this:

http://localhost:8000/category/tv?53=Smart+TV

anat thet my $field->id jts 53 and its good

now i whant to add to that Query more params

but i get wrong $field->id in that function and its start with 0 and i need to get other number

if i look at the same link i get that:

http://localhost:8000/category/tv?0=Smart+TV&1=Smart+TV

its start with 0 and the send param its 1 but its need to be 53 like that:

http://localhost:8000/category/tv?53=Smart+TV&53=Smart+TV

id i print my $field->id i get 53, but only in the fullUrlWithQuery() function at the second time i get wrong numbersID why its append?

                          <a href="{{request()->fullUrlWithQuery([$field->id => $val])}}">
                                {{$val}} - {{$field->id}} - {{request()->fullUrlWithQuery([$field->id => $val])}}
                            </a>

i get that result:

Smart TV - 53 - http://localhost:8000/category/tv?0=Smart+TV&1=Smart+TV

haizone left a reply on How To Make Dynamic Route • 3 weeks ago

@NOMGUY

thanks but i didnt whant to creat the route i whant to make that dynamic!

haizone started a new conversation How To Make Dynamic Route • 3 weeks ago

hi

i whant to make a filter with dynamic route

its need to be somthing like that:

url: www.google.com/product/{product}/ios/2.3/what

and i whant to get the stuff aftre {product} and filters that with my system and get back a result

how i can to that

but the url can be other i didnt know what the params in the url and i didnt know how much pararm the user input in the url its can be url: www.google.com/product/{product}/android/5

haizone started a new conversation How To Use Filter After Paginate • 3 weeks ago

hi

i have a list of products that i show with paginate(20)

its in cache

now i make a filter and i do that like this:

    if ($request->subject) {

    $products = $products->filter(function ($product) {
      return $product->specValues->whereIn('value',['Samsung'])->contains('field_id','1');
    })->count();

    }

now the filter work only on the first page and show me from the 20 products the products with that values

how i make that to show me from all the pages witour to call all the products again?

24th August, 2018

haizone left a reply on What Is The Best Way To Upload Laravel Api App To Aws? • 4 weeks ago

@mknooihuisen thanks i see the AWS Lambda and i need somthing like that but for a php laravel app amazone have a service like that

i see that ican to use with a tutorial and make its work with laravel but i didnt think its a good suloation i search about aws service that i update my php files esayli and use composer to

thanks

23rd August, 2018

haizone started a new conversation What Is The Best Way To Upload Laravel Api App To Aws? • 4 weeks ago

hi

i have a backend with laravel and i use all the service of amazone

my frontend is nuxt.js

my DB is in RDS and my images is in S3

my frontend is in S3.

now my laravel app is in EC-2 and i want to get other why to upload my laravel app to amazone server

and i want the best way to upload to aws but witout EC-2,
i didnt want to open a server

somone know if in amazone have more option to upload my larvel app API and the server didnt down never (not like EC-2 that i have a size for the server. somthing like S3 but for the API service.

thanks for the answers

22nd August, 2018

haizone left a reply on Count Collections After Groupby • 4 weeks ago

@lostdreamer_nl

how i can do that in one line? like here:

 $field->specValues()->get()->groupby('value')

but with the count paramter and sort becuse i use that in my blada like here:

@foreach($field->specValues()->get()->groupby('value') as $key => $value)
                <label class="form-check">
                    <input class="form-check-input" value="" type="checkbox">
                    <span class="form-check-label">
                    <span class="float-right badge badge-light round">[{{count($value)}}]       `           </span>
                    {{$key}}
                    </span>
                </label>  <!-- form-check.// -->
            @endforeach

haizone started a new conversation Count Collections After Groupby • 4 weeks ago

i make a groupby() in a Collections and i get that:

this is my code: $field->specValues()->get()->groupby('value')

and i get that result:

Collection {#1385 ▼ #items: array:45 [▼ "Nokia" => Collection {#813 ▼ #items: array:5 [▶] } "HTC" => Collection {#893 ▼ #items: array:22 [▶] } "Elephone" => Collection {#892 ▼ #items: array:4 [▶] } "Doogee" => Collection {#895 ▶} "Cubot" => Collection {#896 ▶} "ThL" => Collection {#898 ▶}

and i whant to add a sory by the count on the Collection inside the value here:

in Nokia => 5 array Elephone=> 4 HTC => 22 array

and i whant to sory in one code ($field->specValues()->get()->groupby('value')) need to continu to sort that by the Collection thay hve in the value

this need to be the result: HTC => 22 array Nokia => 5 array Elephone=> 4

thanks

21st August, 2018

haizone left a reply on Filter With MorphToMany • 1 month ago

@tykus tahnks but how i can do somthing like that: return $product->specValues->whereIn('specvalued_id', '30')->whereIn('value','Nokia');

its didnt work :/

look here: http://prntscr.com/klab90

haizone left a reply on Filter With MorphToMany • 1 month ago

@tykus great! its work!!

haizone left a reply on Filter With MorphToMany • 1 month ago

@tykus thanks for the try but i get back all the products list like:

$products = $category->products()->with('specValues')->get();

As if we had not done a filter

haizone left a reply on Filter With MorphToMany • 1 month ago

@NOMGUY that the error, i try all!!! but its didnt work

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'specValues.id' in       'where clause' (SQL: select `products`.*, `categorized`.`category_id` as `pivot_category_id`, `categorized`.`categorized_id` as `pivot_categorized_id`, `categorized`.`categorized_type` as `pivot_categorized_type` from `products` inner join `categorized` on `products`.`id` = `categorized`.`categorized_id` where `categorized`.`category_id` = 60 and `categorized`.`categorized_type` = Model\Product and `specValues`.`id` = 316)

haizone left a reply on Filter With MorphToMany • 1 month ago

@NOMGUY the same:

Too few arguments to function Illuminate\Support\Collection::get(), 0 passed in

haizone left a reply on Filter With MorphToMany • 1 month ago

@NOMGUY thanks but i get that error:

Too few arguments to function Illuminate\Support\Collection::get(), 0 passed in 

that what i do:

$products = $category->products()->with('specValues')->get();
$rr = $products->where('specValues.id', '=' ,  '316')->get();
dd( $rr );

haizone started a new conversation Filter With MorphToMany • 1 month ago

i have a MorphToMany with categories and products

and i get the products belongs the category like that: $products = $category->products()->with('specValues')->get();

now i whant to use filter and get with a fild i have in specValues ( the specValues is a morphMany in my product model)

and i didnt fix that i try:

$products->whereHas('specValues', function ($q){
         $q->where('value', '2017');
 })->get();

and i try:

$products->where('specValues.id', '316'); 

but its didnt work somone know how i can fix that?

19th August, 2018

haizone left a reply on CORS Access-Control-Allow-Origin Headers Not Being Added In Api Subdomain • 1 month ago

@kumar92varun hi u fix that? u can tell us how?

13th August, 2018

haizone left a reply on Laravel - Make A Filter With Relations • 1 month ago

@s4muel yes somthing like that, but is didnt work i get that error: Maximum execution time of 300 seconds exceeded

haizone started a new conversation Laravel - Make A Filter With Relations • 1 month ago

i have a product table with relations: "specValues"

in my product model:

public function specValues(){
    return $this->morphMany('App\Models\SpecValue', 'specvalued');
}

in my specValues in have:

class SpecValue extends Model
{
  use Cachable;

    protected $table = 'specvalued';

    protected $fillable = ['field_id', 'value', 'value_desc', 'link', 'specvalued_id', 'specvalued_type'];

    public $timestamps = false;

    public function specvalued()
    {
        return $this->morphTo();
    }
    public function field()
    {
        return $this->belongsTo('App\Models\SpecField','field_id');
    }
}

now i whant to make a filter and multi filter for the products list: with the "specvalued()" (from the specvalued table) i get the name (or id) and with the "value" fild" from the specvalued table

the specValues with product looks like this: ( i have alot like that but with a diffrent specvalued_id and value, and i whant a make a filter with that.

#attributes: array:8 [▼
            "id" => 354327
            "field_id" => 4
            "specvalued_id" => 27535 //(name = year)
            "specvalued_type" => "Model\Product"
            "value" => "2017"
            "value_desc" => null
            "link" => null
            "created_at" => "2017-09-03 10:12:30"
          ]

and i try to make somthing like that to get a products with spespic value from specValues table after filter:

$products = $category->products()->with('specValues')->
where ????
orderBy('position')->paginate(20);

how i do the where options with my info?

8th August, 2018

haizone left a reply on BelongsToMany With Two Diffrent Mysql Connection • 1 month ago

plz somone

haizone started a new conversation BelongsToMany With Two Diffrent Mysql Connection • 1 month ago

i have a 2 diffrent mysql connection

1 - mysql db

  • categories table

2 - articles db

  • article table
  • articles_categories table

i try to make a relationship with the two tables with a difrrent mysql conacction

but i get an error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'articles.categories' doesn't exist (SQL: select `categories`.*, `articles_categories`.`article_id` as `pivot_article_id`, `articles_categories`.`category_id` as `pivot_category_id` from `categories` inner join `articles_categories` on `categories`.`id` = `articles_categories`.`category_id` where `articles_categories`.`article_id` = 7)

categories db is inside mysql table and article and articles_categories is inside the articles db connaction

this is my code:

  public function categories(){

return $this->belongsToMany('App\Models\Category','articles_categories','article_id','category_id');

}

i think the laravel try to find the categories table in articles db but the categories table is inside the mysql db

i try to make that:

return $this->belongsToMany('App\Models\Category','mysql.articles_categories','article_id','category_id');

but is didnt work :/

thanks

7th August, 2018

haizone left a reply on Error: CacheTags ? • 1 month ago

@fbss no

but i think its becuse i add to mysql the tags and didnt from the app

23rd July, 2018

haizone started a new conversation Integration Mysql And Mongodb • 1 month ago

how i can Integration with mysql DB and mongoDB i have a website and i have one table with 2M records and all the time bigger a friend tell me to move that to mongodb how i can do to that with laravel? somone have a tutorial for that i need only a one table to put in mongodb and need to be with Relationship to other table with mysql db

many thanks

20th July, 2018

haizone started a new conversation Get Geo Location With Vue • 2 months ago

hi how i found the latitude and longitude of the user with the browser gps from computer and mobile with vue? but auto (if the gps are open)

thanks

19th July, 2018

haizone started a new conversation How To Make A Href With Url And Var • 2 months ago

hi i try to do that but its didnt work and i didnt found an answers

 <a href="https://waze.com/ul?ll=".{{ $business->latitude  }}.",". {{$business->longitude }} ."&navigate=yes" class="btn btn-icon btn-primary">
                      

thanks

16th July, 2018

haizone left a reply on Problem With Find In Many To Many • 2 months ago

its inside problem i my model i fix that

thanks

haizone started a new conversation Problem With Find In Many To Many • 2 months ago

i have a problem

this code dosnt work:

    $businesses = Business::where('slug', $slug)
->with([
    'reviews' => function ($query) {
        $query->select('slugi', 'name');
    }
])->first(['id', 'name']);
return response()->json($businesses);

i get:

{

"id": 2852, "name": "biz name", "ReviewsCount": 17, "ReviewsAvg": "3.9", "reviews": [

] }

the reviews is empty (and i have a data inside)

but if i do like this:

$business = Business::where('slug', $slug)->first()->reviews()->get();

i get all the info

someone know what is the problem?

9th July, 2018

haizone started a new conversation Need A Help With A Filter In Vuejs • 2 months ago

hi sorry about that msg but i didn know what to do

my english is didnt so good and i have a problem with my vue and i didnt know how to explain in a msg and find any help

so if somone can give me his skype and help me to fix my problem I would be very grateful

many thanks and sorry about that msg

8th July, 2018

haizone left a reply on Insert A Array To Array • 2 months ago

@Sergiu17

that is my code

          for(var spec in this.productstores[pro].productspec){
          if(this.filters[spec].name === this.productstores[pro].productspec[spec].name){
            this.filters[spec]['filter'] = [this.productstores[pro].productspec[spec].pivot.value];
        }

now i get that :

0 :
   created_a:(...)
   filter:["111"]
   id:(...)
  name:(...)

i need in the filter: to get ["222","3333","111"] but the script all the time delete and show me only the last one and i whant to push to the array all time from the for loop to the array

thanks for the help

haizone started a new conversation Insert A Array To Array • 2 months ago

i have a array ['one', 'two','trhee']

now i want to push into the array at index 0 more array and with for loop insert the value to the array

this is my code but is didnt work: this.filters[0].push(this.productstores[pro].productspec[spec].pivot.value);

i whant in this.filters[0] i get more array with options this.filters[0][0] and get a value when i print that

thanks

4th July, 2018

haizone left a reply on Get All The Other Id In Find() • 2 months ago

@tomopongrac thanks its work but mybe have an other why to do that? maybe faster way

haizone left a reply on Get All The Other Id In Find() • 2 months ago

haizone started a new conversation Get All The Other Id In Find() • 2 months ago

i have a function that i get all the records from the db i have in the db the ids: 1,2,3,4,5

$businessproduct->branches()->find([1,2,3]);

and i get in collection all of that id's - and its great!

but now i whant to get all the other id's (didnt inside the find() but thay in the relationships in this case the id's: 4,5 (in a collection - i need to get back)

i need to use a foreach or in laravel have a faster why to do that?

haizone left a reply on Eloquent Manytomany How To Work With Visible • 2 months ago

@BishoyWagih i just do with sync and itsnt good

$businessproduct->branches()->sync($request->branches);

how i do that with pivot witout use sync and in once time: check if the records in the db if yes update the pivot else id didnt in the db inster the rerelationship with the pivot

haizone left a reply on Eloquent Manytomany How To Work With Visible • 2 months ago

@BishoyWagih thanks i know that but i have a problem how i chack id the record find the table to updta him or insert him thw sync() do for me the all of that

haizone started a new conversation Eloquent Manytomany How To Work With Visible • 2 months ago

i whant to use Eloquent manytomany but when i finish i get the table in the DB and all the time i use sync() function the records in the DB delete and add a new if i back the rerelationship

how i make a fild with visible and only change him in the DB when i sync() the rerelationship becuse i didnt whant to delete the record from the db

2nd July, 2018

haizone started a new conversation How To Make That In Eloquent • 2 months ago

hi i need a littlebit help with my tables:

table: product: -id -name

table: spec: -id -product_id -name

table: bizproduct: -id -name

table: bizProductSpec: -id -bizproduct_id -spec_id -value

how i make that and use with laravel?

how to make the relation betwen bizProductSpec and spec and bizproduct tables

and how to make hasMany and belogs to

i try but its didnt work to me :/

29th May, 2018

haizone left a reply on Search With Relationships • 3 months ago

i do that and i get the products: $items = Business::where('id',$business->id)->with(['products' => function($query) use ($search) { $query->where('name', 'LIKE', '%' . $search . '%') ->orWhere('english_name', 'LIKE', '%' . $search . '%') ->orWhere('model', 'LIKE', '%' . $search . '%'); }])->paginate(10);

but i get a json with Business and inside more json with products becouse of that the paginate didnt work :/

and i whant to get only the products

haizone left a reply on Search With Relationships • 3 months ago

@Sergiu17 thanks again but it didnt work i get the same problem

i whant to search for a products that belongs to spasific business and i have the business in var $business in products table i have a business_id

haizone left a reply on Search With Relationships • 3 months ago

@Sergiu17 thanks i get an error and i cant fix that:

Parse error: syntax error, unexpected '}'

thanks for the help

haizone started a new conversation Search With Relationships • 3 months ago

hi

i have a problem i try to search on a relationships and i get all the items from the model back

that what i do:

i have a table "products" with 70,000 items

now i have a business with products , when i search and use get() i get a 250 results but if i do like this code with search i get "total_items": 30527 and i need to see only 250 in here

   $items = $business->products()->where('name', 'LIKE', '%' . $search . '%')
                       ->orwhere('english_name', 'LIKE', '%' . $search . '%')
                       ->orwhere('model', 'LIKE', '%' . $search . '%')
              ->orderBy('updated_at','ASC')->paginate(10);

what i do wrong?

24th May, 2018

haizone started a new conversation Add Dyanmic Url To Data->items() • 3 months ago

hi i use $items->items()

to get my data with api

and i get the data

how i can add to eche of data in my array a dynamic url here a pic of my array http://prntscr.com/jm0m7d

    $response = [
           'data' => $items->items()
        ];

i get data like this:

        "data": [
            {
            "id": 1,
            "reviewable_id": 2863,
            "rating": 5,
            "shipping": 0,
            "customer_service": 0,
            "updated_at": "2018-01-06 08:39:50",
            "created_at": "2017-10-09 16:43:52"
            },
        ]

and i whant more dynamic url but only for this api response and not for all the time witour to add attribute to model

haizone left a reply on Paa A Props Data But Get An Null Error • 3 months ago

@Sergiu17 i get the same error:

app.js:37202 [Vue warn]: Error in mounted hook: "ReferenceError: padination is not defined"

found in

---> at resources\assets\js\components\pagination.vue

haizone started a new conversation Paa A Props Data But Get An Null Error • 3 months ago

hi i passing a props object

http://prntscr.com/jlxohk

and i get the data but i get an error on my console:

http://prntscr.com/jlxorc

but i passing the data and i see the data in my broswer but i still get this error, why is that?

that is my code:

 <template>
        <nav aria-label="Page navigation example">
        <ul class="pagination">
            <li class="page-item"><a class="page-link" href="#">Previous</a></li>

    {{padination.count}}

            <li class="page-item"><a class="page-link" href="#">Next</a></li>
        </ul>
        </nav>
    </template>

    <script>
        export default {
            props: ['padination'],
            mounted() {
                //console.log(padination);
            }
        }
    </script>

12th May, 2018

haizone started a new conversation Get User Location With Laravel And Vue • 4 months ago

Hi I whant to get my users Location, and give them the power to change the address of there Location and something free I see google maps but it’s coust money after a few use’s How the best why to do that?

And how I calculated the km from two places with: latitude longitude With a vuejs

Thanks

9th May, 2018

haizone left a reply on How To Pass A Big Props From Laravel To Vue • 4 months ago

@m-rk Thanks U can give me like datatable but with Vuejs ? And u mine i do that with api and without props ?

haizone started a new conversation How To Pass A Big Props From Laravel To Vue • 4 months ago

i have a very big props somthing like 4000 recores from the db and i move that to my vue with props

but its take alot of time and all the time stuck i insite the props to datatable to here: https://github.com/xaksis/vue-good-table

for pages and search

how i can do that with props to work good with that datatable

tahnks

7th May, 2018

haizone started a new conversation Need A Datatable Component With Laravel And Vue • 4 months ago

hi i need a datatable component a simple one with: paginator search filters

but i need to be simple to install i whant to put only my data in props (maybe more then one) and get the datatable

<table-component :bizproduct="{{json_encode($songs)}}" v-once sort-by="songs" sort-order="asc" > <table-column show="firstName" label="First name"></table-column> <table-column show="lastName" label="Last name"></table-column> <table-column show="instrument" label="Instrument"></table-column> <table-column show="songs" label="Songs" data-type="numeric"></table-column> <table-column show="birthday" label="Birthday" data-type="date:DD/MM/YYYY"></table-column> <table-column show="editUrl" label="" :sortable="false" :filterable="false"></table-column> </table-component>

i found that but is witour a paginator: https://murze.be/a-straightforward-vue-component-to-filter-and-sort-tables

sonbody know a good datatable that i need but again i need very very simple

6th May, 2018

haizone started a new conversation Need A Package To Edit Images • 4 months ago

hi i didnt found a image edit in vuejs

and i need somthing smart With a lot of function to edit image and add text (with style) on the image and all that editor have

somone know about good package to do that?

thanks

3rd May, 2018

haizone started a new conversation Problem With Socilite Google Acoount "no Massage" • 4 months ago

hi i try to connect with my gmail account and i get that error: someonw know how to fix that?

exception 'Laravel\Socialite\Two\InvalidStateException' in /example/vendor/laravel/socialite/src/Two/AbstractProvider.php:161

this is the pic of the error: http://prntscr.com/jd5x2s

its work befor but now i didt know why the facebook login is work

Edit Your Profile
Update

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