Add office photos
Employer?
Claim Account for FREE

WebReinvent Technologies

2.6
based on 22 Reviews
Filter interviews by

CoEnterprise Interview Questions and Answers

Updated 17 Jun 2024

Q1. What is international format to store dates in PHP? How to access it?

Ans.

The international format to store dates in PHP is 'Y-m-d H:i:s'. It can be accessed using the date() function.

  • Use 'Y-m-d H:i:s' format to store dates in PHP

  • Access it using the date() function in PHP

Add your answer

Q2. What is difference between jobs and batch?

Ans.

Jobs are individual tasks that are executed independently, while batches are groups of tasks executed together.

  • Jobs are typically smaller in scope and run independently, while batches involve multiple tasks grouped together.

  • Jobs can be queued and processed asynchronously, while batches are usually executed synchronously.

  • Examples of jobs include sending an email, processing an image, or updating a database record. Examples of batches include importing a CSV file, running a ser...read more

Add your answer

Q3. What is polymorphic relationship?

Ans.

Polymorphic relationship is a type of relationship in which a model can belong to multiple other models on a single association.

  • Allows a model to belong to multiple other models on a single association

  • Uses a single column in the database to store the type of the related model

  • Commonly used in scenarios where a model can belong to multiple other models such as comments, likes, or tags

Add your answer

Q4. What is trait used for?

Ans.

Traits are used in PHP to group functionality in a fine-grained and reusable way.

  • Traits allow you to reuse methods in multiple classes without inheritance limitations.

  • They provide a way to compose classes that is more flexible than single inheritance.

  • Traits can be used to share methods among classes that are unrelated in terms of inheritance.

  • An example of using traits in Laravel is the 'SoftDeletes' trait which adds soft deletion capabilities to models.

Add your answer
Discover CoEnterprise interview dos and don'ts from real experiences

Q5. What are the observers.

Ans.

Observers in Laravel are classes that listen for specific model events and trigger actions based on those events.

  • Observers are used to decouple event listeners from models.

  • They can listen for various model events like creating, updating, deleting, etc.

  • Observers are defined by creating a class that extends the Eloquent model observer class.

  • Example: Creating a UserObserver class to send an email notification when a new user is created.

Add your answer

Q6. What are accessor and mutator

Ans.

Accessors and mutators are methods used in Laravel Eloquent models to manipulate attribute values before retrieving or saving them.

  • Accessors are used to modify attribute values when retrieving them from the database

  • Mutators are used to modify attribute values before saving them to the database

  • Accessors and mutators are defined as methods in the Eloquent model class

  • Example: public function getFullNameAttribute() { return $this->first_name . ' ' . $this->last_name; }

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter