esmaill23

esmaill23

backend developer at cinemamarket.ir

Member Since 1 Year Ago

tehran

Experience Points
1,430
Total
Experience

3,570 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
4
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 1
1,430 XP
Jan
01
5 months ago
Activity icon

Replied to Greater Than Or Equal Validation Rule Error :The Values Under Comparison Must Be Of The Same Type

thank you for your answer. my required rules are in first . the problem is that lte rule set on download_price field and owner_dl_price is null. so the download_price is not empty and greater than 0 but is not the same type with owner_dl_price

Activity icon

Started a new Conversation Greater Than Or Equal Validation Rule Error :The Values Under Comparison Must Be Of The Same Type

my validation rules are as follow:

public function rules()
    {
        return [
            'mid' => 'required|numeric|exists:movies,id',
            'agreement_id' => 'required|numeric|exists:agreements,id',
            'contract_id' => 'required|numeric|exists:contracts,id',
            'download_price' => 'required|numeric|gte:owner_dl_price',
            'owner_dl_price' => 'required|numeric',
            'seen_price' => 'required|numeric',
            'owner_seen_price' => 'required|numeric|lte:seen_price',
            'start_time' => ['required','date_format:Y/n/j',new emptyDuration($this), new inAgreementDuration($this)],
            'end_time' => ['required','date_format:Y/n/j','after_or_equal:start_time',new emptyDuration($this), new inAgreementDuration($this)]
        ];
    }

i get 500 error code when i send download_price null and the error message is :

InvalidArgumentException: The values under comparison must be of the same type

Activity icon

Replied to LARAVEL TRIGGER MIGRATION PROBLEM ON TEST ENVIRONMENT

i saw this page . but what can i do ? my main environment database is mysql and my test environment database is sqlite. this is problem.

Dec
31
5 months ago
Activity icon

Replied to LARAVEL TRIGGER MIGRATION PROBLEM ON TEST ENVIRONMENT

MY CODE WORK ON MYSQL BUT NOT WORK ON SQLITE

Activity icon

Started a new Conversation LARAVEL TRIGGER MIGRATION PROBLEM ON TEST ENVIRONMENT

hello i have created a laravel migration as like below. it works on migrate on mysql in product env but not work on sqlite in testing env . thank you :

public function up()
    {
        \Illuminate\Support\Facades\DB::unprepared('CREATE TRIGGER after_insert_price AFTER INSERT ON `movie_prices` FOR EACH ROW
            BEGIN
                IF((SELECT status from agreements where id = NEW.agreement_id) != 4 and (select sum(datediff(end_time,start_time)+1) from movie_prices where agreement_id = NEW.agreement_id) = (select datediff(end_time,start_time)+1 from agreements where id = NEW.agreement_id))
                THEN
                    UPDATE agreements SET status=2 where id = NEW.agreement_id;
                ELSEIF((SELECT status from agreements where id = NEW.agreement_id) != 4)
                THEN
                    UPDATE agreements SET status=3 where id = NEW.agreement_id;
                END IF;
            END');

        \Illuminate\Support\Facades\DB::unprepared('CREATE TRIGGER after_update_price AFTER UPDATE ON `movie_prices` FOR EACH ROW
            BEGIN
                IF((SELECT status from agreements where id = NEW.agreement_id) != 4 and (select sum(datediff(end_time,start_time)+1) from movie_prices where agreement_id = NEW.agreement_id) = (select datediff(end_time,start_time)+1 from agreements where id = NEW.agreement_id))
                THEN
                    UPDATE agreements SET status=2 where id = NEW.agreement_id;
                ELSEIF ((SELECT status from agreements where id = NEW.agreement_id) != 4)
                THEN
                    UPDATE agreements SET status=3 where id = NEW.agreement_id;
                END IF;
            END');

        \Illuminate\Support\Facades\DB::unprepared('CREATE TRIGGER after_delete_price AFTER DELETE ON `movie_prices` FOR EACH ROW
            BEGIN
                IF((SELECT status from agreements where id = OLD.agreement_id) != 4 AND (SELECT COUNT(*) FROM `movie_prices` WHERE agreement_id = OLD.agreement_id) = 0)
                THEN
                    UPDATE agreements SET status=1 where id = OLD.agreement_id;
                ELSEIF((SELECT status from agreements where id = OLD.agreement_id) != 4 and (select sum(datediff(end_time,start_time)+1) from movie_prices where agreement_id = OLD.agreement_id) = (select datediff(end_time,start_time)+1 from agreements where id = OLD.agreement_id))
                THEN
                    UPDATE agreements SET status=2 where id = OLD.agreement_id;
                ELSEIF ((SELECT status from agreements where id = OLD.agreement_id) != 4)
                THEN
                    UPDATE agreements SET status=3 where id = OLD.agreement_id;
                END IF;
            END');
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        \Illuminate\Support\Facades\DB::unprepared('DROP TRIGGER `after_insert_price`');
        \Illuminate\Support\Facades\DB::unprepared('DROP TRIGGER `after_update_price`');
        \Illuminate\Support\Facades\DB::unprepared('DROP TRIGGER `after_delete_price`');
    }

raise this error on migrate on test env

Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1 near "IF": syntax error (SQL: CREATE TRIGGER after_insert_price AFTER INSERT ON `movie_prices` FOR EACH ROW
            BEGIN
                IF((SELECT status from agreements where id = NEW.agreement_id) != 4 and (select sum(datediff(end_time,start_time)+1) from movie_prices where agreement_id = NEW.agreement_id) = (select datediff(end_time,start_time)+1 from agreements where id = NEW.agreement_id))
                THEN
                    UPDATE agreements SET status=2 where id = NEW.agreement_id;
                ELSEIF((SELECT status from agreements where id = NEW.agreement_id) != 4)
                THEN
                    UPDATE agreements SET status=3 where id = NEW.agreement_id;
                END IF;
            END)