farshadf

farshadf

Member Since 1 Year Ago

Experience Points
7,330
Total
Experience

2,670 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
10
Lessons
Completed
Best Reply Awards
0
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 2
7,330 XP
Sep
25
12 hours ago
Activity icon

Replied to How To Make Jpg File From A Blade View In Laravel (making Certificate For Users)

thanks this helped me i just put the wrong path to the config <3

Sep
24
1 day ago
Activity icon

Started a new Conversation How To Make Jpg File From A Blade View In Laravel (making Certificate For Users)

i want to give my users some certificate that they can share on social media . i see that laravel have so many packages to export blade file as exel or pdf but as they are not shareable on social media i want my user to be able to download a certificate from site in image formats like jpg . my last and best try was snappy package that i wrote this code after install and config :

 public function snappy()
    {
        $snappy = App::make('snappy.image');
        return $snappy->generateFromHtml("<p>Hello World!</p>", "test.jpg");
    }

but with this i get this error below :

The exit status code '1' says something went wrong:
 stderr: "Unknown long argument --format Name: wkhtmltopdf 0.12.6 (with patched qt) Synopsis:
 wkhtmltopdf [GLOBAL OPTION]... [OBJECT]... <output file> Document objects:
 wkhtmltopdf is able to put several objects into the output file, an object is either a single webpage, a cover webpage or a table of contents. The objects are put into the output document in the order they are specified on the command line, options can be specified on a per object basis or in the global options area. Options from the Global Options section can only be placed in the global options area. A page objects puts the content of a single webpage into the output document.
 (page)? <input url/file name> [PAGE OPTION]... Options for the page object can be placed in the global options and the page options areas. The applicable options can be found in the Page Options and Headers And Footer Options sections.
 A cover objects puts the content of a single webpage into the output document,
 the page does not appear in the table of contents, and does not have headers and footers
. cover <input url/file name> [PAGE OPTION]... All options that can be specified for a page object can also be specified for a cover. A table of contents object inserts a table of contents into the output document. toc [TOC OPTION]... All options that can be specified for a page object can also be specified for a toc, further more the options from the TOC Options section can also be applied. The table of contents is generated via XSLT which means that it can be styled to look however you want it to look. To get an idea of how to do this you can dump the default xslt document by supplying the --dump-default-toc-xsl, and the outline it works on by supplying --dump-outline, see the Outline Options section. Description: Converts one or more HTML pages into a PDF document, using wkhtmltopdf patched qt. Global Options: --collate Collate when printing multiple copies (default) --no-collate Do not collate when printing multiple copies --copies <number> Number of copies to print into the pdf file (default 1) -H, --extended-help Display more extensive help, detailing less common command switches -g, --grayscale PDF will be generated in grayscale -h, --help Display help --license Output license information and exit --log-level <level> Set log level to: none, error, warn or info (default info) -l, --lowquality Generates lower quality pdf/ps. Useful to shrink the result document space -O, --orientation <orientation> Set orientation to Landscape or Portrait (default Portrait) -s, --page-size <Size> Set paper size to: A4, Letter, etc. (default A4) -q, --quiet Be less verbose, maintained for backwards compatibility; Same as using --log-level none --read-args-from-stdin Read command line arguments from stdin --title <text> The title of the generated pdf file (The title of the first document is used if not specified) -V, --version Output version information and exit Page Options: --print-media-type Use print media-type instead of screen --no-print-media-type Do not use print media-type instead of screen (default) Contact: If you experience bugs or want to request new features please visit <https://wkhtmltopdf.org/support.html> " stdout: " " command: "C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf" --format "jpg" "C:\Users\farshad\AppData\Local\Temp\knp_snappy5f6c4111e34787.24194280.html" "test.jpg".

is there any alternative to this package or any solution to this error ??

Aug
21
1 month ago
Activity icon

Started a new Conversation Show Modal In A Blade File Container In Another In Bagisto Ecommerce

