AdhamLap

AdhamLap

Member Since 9 Months Ago

Experience Points 6,320
Experience Level 2

3,680 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 52
Lessons
Completed
Best Reply Awards 1
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

12 Jun
5 days ago

AdhamLap left a reply on Logout Event Listener Return Null User Data

solved

problem because i use custom logout controller

AdhamLap started a new conversation Logout Event Listener Return Null User Data

hello,

i make listener on Logout for update user status in users table this my code.

provider

        'Illuminate\Auth\Events\Logout' => [
            'App\Listeners\LogSuccessfulLogout',
        ],

LogSuccessfulLogout


class LogSuccessfulLogout implements ShouldQueue
{
    protected $request;

    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    
    public function handle(Logout $event)
    { 
        dd($event); // return null

        $this->user->update([
            'status' => 0
        ]);
    }
}

how i can update user column while logout

08 Jun
1 week ago

AdhamLap left a reply on Validation With Required_if And Not_in Not Working

you use $errors->has('state')

check errors first after post request {{ $errors->all() }}

07 Jun
1 week ago

AdhamLap started a new conversation Give User Permission To Edit Category

hello

category table

model App\Category

id name 1 test1 2 test2

need give permission to user can edit, delete, create posts category 2

i use spatie/laravel-permission https://github.com/spatie/laravel-permission

31 May
2 weeks ago

AdhamLap started a new conversation How I Can Do Like It Use Vue

hi,

https://imgur.com/undefined

my json

var home = {
  name: 'POR',
  module: '4-4-2',
  team: [
    [
      {
        number: 1,
        name: 'Patricio',
      },
    ],
    [
      {
        number: 21,
        name: 'Soares',
      },
      {
        number: 3,
        name: 'Pepe',
      },
      {
        number: 6,
        name: 'Fonte',
      },
      {
        number: 5,
        name: 'Guerriero',
      },
    ],
    [
      {
        number: 14,
        name: 'Calvalho',
      },
      {
        number: 8,
        name: 'Mountinho',
      },
      {
        number: 11,
        name: 'Silva',
      },
      {
        number: 17,
        name: 'Guedes',
      },
    ],
    [
      {
        number: 16,
        name: 'Fernandes',
      },
      {
        number: 7,
        name: 'Cristiano Ronaldo',
      },
    ],
  ],
  home_team_events: [
    {
      id: 203,
      type_of_event: 'red-card',
      player: 'Silva',
      time: "3'",
    },
    {
      id: 210,
      type_of_event: 'yellow-card',
      player: 'Fernandes',
      time: "64'",
    },
    {
      id: 210,
      type_of_event: 'yellow-card',
      player: 'Fonte',
      time: "64'",
    },
    {
      id: 206,
      type_of_event: 'substitution-in',
      player: 'Fonte',
      time: "31'",
    },
  ],
};

var away = {
  name: 'SPA',
  module: '4-2-3-1',
  team: [
    [
      {
        number: 1,
        name: 'De Gea',
      },
    ],
    [
      {
        number: 18,
        name: 'Alba',
      },
      {
        number: 15,
        name: 'Ramos',
      },
      {
        number: 3,
        name: 'Pique',
      },
      {
        number: 4,
        name: 'Nacho',
      },
    ],
    [
      {
        number: 8,
        name: 'Koke',
      },
      {
        number: 5,
        name: 'Busquets',
      },
    ],
    [
      {
        number: 6,
        name: 'Iniesta',
      },
      {
        number: 22,
        name: 'Isco',
      },
      {
        number: 21,
        name: 'Silva',
      },
    ],
    [
      {
        number: 19,
        name: 'Costa',
      },
    ],
  ],
  away_team_events: [
    {
      id: 210,
      type_of_event: 'yellow-card',
      player: 'De Gea',
      time: "12'",
    },
    {
      id: 206,
      type_of_event: 'substitution-in',
      player: 'Iniesta',
      time: "31'",
    },
    {
      id: 206,
      type_of_event: 'substitution-in',
      player: 'Costa',
      time: "32'",
    },
    {
      id: 206,
      type_of_event: 'red-card',
      player: 'Silva',
      time: "31'",
    },
  ],
};
30 May
2 weeks ago

