Sohag Hasannotes.sohag.pro·Oct 31, 2024Demystifying PHP Traits: Your Comprehensive Guide to Code ReusabilityPHP Traits What are Traits in PHP? Imagine you're building a house, and instead of constructing everything from scratch, you could simply pick up pre-made modules and attach them wherever you need. In PHP, Traits are exactly like these modular buildi...Tips & Trickstraits
SOUMITRA-SAHAssblogs.hashnode.dev·May 28, 2024Generics and Traits in Rust: A Friendly GuideHey there! Today, let's dive into some of Rust's more advanced concepts: Generic Types and Traits. These might sound a bit intimidating at first, but I'll walk you through each step with practical examples. By the end of this, you'll be able to use t...Rust
Rahul Guptatherahul-gupta.hashnode.dev·May 17, 2024Laravel 11: New Artisan "make:trait" CommandIn the dynamic realm of web development, every tool that enhances efficiency is a treasure. Laravel, the PHP framework known for its developer-friendly features, continues to innovate with each iteration. With the unveiling of Laravel 11, developers ...New Artisan "make:trait" Command
Raineraineyang.hashnode.dev·Dec 14, 2023Rust Learning Note: Generics and TraitsThis blog is a summay of Chapter 2.8 of Rust Course (course.rs) Generics Generics can be used in structs, enumerators, and methods, as shown in the example below: 1 Using generics in structs: struct Point<T> { x: T, y: T } fn main() { le...trait object
emmitt luhningemmitt.hashnode.dev·Jul 22, 2023Building a Rust Dictionary ProgramWhy Rust? I've casually had my eye on Rust for quite a bit now. A couple of years ago I joined a hackathon leveraging some Web3 technologies at the height of the crypto hype, and learned about smart contracts. At the time, the chain we were building ...66 readsRust
David Carrdcblogdev.hashnode.dev·Nov 5, 2022Laravel use multiple boot in traitsLet's say you want to use multiple traits in your models to reuse common code such as applying UUIDs and settings global query scopes like this: use HasUuid; use HasTenant; Each of these traits has a boot method: HasUuid: trait HasUuid { public f...77 readstraits