i am using bagisto eCommerce system and now i want to add a pop up like a modal or a sweet alert to the page where user add the product to the shopping cart . so here is the code : add-to-cart.blade.php

 <button
                    type="submit"
                    {{ ! $product->isSaleable() ? 'disabled' : '' }}
                    class="theme-btn {{ $addToCartBtnClass ?? '' }}">

                    @if (! (isset($showCartIcon) && !$showCartIcon))
                        <i class="material-icons text-down-3">shopping_cart</i>
                    @endif

                        {{ __('shop::app.products.add-to-cart') }}
                </button>

and this file is contained in view.blade.php :

  <div class="product-actions">
   @include ('shop::products.add-to-cart', [
   'form' => false,
   'product' => $product,
   'showCompare' => true,
   'showCartIcon' => false,
   ])

and some how i feel this script is related to this part but i am not sure :

  <script type="text/x-template" id="product-view-template">
        <form
            method="POST"
            id="product-form"
            @click="onSubmit($event)"
            action="{{ route('cart.add', $product->product_id) }}">

            <input type="hidden" name="is_buy_now" v-model="is_buy_now">

            <slot v-if="slot"></slot>

            <div v-else>
                <div class="spritespin"></div>
            </div>

        </form>
    </script>
May
26
3 months ago
Activity icon

Replied to How To Test App To Insert User Into Database

Never noticed that before , i am really sorry for that and thanks for your help :)

Activity icon

Started a new Conversation How To Test App To Insert User Into Database

hi , i want to make a test that in my application i want to insert like 100k users the porpuse from that is to see if i face any problems or not and see how much is my system is capable of handling in case of usernames slugs and other things i am wondring to see if i should do it in dusk or maybe in using seeders but the thing is that i want to test the application too not only the database that it can successfully create like 200k users and like 20k invoices .how usually people does that kind of tests . thanks in advance

May
19
4 months ago
Activity icon

Started a new Conversation Using Where Or Where In Laravel To Get Certain Amout From Each Category

i have a query that i want to take some certain amount of object from each category for example 4 from category 1 and 4 from category 2 and here is what i wrote :

$wish = DB::table('table')
            ->where('category_id', $category)
            ->whereIn('type_id',[2,4])
            ->take(8)->get();

so here i want to say to take 4 from type_id 2 and get another 4 from type_id 4 . is there any way to do that or any package to do that in caravel eloquent ??

May
16
4 months ago
Activity icon

Replied to Reciving The Send Data From Laravel To Logstash In Kibana

yes , the problem was with my indices which does not exited i made it and every thing went fine

May
13
4 months ago
Activity icon

Started a new Conversation Best Way To Stress Test Your Site

hi , i am wondering to know how can i test my site to see how much i am capable of handling users with my current hardware .what is the most exact tool for doing this job and what most companies are doing this with . thanks in advance

May
09
4 months ago
Activity icon

Replied to Clearing Cache From Site Users Google Chrome

i am on production mode so it shows my custom 500 error but why i am sure that this is brower cache because in my own computer it happened too but when i cleared cache after 3 days i could access the site and the other point is that i have no log in my logs because of that 500 error that users recive .

Activity icon

Replied to Clearing Cache From Site Users Google Chrome

i did that but again its a 500 error on browser . its chrome cache .

Activity icon

Started a new Conversation Clearing Cache From Site Users Google Chrome

i had a spike campaign on my website which users recived 500 error . now the chrome cached my website and it shows the 500 page but if you go to setting and remove the past 7 days cache on chrome it will show you the site and this happens on 2 pages only . i wanted to know if there is any way to reset this cache from users browser i dont know if it makes sence or not . or some how clear my own app site and fix this problem for my users . thanks

May
07
4 months ago
Activity icon

Started a new Conversation Using Minio For Private Servers