AdhamLap left a reply on Vue Component Is Not Displaying

do u have error in chrome console ?

AdhamLap left a reply on Use React Componentin In Vue

i no ask for change vue to react i need use react in vue .. it can?

AdhamLap left a reply on Vue Component Is Not Displaying

did u include compiled js file in footer add mix.js('resources/assets/js/app.js', 'public/js') in webpack.mix.js in footer add {{ asset('/js/app.js'); }}

then run npm run watch

AdhamLap left a reply on Vue Component Is Not Displaying

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>TheSaaS</title>

    <!-- Styles -->
    <link href="{{ asset('assets/css/core.min.css') }}" rel="stylesheet">
    <link href="{{ asset('assets/css/thesaas.min.css') }}" rel="stylesheet">
    <link href="{{ asset('assets/css/style.css') }}" rel="stylesheet">
    <script type="text/javascript" src="{{ asset('js/app.js') }}"></script>

    <!-- Favicons -->
    <link rel="apple-touch-icon" href="{{ asset('assets/img/apple-touch-icon.png') }}">
    <link rel="icon" href="{{ asset('assets/img/favicon.png') }}">

    <script>
        window.Laravel = <?php echo json_encode([
            'csrfToken' => csrf_token(),
        ]); ?>
    </script>

    <!--  Open Graph Tags -->
    <meta property="og:title" content="TheSaaS">
    <meta property="og:description" content="A responsive, professional, and multipurpose SaaS, Software, Startup and WebApp landing template powered by Bootstrap 4.">
    <meta property="og:image" content="http://thetheme.io/thesaas/assets/img/og-img.jpg">
    <meta property="og:url" content="http://thetheme.io/thesaas/">
    <meta name="twitter:card" content="summary_large_image">
</head>
<div id="app">
    <body>

    <!-- Topbar -->
    <nav class="topbar topbar-inverse topbar-expand-md topbar-sticky">
        <div class="container">

            <div class="topbar-left">
                <button class="topbar-toggler">&#9776;</button>
                <a class="topbar-brand" href="index.html">
                    <img class="logo-default" src="assets/img/logo.png" alt="logo">
                    <img class="logo-inverse" src="assets/img/logo-light.png" alt="logo">
                </a>
            </div>


            <div class="topbar-right">
                <ul class="topbar-nav nav">
                    <li class="nav-item"><a class="nav-link active" href="index.html">Home</a></li>
                    <li class="nav-item"><a class="nav-link" href="#" data-toggle="modal" data-target="#LoginModal">Login</a></li>
                </ul>
            </div>

        </div>
    </nav>
    <!-- END Topbar -->

    @yield('header')


    <!-- Main container -->

    <!--
    |‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒
    | Sample Landing Pages
    |‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒
    !-->


    <main class="main-content">

        @yield('content')

    </main>
    <!-- END Main container -->

    <!-- Footer -->
    <footer class="site-footer">
        <div class="container">
            <div class="row gap-y align-items-center">
                <div class="col-12 col-lg-3">
                    <p class="text-center text-lg-left">
                        <a href="index.html"><img src="assets/img/logo.png" alt="logo"></a>
                    </p>
                </div>

                <div class="col-12 col-lg-6">
                    <ul class="nav nav-primary nav-hero">
                        <li class="nav-item">
                            <a class="nav-link" href="index.html">Home</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="blog.html">Blog</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="block-feature.html">Features</a>
                        </li>
                        <li class="nav-item hidden-sm-down">
                            <a class="nav-link" href="page-pricing.html">Pricing</a>
                        </li>
                        <li class="nav-item hidden-sm-down">
                            <a class="nav-link" href="page-contact.html">Contact</a>
                        </li>
                    </ul>
                </div>

                <div class="col-12 col-lg-3">
                    <div class="social text-center text-lg-right">
                        <a class="social-facebook" href="https://www.facebook.com/thethemeio"><i class="fa fa-facebook"></i></a>
                        <a class="social-twitter" href="https://twitter.com/thethemeio"><i class="fa fa-twitter"></i></a>
                        <a class="social-instagram" href="https://www.instagram.com/thethemeio/"><i class="fa fa-instagram"></i></a>
                        <a class="social-dribbble" href="https://dribbble.com/thethemeio"><i class="fa fa-dribbble"></i></a>
                    </div>
                </div>
            </div>
        </div>
    </footer>
    <!-- END Footer -->


    <vue-login></vue-login>
