Skip to main content

Posts

Showing posts from January, 2022

Using Larave Api Resource , Adding Additional data to Response

  Github repository for more styled code    https://github.com/MohamedFathiM/Blogs/blob/main/apiResource.md What is the API Resource : A transformation layer that sits between your Eloquent models and the JSON responses. First Time Using It: The first time I am using the API resource, I was confused about the difference between the two classes, you will find it in the API resource of laravel (Resource, Collection), Ex: PostReource and PostCollection. Larave Api Resource has two classes you can simply make them using artisan like that. php artisan make :resource PostResource This command create a class in App\Http\Resources extends JsonResource php artisan make:resource PostCollection --collection or php artisan make :resource PostCollection name of the class with suffix collection this command create a class in App\Http\Resources extends ResourceCollection so, what is the difference between them? Resource Class Collection Class extends JsonResource ext
  Who am i ?  Contact Us : Name : Mohamed Fathi  Email : mohamedkdr66@gmail.com About Me : Graduation: I've graduated from Faculty of Specific Education, Department of Computer Teacher Preparation,I choosed field of web development . I was training with courses from the Internet and courses from Udemy website (MOOC). I developed many websites, including an educational website for students of the first  and second grades of high school. Training : After graduation I joined the course for educating one million arab programmers . I finished it in just twice weeks , I got the certificate from the Emirates Scholarship and the educational website Udacity. I also joined at the Information Technology Institute, which is known for its strength in Technology fields. I graduated from the institute in 2019. Certifications: - One million Arab programmers certificate from Udacity and the Emirates Scholarship . - Certificate from ITI Institute (open source track). Tech Skills : Languages : PH