hi , i wanted to know if it is wise to implement min.io in my laravel project in a local server . by local i mean i am not using aws servers and i wanted to know how much is diiference in performance if i implement mino rather than laravel default storage and if there is any article or any thing about teaching how to implement that in laravel . thanks

May
06
4 months ago
Activity icon

Replied to Importing A Table In Another With Different Columns

actually thants right i think i should do it with insert like below :

INSERT INTO `table1`(column_1,column_2,...) VALUES (value_1,value_2,...), (value_1,value_2,...), (value_1,value_2,...), (value_1,value_2,...), (value_1,value_2,...), (value_1,value_2,...), (value_1,value_2,...);

now my question is how can i make the secound table data ready to be places in values because it can be like 10k rows and one more thing is that one table is in postgresql and the secound is on mysql so i want to somehow migrate that

Activity icon

Replied to Importing A Table In Another With Different Columns

i am trying ti import data not making table

Activity icon

Started a new Conversation Importing A Table In Another With Different Columns

i have 2 tables with different column but some same columns like 5 similar columns in order like below : table1 :

id,
name,
cellphone,
. 
.
.
updated_at

and table2 :

id,
username,
adress,
uuid,
.
.
.

now what i want is sync table 2 into table 1 structure to remove some columns and import that into table 1 how can i do that and is there any tool for that once i heared that this can be done with dbforge but i have no idea if its right or not .

May
03
4 months ago
Activity icon

Replied to Mysql Vs Postgresql For The Fairly Big Project

@tray2 thanks for the answer for me its of course MySQL but i wanted to know what is the benefit of the company in case of performance and extending the project . thanks for the answer

May
02
4 months ago
Activity icon

Started a new Conversation Mysql Vs Postgresql For The Fairly Big Project

hi, i am trying to rewrite a project which was on postgresql which was written in monolithic architecture . now we are trying to make it Service oriented and api base and seperate the front project from backend so in my project the heaviest table is like 100k users and i mostly have read rather than write in my project and i read over the net that mysql is better at read than postgres . so i wonder to know that if its wise to move to mysql and for the new project considering the pain of convert the database to mysql . thanks in advance for your guides .

Apr
28
4 months ago
Activity icon

Replied to Chunking Huge Query With Withcount And Orderby

it counts the relation that this model has which is the user referal that it shows the number of people user invited to site

Activity icon

Replied to Chunking Huge Query With Withcount And Orderby

256mb on server and i have been told that it cant be increased a lot due to high load on server and the query is being lunched on like 50k users . is that amount really alot for that ram ???

Activity icon

Replied to Chunking Huge Query With Withcount And Orderby

@wingly no and i tried the directly in query way too it again hits memory limit

Activity icon

Started a new Conversation Chunking Huge Query With Withcount And Orderby

i have a pretty heavy query that hits the memory limit and return 500 error here is the query :

       $collection = User::with('city')
            ->withCount('userReferral')
            ->orderByDesc('user_referral_count')
            ->get();

        $data  = $collection->where('username', $userName);

this is for a ranking that shows the user rank on the ranking of the users based on the count of user she/he invited to site . this now returns 500 on server which is because of memory limit which i dont want it to consume that amount of memory . how can i rewrite this with chunk so it consume less memory ??

Apr
19
5 months ago
Activity icon

Started a new Conversation How To Add An Auto Increment Field In Laravel Api Resource

i want to make a ranking for my users based on thier point and what i want to do is to order them by points and set a ranking field to it . i am using laravel api resource and in resource i want to add a field called ranking and ++ it so by the order user be ranked from 0 to n

   $data = User::with('city')
                    ->withCount('point')
                    ->orderByDesc('points_count')
                    ->get()
        ;
        $data = $data->where('points_count', '!=', 0);
        return UserPointResource::collection($data);

and here is my resource :

 return [
            "id"       => (int)$this->id,
            "fullname" => $this->fullname,
            "city"     => $city ? $city->name,
            "count"    => (int)$this->points_count,
        ];

