patrickadvance

patrickadvance

Member Since 5 Months Ago

Abuja

CEO at PatriXsmarT Global Ltd.

Experience Points 152,500
Experience Level 31

2,500 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 1496
Lessons
Completed
Best Reply Awards 4
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.

22 May
1 month ago
16 May
1 month ago

patrickadvance left a reply on What Front End Framework Is Use In Laracasts ?

Download buidthwith chrome extension to view the technologies used by a website.

12 May
1 month ago

patrickadvance left a reply on Where Can I Modify The Email Verification?

@chron Do well to mark the answer as best answer, Thanks.

11 May
1 month ago

patrickadvance left a reply on Where Can I Modify The Email Verification?

check this also, but it's not advisable to change any code cause you will loose it when you update your framework

project-root\vendor\laravel\framework\src\Illuminate\Foundation\Auth\VerifiesEmails.php

patrickadvance left a reply on Where Can I Modify The Email Verification?

This is were the controller is located

project-root\app\Http\Controllers\Auth\VerificationController.php

from here you can do what you like.

patrickadvance left a reply on The Data Of Components Isn't Showing In Browser

Add this to your devDependences in package.json file of your project

"vue": "^2.6.10",
 "vue-template-compiler": "^2.6.10"

Run the following command

npm run dev
//and
npm run watch

Then add .default after every require like so and save

let routes = [
     { path: '/dashboard', component: require('./components/Dashboard.vue').default },
     { path: '/users', component: require('./components/Users.vue').default },
     { path: '/profile', component: require('./components/Profile.vue').default }
   ]

Now it will work perfectly after these steps.

09 May
1 month ago

patrickadvance left a reply on Need Help With An Axios Problem

Then recompile the script using npm run dev or npm run watch

patrickadvance left a reply on Need Help With An Axios Problem

Use This

import axios from 'axios'