</div>
    <!-- Scripts -->
    <script src="{{ asset('assets/js/core.min.js') }}"></script>
    <script src="{{ asset('assets/js/thesaas.min.js') }}"></script>
    <script src="{{ asset('assets/js/script.js') }}"></script>



    </body>

</html>

try this

AdhamLap started a new conversation Use React Componentin Vue

hello,

anyway to use react in vue

i want use this repo in vue https://github.com/gaetanozappi/react-native-football-lineup

any help ..

thanks

28 Apr
1 month ago

AdhamLap left a reply on Redirect Back With Locale

@BOBBYBOUWMANN - in controller i test your code like this echo $path = \Route::getCurrentRoute()->getPath();

give this error

Method Illuminate\Routing\Route::getPath does not exist.

i try import use Illuminate\Support\Facades\Route;

and controller echo $path = Route::getCurrentRoute()->getPath();

same error

AdhamLap left a reply on Redirect Back With Locale

no i no use any package i work on session and database

my problem when switch language from url http://test.app/es/page/{id}

to http://test.app/en/page/{id} language change and every thing work fine except page url not change from es to en, i use this code for switch language

public function change($lang)
    {
        Session()->put('locale', $lang);
        
        return redirect()->back();
    }

my question anyway to change locale in url after redirect back

thank you

27 Apr
1 month ago

AdhamLap started a new conversation Redirect Back With Locale

hello

When the link is so http://test.app/es/page and user change locale to en

need redirect back to http://test.app/en/page

how i can do it

thanks

10 Apr
2 months ago

AdhamLap started a new conversation Collection Help

hello,

how i can do it in laravel

[1,2,3,4,5,6,7,8,9,10,11,12,13,14]

<b>1</b>
<b>2</b>
<b>3</b>
<b>4</b>
<b>5</b>
6
7
8
9
10
11
<b>12</b>
<b>13</b>
<b>14</b>

what the collection or helper i use to do it

thanks

30 Mar
2 months ago

AdhamLap left a reply on Query Help

yes is more faster in codeigniter table have +1350000 row i try change from innodb to myisam and still slow in laravel

29 Mar
2 months ago

AdhamLap left a reply on Query Help

in codeigniter 7 - 9 second is same query i not change anything

