monaabdo88

monaabdo88

Member Since 10 Months Ago

Experience Points
450
Total
Experience

4,550 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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
450 XP
Nov
05
1 month ago
Activity icon

Started a new Conversation How To Get Category Children In Vuejs Tree

I am working in laravel project and use vuejs library. in categories section in create form component I added vuejs-tree to to display all added categories the problem is all categories display as main category even the category which has parent category display in jstree as a main category this my code Category Department: <VJstree :data="cats" show-checkbox allow-batch whole-row @item-click="itemClick">

export default { data(){ return { Categories:[], cats: [], id:'', parent_id:'',
    }
},
methods:{
    itemClick (node) {
        this.parent_id = node.model.id;
    },
    getCats(){
        axios.get('/dashboard/getCats').then(response=>{
            this.cats = response.data;
        });
    },
    getCategories(){
        let url = '/dashboard/getCategories';
        axios.get(url).then(res=>{
            this.Categories = res.data;
            if(this.Categories){
                $('.dataTables_empty').hide();
            }
        })
    }

},
mounted() {
    this.getCategories();
    this.getCats();
}

}

load cats function in categories controller function load_cats(){ $cats = Category::selectRaw('name as text') ->selectRaw('id as id') ->selectRaw('parent_id as parent')->get(['text','id','parent']); $deps = []; foreach ($cats as $cat){ $list_arr = []; $list_arr['icon'] = ''; $list_arr['li_attr'] = ''; $list_arr['a_attr'] = ''; $list_arr['children'] =''; if($cat->id){ $list_arr['state'] = [ 'opened' => false, 'selected' => false, 'disabled' => true, 'hidden' => true, ]; } $list_arr['id'] = $cat->id; $list_arr['parent'] = $cat->parent == null ? '#' : $cat->parent; $list_arr['text'] = $cat->text; array_push($deps,$list_arr); } return json_encode($deps,JSON_UNESCAPED_UNICODE); }

Oct
25
1 month ago
Oct
24
1 month ago
Activity icon

Started a new Conversation No Query Results For Model App/Models/Country Delete_all

I am working on project useing laravel and vuejs the problem is that I am trying to select multi rows and delete them the error is No query results for model [App\Models\Country] delete_all my route link

Route::delete('/delete_all','[email protected]');

delete function in the country controller

public function deleteAll(Request $request){ $ids = $request->ids; DB::table("countries")->whereIn('id',explode(",",$ids))->delete(); return response()->json('Selected Countries Deleted Successfully',200); } the delete method in the component

delAll(){ axios.delete('/dashboard/countries/delete_all', { ids: this.selected }).then(response => { toastr.success(response.data); }) } where can I find the Error

Oct
18
1 month ago
Activity icon

Replied to Json Return Array How To Insert To Database

Thank you its working now

Activity icon

Replied to Json Return Array How To Insert To Database

return message "json_decode() expects parameter 1 to be string, array given"

Activity icon

Started a new Conversation Json Return Array How To Insert To Database

My Code return Json array I want to know how to use this array to update the data to the table in database this is the array

[{"id":1,"slug":"Site Name","namesetting":"site_name","value":"Fashion Store22","type":"0","created_at":null,"updated_at":null},{"id":2,"slug":"Site Email","namesetting":"site_email","value":"[email protected]","type":"0","created_at":null,"updated_at":null},{"id":3,"slug":"Site Decription","namesetting":"site_desc","value":"Test Description","type":"1","created_at":null,"updated_at":null},{"id":4,"slug":"Site Tags","namesetting":"site_tags","value":"tags","type":"1","created_at":null,"updated_at":null},{"id":5,"slug":"Site Address","namesetting":"site_address","value":"Site Address","type":"0","created_at":null,"updated_at":null},{"id":6,"slug":"Site Phone","namesetting":"site_phone","value":"002045454454","type":"0","created_at":null,"updated_at":null},{"id":7,"slug":"Site Status","namesetting":"site_status","value":"1","type":"2","created_at":null,"updated_at":null},{"id":8,"slug":"Site Text Close","namesetting":"site_text_close","value":"Sorry We are under","type":"1","created_at":null,"updated_at":null}]

Oct
17
1 month ago
Activity icon

Replied to Array To String Conversion Laravel 5.8

Still the same error appear

Activity icon

Started a new Conversation Array To String Conversion Laravel 5.8

I am trying to update my site settings table fields by using Laravel 5.8 and axios

but in call update message in Vue file I receive this error in my console Array to string conversion

Settings Controller