export default {
  name: 'PageIndex',
  data () {
    return {
        contacts: [],
      
    }
  },
  methods: {
    loadLeads() {

                 console.log('loadLeads started');

            axios.get("/getleads")
            .then( response => {
                    console.log(response)
                })
            .catch(error => {
                    console.log(error)
                });

            console.log('loadLeads ended');
    },
05 May
1 month ago

patrickadvance left a reply on New To Forum

You are welcome to the community

27 Apr
1 month ago

patrickadvance left a reply on Querying Relationship Existence

You can't do this

$sub_jobs = $sub_jobs::has('dispatches')->get(); // Wrong

cause $sub_jobs is not a model in your app

patrickadvance left a reply on If Condition Blade View

cause in your condition statement you use a string not a numbr, try this

@foreach($kamar as $room)
@if ($room->status == '2')
<div class="col-sm-3">
<div class="small-box bg-yellow">
<div class="inner">
<h3>{{$room->nomor_kamar}}</h3>
<p>{{$room->typekamar->nama}}</p>
</div>
<div class="icon">
<i class="fa fa-bed"></i>
</div>
<a class="small-box-footer" href="" action="">Bersihkan</a>
</div>
</div>

@else
<div class="alert alert-warning">
<h4>Mohon Maaf</h4>
Untuk sementara, tidak ada kamar yang sedang kotor.
</div>
@endif
@endforeach

//Or this

@foreach($kamar as $room)
@if ($room->status === 2)
<div class="col-sm-3">
<div class="small-box bg-yellow">
<div class="inner">
<h3>{{$room->nomor_kamar}}</h3>
<p>{{$room->typekamar->nama}}</p>
</div>
<div class="icon">
<i class="fa fa-bed"></i>
</div>
<a class="small-box-footer" href="" action="">Bersihkan</a>
</div>
</div>

@else
<div class="alert alert-warning">
<h4>Mohon Maaf</h4>
Untuk sementara, tidak ada kamar yang sedang kotor.
</div>
@endif
@endforeach

patrickadvance left a reply on What Convinced You Into Becoming A Full-Stack Developer

For me, I think is the joy and fulfillment i derive from writing codes that works.

patrickadvance started a new conversation What Convinced You Into Becoming A Full-Stack Developer

Please share your story so newbees can draw wisdom from it

patrickadvance left a reply on @error Direct With Or Condition

@error(['username','email'])

// Do something

@enderror
26 Apr
1 month ago

patrickadvance left a reply on I Want To Create Two Types User Panel For Two Types User.

@patrosmania just add a 'role' column in your users table. Then add a method called isUserAdmin() in your User model like so.


public function isUserAdmin($user){
    if($user->role=='admin'){
        return true;
    }
    
    return false;
}

patrickadvance left a reply on Sending String Parameter From Route To View

Do this

public function index($state = 'active')
{
    $users = User::where('state',$state)->get();

    return view('users.index', compact('users', 'state'));
}

24 Apr
2 months ago

patrickadvance left a reply on Saving Record " ErrorException (E_NOTICE) Array To String Conversion"

@ottaviane Alright, I'm happy I was able to help. You can also mark my answer as the best answer.

patrickadvance left a reply on My Homepage Is Working But Not Other Pages In Laravel?

Open your terminal in your project directory and run the command below

php artisan serve

and goto https://127.0.0.1:8000/ in your browser.

patrickadvance left a reply on Saving Record " ErrorException (E_NOTICE) Array To String Conversion"

This is the problem

 $id_tab=request(['id_tab']);
 $id_canto=$request['canti'];

You can rewrite it like so

 $id_tab=request('id_tab');
 $id_canto=$request('canti');

OR

 $id_tab=request->input('id_tab');
 $id_canto=$request->input('canti');

23 Apr
2 months ago

patrickadvance left a reply on About Frameworks

laravel is the best for all kinds of php based project, cause you are free to write your codes elegantly.

patrickadvance left a reply on How To Access Json Values To Check Conditionals

use a foreach in your controller

foreach($cars as $car){
    if($car->pieces < 3){

        //Do what you want with this variable $car->car_id,$car->pieces

    }elseif($car->pieces = 3){

        //Do what you want with this variable $car->car_id,$car->pieces
    }
}

remember to assign the JSON to a $cars variable

22 Apr
2 months ago

patrickadvance left a reply on How To Access Json Values To Check Conditionals

use a foreach

@foreach($cars as $car)
<div>
    $car->car_id

    $car->pieces
</div>
@endforeach

remember to assign the JSON to a $cars variable

patrickadvance left a reply on Laravel Migrate Error

php artisan migrate:fresh

will work the magic

patrickadvance left a reply on How To File Upload In Laravel Directly Into Storage Folder


<?php

namespace App\Http\Controllers\Api;

use App\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Storage;

class UserAvatarController extends Controller
{
    /**
     * Handle the incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function __invoke(Request $request)
    {
        
        $request->validate([
            'avatar'=> ['required','max:200'] 
        ]);

        $user = User::findOrFail(auth()->user()->id);

        // Handle file Upload
        if($request->hasFile('avatar')){
            Storage::delete('/public/avatars/'.$user->avatar);
            // Get filename with the extension
            $filenameWithExt = $request->file('avatar')->getClientOriginalName();
            //Get just filename
            $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
            // Get just ext
            $extension = $request->file('avatar')->getClientOriginalExtension();
            // Filename to store
            $fileNameToStore = $filename.'_'.time().'.'.$extension;
            // Upload Image
            $path = $request->file('avatar')->storeAs('public/avatars',$fileNameToStore);

       $user->avatar = $fileNameToStore ;

            $user->save(); 
        }

       
       
        
        return $user;
    }
}
21 Apr
2 months ago

patrickadvance left a reply on Laravel Can't Destroy Item

instead of this

Route::group(['prefix' => 'items', 'middleware' => ['auth']], function(){
   
    Route::get('/', '[email protected]')->name('items.index');
    Route::get('/create', '[email protected]')->name('items.create');
    Route::get('/{item}', '[email protected]')->name('items.show');
    Route::post('/', '[email protected]')->name('items.store'); 
       
    Route::get('/{item}/edit', '[email protected]')->name('items.edit');
    Route::delete('/{item}', '[email protected]')->name('items.destroy');
    Route::patch('/{item}', '[email protected]')->name('items.update');
});

use this

Route::resource('items','ItemController')

also make sure you use the Item model at the top like so

use App\Item

patrickadvance left a reply on How To Limit The Link Of Pagination To Be Displayed?

use this

{{ $users->onEachSide(5)->links() }}

patrickadvance left a reply on Laravel Can't Destroy Item

Pls post your codes so i can detect where the problem is from.

patrickadvance left a reply on How To Manually Do The OnEachSide() Function In Laravel 5.5 (this Does Exist In 5.7)

/** * Set the number of links to display on each side of current page link. * * @param int $count * @return $this */ public function onEachSide($count) { $this->onEachSide = $count;

    return $this;
}

patrickadvance left a reply on View Components Not Loading

I think when you add .default to every vue component like so

Vue.component('example-component', require('./components/ExampleComponent.vue').default);

it will work.

Goodluck.

patrickadvance left a reply on Skip Auth When Using Certain Route Prefixes

Yes it is, For any controller method you dont want to use auth middleware for just include it in the array in except helper. like so

$this->middleware('auth')->except(['shareTimelineDate','timelineDate']);

and it will all workout.

patrickadvance left a reply on Page Loads On My Machine But Return 500 Error Online

Go to your .env file and change the APP_DEBUG option to true so you see exactly what is wrong on the browser or you install laravel/telescope package in the app to help you debug Exceptions easily.

20 Apr
2 months ago

patrickadvance left a reply on Where Are You All From?

I currently live in Abuja,Nigeria.

patrickadvance left a reply on Base Table Or View Not Found

You are seeing this error because you didn't run this command below

php artisan migrate

After creating the migration for the Project Model.

14 Apr
2 months ago

patrickadvance left a reply on How To Get Array Count

$idCount = count($array);