$sql = "select teams.name, season_teams.team_id, playl + playv as play,
        (IFNULL(home.won, 0) + IFNULL(vistor.won, 0)) as `won`,
        (IFNULL(home.lost, 0) + IFNULL(vistor.lost, 0)) as `lost`,
        (IFNULL(home.void, 0) + IFNULL(vistor.void, 0)) as `void`,
        (IFNULL(home.goals, 0) + IFNULL(vistor.goals, 0)) as `goals`,
        (IFNULL(home.goalsin, 0) + IFNULL(vistor.goalsin, 0)) as `goalsin`,
        (IFNULL(home.goals, 0) + IFNULL(vistor.goals, 0)) - 
        (IFNULL(home.goalsin, 0) + IFNULL(vistor.goalsin, 0)) as `goalsF`,
        (IFNULL(home.void, 0) + IFNULL(vistor.void, 0)) + 
        (IFNULL(home.won, 0) + IFNULL(vistor.won, 0)) * 3 as `point`
    
        FROM season_teams
        LEFT JOIN(
        SELECT
        localteam_id, time,
        count(localteam_id) as playl,
        SUM(if(localteam_score > visitorteam_score, 1, 0)) as won,
        SUM(if(localteam_score < visitorteam_score, 1, 0)) as lost,
        SUM(if(localteam_score = visitorteam_score, 1, 0)) as void,
        SUM(localteam_score) as goals,
        SUM(visitorteam_score) as goalsin,
        season_id,visitorteam_id, localteam_score, visitorteam_score FROM results
        where `season_id` = {$season_id} 
        GROUP by results.localteam_id
        ) as home on home.localteam_id = season_teams.team_id
        LEFT JOIN(
        SELECT
        localteam_id, time,
        count(localteam_id) as playv,
        SUM(if(localteam_score < visitorteam_score, 1, 0)) as won,
        SUM(if(localteam_score > visitorteam_score, 1, 0)) as lost,
        SUM(if(localteam_score = visitorteam_score, 1, 0)) as void,
        SUM(visitorteam_score) as goals,
        SUM(localteam_score) as goalsin,
        season_id,visitorteam_id, localteam_score, visitorteam_score from results
        where `season_id` = {$season_id}  
        GROUP by results.visitorteam_id
        ) as vistor on vistor.visitorteam_id = season_teams.team_id
        LEFT JOIN teams ON teams.id = season_teams.team_id
        where season_teams.season_id = {$season_id} 
        ORDER BY point DESC, won DESC, void DESC, goals DESC";


        $sth = DB::getPdo()->prepare($sql);
        $sth->execute();
        $quy = $sth->fetchAll(\PDO::FETCH_OBJ);

AdhamLap left a reply on Query Help

@JLRDW - i use getPdo()

but now i have problem query take + 60 second

log

/* Connection to localhost closed at 2019-03-29 12:56:11 */
/* Affected rows: 0  Found rows: 18  Warnings: 0  Duration for 1 query: 00:04:38 */
28 Mar
2 months ago

AdhamLap started a new conversation Query Help

hello,

i try change my codeigniter app to laravel and i have this problem in query

i use this query in codeigniter and work fine with me when i try use in laravel not work