public function updateSettings(Request $request,Setting $setting){ $siteSettings = $request->siteSettings; foreach($siteSettings as $key => $req){ $siteSettingUpdate = $setting->where('namesetting' , $key)->get()[0]; $siteSettingUpdate->fill(['value' => $req])->save(); } return response()->json($siteSettings); //return response()->json(['Changed Had Saved Successfully'],200); }

settings vue

Update Site Settings

{{site.slug}} {{site.value}} Open Close {{ loading ? 'Saving Please Wait ....' : 'Save Changes' }} export default { data(){ return{ siteSettings:[], loading : false, csrf: document.querySelector('meta[name="csrf-token"]').getAttribute('content') } }, methods:{ getSettings(){ let uri = "/dashboard/getSettings"; axios.get(uri) .then(response =>{ this.siteSettings = response.data; }) }, updateSettings(){ let url ='/dashboard/updateSettings'; this.loading = true; axios.post(url,{siteSettings:this.siteSettings}).then(response =>{ toastr.success(); }).catch(err => { this.loading = false; toastr.error(); }) } }, mounted: function mounted() { this.getSettings(); } }
Oct
12
2 months ago
Activity icon

Started a new Conversation After Login Via Laravel & Vuejs Response Return Error Unauthenticated

I am working in project useing laravel 5.8 include multi auth for users and admins. users and admins are in different tables I am using vue in login process the problem in my project that after login response return error message Unauthenticated AdminLogincontroller

public function doLogin(Request $request){ $this->validate($request, [ 'email' => 'required|email', 'password' => 'required|min:6' ]); if(Auth::guard('admin')->attempt(['email'=> $request->email,'password'=>$request->password],true)){ //return response()->json(['name'=>Auth::guard('admin')->user()->name],200); return redirect()->intended('/dashboard/index'); }else{ return response()->json(['error'=> 'Wrong Email Or Password Please Try Again'],422); } }

login vue component

Sign In
        <div class="wrap-input100 validate-input m-b-20" :class="" data-validate="Enter your Email">
            <input class="input100" type="email" v-model="email" name="email" placeholder="Enter your Email">
            <span class="focus-input100"></span>
        </div>

        <div class="wrap-input100 validate-input m-b-25" data-validate = "Enter password">
            <input class="input100" type="password" v-model="password" name="pass" placeholder="password">
            <span class="focus-input100"></span>
        </div>

        <div class="container-login100-form-btn">
            <button class="login100-form-btn" @click="login" :disabled="!validEmailAndPassword">
                {{ loading ? 'Loading Please Wait ....' : 'Sign In' }}

            </button>
        </div>

        <div class="text-center">
            <br>
            <a href="#" class="txt2 hov1">
                Forget Password
            </a>
        </div>
    </form>
</div>

this is code login via vue

import axios from 'axios'; export default { data(){ return{ email : '', password : '', loading : false, errors:[],
    }
},
methods:{
    checkEmailVail(){
        if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(this.email))
        {
            return true;
        }else{
            return false;
        }
    },
    login(){
        this.loading = true;
        this.errors = [];
            axios.post('/dashboard/cpLogin',{
                email:this.email,
                password:this.password
            }).then(res => {
                toastr.success('Welcome Back '+res.data.name);
                setTimeout(function () {
                    window.location.href = '/dashboard/index'; }, 2000)

            })
                .catch(err =>{
                    this.loading = false;
                    toastr.error(err.response.data.error);
                })
        }

},
computed:{
    validEmailAndPassword(){
        return this.checkEmailVail()&&this.password&&!this.loading;
    },

}

}

Oct
10
2 months ago
Activity icon

Replied to Admin Middleware Not Working

public function login(Request $request){ $this->validate($request, [ 'email' => 'required|email', 'password' => 'required|min:6' ]); if(Auth::guard('admin')->attempt(['email'=> $request->email,'password'=>$request->password],true)){ return response()->json(['name'=>Auth::guard('admin')->user()->name],200); }else{ return response()->json(['error'=> 'Wrong Email Or Password Please Try Again'],422); } }

Activity icon

Replied to Admin Middleware Not Working

auth file return [

'defaults' => [
    'guard' => 'web',
    'passwords' => 'users',
],


'guards' => [
    'web' => [
        'driver' => 'session',
        'provider' => 'users',
    ],
    'admin' => [
        'driver' => 'session',
        'provider' => 'admins',
    ],
    'api' => [
        'driver' => 'token',
        'provider' => 'users',
        'hash' => false,
    ],
],



'providers' => [
    'users' => [
        'driver' => 'eloquent',
        'model' => App\Models\User::class,
    ],
    'admins' => [
        'driver' => 'eloquent',
        'model' => App\Models\Admin::class,
    ],
    // 'users' => [
    //     'driver' => 'database',
    //     'table' => 'users',
    // ],
],



'passwords' => [
    'users' => [
        'provider' => 'users',
        'table' => 'password_resets',
        'expire' => 60,
    ],
    'admins' => [
        'provider' => 'admins',
        'table' => 'password_resets',
        'expire' => 60,
    ],
],

];

Activity icon

Replied to Admin Middleware Not Working

Admin middleware public function handle($request, Closure $next) { if (Auth::check() && Auth::guard('admin')->check()) { return redirect('/dashboard/index'); } return $next($request); }

Activity icon

Replied to Admin Middleware Not Working

Dashboard Routes file Route::prefix('dashboard')->name('dashboard.')->group(function (){ Route::get('/AdminLogin','[email protected]')->name('login'); Route::post('/cpLogin','[email protected]')->name('cpLogin'); Route::get('/cpLogout','[email protected]')->name('cpLogout'); Route::group(['middleware'=>['admin']],function (){ Route::get('/index','[email protected]')->name('index'); }); });

Activity icon

Started a new Conversation Admin Middleware Not Working

Hello There I am working in project include multi auth for users and admin each users and admin in different tables I am using vue in login process the problem in my project that I can log to the dashboard without login and can not get the admin information after login this is my code for login component + admin middleware + dashboard route + logincontroller for admin + kernal file + auth file in config folder Dashboard routes file