Q:

how to generate custom primary id in laravel? 

I want to create custom primary id in database with increment like

Comp-001
Comp-002
Comp-003

and then increment 
Comp-00N

A:

You need to set public $incrementing = false; on your model so that it doesn't try to set the primary key to the next auto-incrementing ID value. 
Then you have create custom primary keys . 
class Company extends Model {

    protected $primaryKey = 'id';
    public $incrementing = false;  // You most probably want this too

}

then you can generate custom value for id
$lastCompanyId = Company::select('id')->orderBy('id','desc')->first();
$lastCompanyId=(int)substr($lastCompanyId , -3);
 static::created(function ($obj) {
          $obj->id= Company::'Comp-'.$lastCompanyId+1;
          $obj->save();
      });

A:

Because I believe you can set this simpler and from what you describe you only really need such solution for display, I decided to propose a solution for you:
Company Model
class Company extends Model
{
    ...

   public function getCompanyID()
   {
       return sprintf('Comp-%03d', $this->id);
   }
}

Your View
When handling the Company object, just call your method when you need to display it:
$company->getCompanyID();

Below are a few examples on how this will behave:
ID examples and respective outputs:
IDs             Outputs
 1              Comp-001 
 45             Comp-045 
 104            Comp-104
 1000           Comp-1000

This way you will respect:
-> Laravel natural flow;
-> You keep a true ID reference and a visual reference;
-> You do not require extra effort to make sure you find the right product (you kept the ID as integer);
Above is a simple and quick solution to your problem. 
Now I am not sure how you are structuring your code, but if it was my project I would even not change the Model and present either a Hydrator or a Marshaller to grab my object, create a similar representation with only the fields I required on the view and pass that instead. 
Why? 
-> My Model is a pure as possible with no parsing information (that really shouldn't be the Model responsability for OOP);  
-> I get a clear transformation between Back-end and front-end and I can easily change for different views without having to touch previous code (respectful of open and closure laws of OOP);