`` $date = date('Y-m-d'); $this->db->select(" season_match.team_id, (IFNULL(hometeam.play, 0) + IFNULL(vistor.play, 0)) as play, (IFNULL(hometeam.goalDiff, 0) + IFNULL(vistor.goalDiff, 0)) as goalDiff, (IFNULL(hometeam.won, 0) + IFNULL(vistor.won, 0)) as won, (IFNULL(hometeam.lost, 0) + IFNULL(vistor.lost, 0)) as lost, (IFNULL(hometeam.void, 0) + IFNULL(vistor.void, 0)) as void, (IFNULL(hometeam.goals, 0) + IFNULL(vistor.goals, 0)) as goals, (IFNULL(hometeam.goalsin, 0) + IFNULL(vistor.goalsin, 0)) as goalsin, (IFNULL(hometeam.void, 0) + IFNULL(vistor.void, 0)) + (IFNULL(hometeam.won, 0) + IFNULL(vistor.won, 0)) * 3 as point

                FROM season_match
                LEFT JOIN(
                SELECT
                hometeam, startTimeUtc,
                count(*) as play,
                SUM(if(homegoal > awaygoal, 1, 0)) as won,
                SUM(if(homegoal < awaygoal, 1, 0)) as lost,
                SUM(if(homegoal = awaygoal, 1, 0)) as void,
                SUM(homegoal) as goals,
                SUM(awaygoal) as goalsin,
                SUM(homegoal) - SUM(awaygoal) AS goalDiff,
                season,awayteam, homegoal, awaygoal FROM matchs
                where `season` = $season  
                and `startTimeUtc` < '$endtime'
                
                GROUP by matchs.hometeam
                ) as hometeam on hometeam.hometeam = season_match.team_id
                LEFT JOIN(
                SELECT
                hometeam, startTimeUtc,
                count(*) as play,
                SUM(if(homegoal < awaygoal, 1, 0)) as won,
                SUM(if(homegoal > awaygoal, 1, 0)) as lost,
                SUM(if(homegoal = awaygoal, 1, 0)) as void,
                SUM(awaygoal) as goals,
                SUM(homegoal) as goalsin,
                SUM(awaygoal) - SUM(homegoal) AS goalDiff,
                season,awayteam, homegoal, awaygoal from matchs
                where `season` = $season 
                and `startTimeUtc` < '$endtime'
                
                GROUP by matchs.awayteam
                ) as vistor on vistor.awayteam = season_match.team_id")
            ->order_by('point', 'DESC')
                // ->order_by('allgoals', 'DESC')
            ->order_by('won', 'DESC')
            // ->order_by('void', 'DESC')
            // ->order_by('lost', 'DESC')
            
            ->order_by('goalDiff', 'DESC')
            ->order_by('goals', 'DESC')
            // ->order_by('play', 'DESC')
            ->join('teams', 'teams.id = season_match.team_id', 'left')
            ->where('season_match.season_id', $season);
            $team_data = $this->db->get();
            $data['table'] = $team_data->result();

``

how i can use this query in laravel

thanks

13 Sep
9 months ago

AdhamLap left a reply on Laravel-Vue Route URL

Route::put('projects', '[email protected]');

30 Aug
9 months ago

AdhamLap left a reply on Db Query To Relationship

any help

29 Aug
9 months ago

AdhamLap left a reply on Set Lang

composer require akaunting/language

more info visit https://github.com/akaunting/language

AdhamLap started a new conversation What Is Wrong In This Code

it is first time i use vue

<template>
    <div>
        <h2>Test</h2>
        <div v-for="season in seasons" v-bind:key="season.id">
            {{ season.id }} - {{ season.homeName }} - {{ season.awayName }} - {{ season.awaygoal }} / {{ season.homegoal }} 
            <br>
        </div>
    </div>
</template>


<script type="text/javascript">

export default {
    data: function() {
        return {
            seasons: [],
            season:{
                id: '',
                hometeam: '',
                awayteam: '',
                awaygoal: '',
                homegoal: '',


            },
            season_id: '',
        };
    },
    watch: { 
        seasons: function() {
            this.getCorn()
        }      },
        mounted: function() { 
            this.getVueItems(); 
        },
        methods: {
            getVueItems: function() {
                var id = window.location.href.split('/').pop();

                axios.get('/api/v1/season/'+id)
                .then(response => {
                    this.seasons = response.data.season;

                });  
            },
            getCorn: _.debounce(
                function() {
                    var id = window.location.href.split('/').pop();
                    var vm = this
                    axios.get('/api/v1/season/'+id, 
                    { 
                        seasons: this.seasons,
                    }).then(response => {
                        vm.seasons = response.data.season; 
                    })    
                }, 2000
                )  
        },    
    }

</script>
27 Aug
9 months ago

AdhamLap left a reply on Db Query To Relationship

query to get many rows from table matches

AdhamLap left a reply on Db Query To Relationship

i try this way

controller

        $countrys = Country::where('id', $id)->get();

        foreach($countrys as $country) 
        {
            var_dump($country->awayteam);
            var_dump($country->hometeam);
        }
        die();

model

    public function awayteam()
    {
        return $this->hasMany('App\WorldCup', 'awayteam');
    }

    public function hometeam()
    {
        return $this->hasMany('App\WorldCup', 'hometeam');
    }

i no need use 2 function for relation i need get all result in one array and one function

AdhamLap started a new conversation Db Query To Relationship

my query

$data = DB::table('countries') ->leftJoin('matches', function ($join) { $join->on('matches.hometeam', '=', 'countries.id') ->orOn('matches.awayteam', '=' ,'countries.id'); }) ->where('countries.id', $id)->get();

    return dd($data);

how i can get same results use relationship