so i want to add a field under count in resource named ranking to ++ each time it shows a user and shows user ranking . thanks

Apr
18
5 months ago
Activity icon

Started a new Conversation Running Gitlab Cicd For Laravel

hi i wanted to make cicd for my laravel app and i simply want to when ever i push to some specific branch or accept merge request on it all 3 servers that i have automatically pull the code . so what i have done so far . i have installed gitlab runner and i added this file to my git :

stages:
  - deploy

deploy:
  stage: deploy
  script:
    - cd /home/wishato/code
    - sudo git pull origin stagging
  tags:
    - stagging

when this runs i get this error :

Running with gitlab-runner 12.9.0 (4c96e5ad)
   on farshad ci cd 8vEm7vWq
Preparing the "ssh" executor
00:09
 Using SSH executor...
 ERROR: Preparation failed: ssh command Connect() error: getSSHAuthMethods error: open /home/user/.ssh/id_rsa: no such file or directory
 Will be retried in 3s ...
 Using SSH executor...
 ERROR: Preparation failed: ssh command Connect() error: getSSHAuthMethods error: open /home/user/.ssh/id_rsa: no such file or directory
 Will be retried in 3s ...
 Using SSH executor...
 ERROR: Preparation failed: ssh command Connect() error: getSSHAuthMethods error: open /home/user/.ssh/id_rsa: no such file or directory
 Will be retried in 3s ...
 ERROR: Job failed (system failure): ssh command Connect() error: getSSHAuthMethods error: open /home/user/.ssh/id_rsa: no such file or directory

Mar
28
5 months ago
Activity icon

Started a new Conversation Video Is Not Showing Up In Ios Os

i have an up loader that uploads the video which is working on all devices and OS but not the iPhone ether the chrome or safari fails to open the video any idea what might be wrong because i checked net and i came up with this solution : in ios the player loads but it does not shows the video with the below solution

<video class="video" playsinline autoplay muted loop>

i did this yet no luck . this is the link i am trying to play video on ios :

https://wishato.com/wish/wStvun

here is my code for video :

<template>
    <div class="wishgallery">
        <loading :display="loading"></loading>
        <div class="gallery" v-show="dataLoaded">
            <transition-group name="wish-gallery"
                              tag="div"
                              class="gallery-items"
                              :enter-active-class="enterClass"
                              :leave-active-class="leaveClass">
                <div v-for="(item) in slideShow" :key="item.id" class="gallery-item"
                     v-show="item.active">

                    <img v-if="item.mime.match('image')" :src="item.path" alt="wishato" v-on:load="imgLoaded($event)">
                    <video class="video" controls v-else-if="item.mime=='video/mp4'" poster="">
                        <source :src="item.path" :type="item.mime">
                        your browser cant support this format 
                    </video>
                </div>
            </transition-group>
            <div class="navigator" v-if="slideShow.length > 1" :class="[{hidenavigator: navStat}]">
                <span class="hideIcon" @click="hidenav">
                    <i class="icon icon-chevron-down"></i>
                </span>
                <div class="nav-items">
                    <div class="nav-cont">
                        <div v-for="(item) in slideShow" :key="item.id" class="nav-item"
                             :class="{active : item.active}" @click="changeImage(item.id)">
                            <img v-if="item.mime.match('image')" :src="item.path" alt="wishato"
                                 v-on:load="imgLoaded($event)">
                            <div class="video" v-else-if="item.mime.match('video')">
                                <i class="icon icon-playvideo"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
Mar
27
5 months ago
Activity icon

Started a new Conversation Videos Are Not Playing In Ios Os

i have an up loader that uploads the video which is working on all devices and OS but not the iPhone ether the chrome or safari fails to open the video any idea what might be wrong because i checked net and i came up with this solution : in ios the player loads but it does not shows the video with the below solution

<video class="video" playsinline autoplay muted loop>

i did this yet no luck . this is the link i am trying to play video on ios :

https://wishato.com/wish/wStvun