Posts

Since 2024
Create a DateTime from a Timestamp With this New Method Coming to PHP 8.4
Create a DateTime from a Timestamp With this New Method Coming to PHP 8.4

Creating a DateTime from a Unix timestamp will be more convenient in PHP 8.4 with the new createFromTimestamp() method. It will support both a typical Unix timestamp as well as timestamps containing microseconds: $dt = DateTimeImmutable::createFromTimestamp(1718337072); $dt->format('Y-m-d'); // 2024-06-14 $dt = DateTimeImmutable::createFromTimestamp(1718337072.432); $dt->format('Y-m-d h:i:s.u'); // 2024-06-14 03:51:12.432000 With PHP 8.3 and below, you need to use the createFromFormat() method to convert a timestamp into a DateTime or DateTimeImmutable instance. As you can see below, it's not too complicated, but it'll be nice to have a new method to take care of both cases below: $dt = DateTimeImmutable::createFromFormat('U', (string) 1718337072); // DateTimeImmutable @1718337072 {#7948 // date: 2024-06-14 03:51:12.0 +00:00, // } $dt = DateTimeImmutable::createFromFormat('U.u', (string) 1718337072.432); // DateTimeImmutable @1718337072 {#7950 // date: 2024-06-14 03:51:12.432 +00:00, // } For those using the Carbon PHP library, it already has a createFromTimestamp() method available! It is encouraging that PHP is getting this new method at the language level as well! Carbon\Carbon::createFromTimestamp(1718337072.432); // Carbon\Carbon @1718337072 {#7981 // date: 2024-06-14 03:51:12.432 UTC (+00:00), // } Carbon\CarbonImmutable::createFromTimestamp(1718337072); // Carbon\CarbonImmutable @1718337072 {#7999 // date: 2024-06-14 03:51:12.0 UTC (+00:00), // } The post Create a DateTime from a Timestamp With this New Method Coming to PHP 8.4 appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

Backpack turns 8 years old, celebrates with 40% discount
Backpack turns 8 years old, celebrates with 40% discount

Time sure flies by! Backpack for Laravel has been around for so many years now, everybody in the team is getting a bit nostalgic. To celebrate our anniversary: we've told the story of our 8 year-history of building Laravel admin panels; we've tracked down 40+ Laravel admin panels, to create a comprehensive article about Laravel admin panel libraries and learn from them (contact us if you've launched one); we're doing a HUGE discount campaign, to celebrate; Read on to find out what Backpack is, what makes it different and what discounts you can use right now: About Backpack Admin Panels Never heard of Backpack? Boy, do we have news for you! Let me give you the TLDR: Backpack CRUD (our free & open-source core) includes all the basics an admin panel needs - authentication, 300+ HTML components and basic CRUDs. You can then build your own custom features on top of it or purchase paid add-ons, that bring so much functionality it's difficult to list a few. But here goes: 25+ field types, Calendar operation, editable columns... the list goes on and on. What makes Backpack different? In short, Backpack is the best at KISS ("keep it simple, stupid"). It's a lesson we've learnt the hard way, and never compromise on. 8 years ago we had already built dozens of websites & apps for clients and one important thing we've learnt from our many mistakes: the simplest solution is usually the best. When we decided we needed an admin panel, we built one with KISS as the guiding principle (actually we built four, but who's counting). The point is, we followed that KISS guiding principle all the way to 2024 and that has proven to be an EXCELLENT decision, avoiding complete rewrites and making our lives a lot easier. KISS has manifested itself in what makes Backpack different technically. So here goes. As opposed to other Laravel admin panels: Backpack uses a minimalist stack. To use it, all you need to know is Laravel. To customize it, you might need to know some Bootstrap & Javascript for heavy customizations - but that's it. This makes it it incredibly easy to customize, super easy to onboard developers (from junior to senior) and a pleasure to come back in a few years to make a change. Backpack has an obsession on choosing long-term tech. Out of 40+ Laravel admin panels that have been launched over the past decade... 90% are now dead. Why? Because they've chosen this or that cool new tech. And it's either proven to be a bad choice or people have just gotten bored of it and moved to the next cool tech. Backpack has always tried to stay away from tech trends. We only adopt something when we know we'll enjoy using it 5 years from now. That's why we still use Bootstrap. Hell, that's why we still have bits that use jQuery in 2024 - because it's still a good long-term tech for that specific use case. Backpack offers all features you need, from one single vendor. It is very very difficult to build out all the features an admin panel might need. So difficult it took us almost 8 years to do it. To get around that, most admin panels build the core, then invite other devs to build 3rd party add-ons. But that's a trap! In most cases, your project ends up with dozens of dependencies, on dozens of developers, of dozens degrees of quality. By contrast, Backpack offers everything you need, from one vendor with a proven track record - Backpack. We have 3rd party add-ons too... but they're usually small and niche, very few projects need them. Backpack truly helps with everything you might need - not just code, but also HTML components, wireframing, design, code generation, support and outsourcing. A lot of times, building an admin panel becomes way more than "coding an admin panel". We know, because we've built e-commerce, ERPs, social networks and more on Backpack, so we know how complex it can get: That's why we offer 300+ HTML components out-of-the-box. That's why we offer an optional Figma template to help prototype/design. That's why we offer an optional GUI for generating admin panels. That's why we offer optional services, from premium support to feature development & full outsourcing. To sum up, Backpack has been around for 8 years now, it's battle-tested, well-maintained, feature-packed and has a truly complete offering. Our goal was for you to have EVERYTHING you need to finish your admin panel, and after these 8 years... many people say "everything" is selling it short 🤣 Our KISS approach has proven to be a great way to build admin panels for today and for the future. If any of the things that make us different resonate with you... we think you'll love Backpack! Maybe even as much as we do. If you decide to try it out... we have some great news! Discounts We've decided to celebrate our 8-year anniversay with a 4-week celebration, where everything is 25% off! In addition, we have a few flash discounts planned, where the discount is even higher (but it will be limited to the first N buyers). Here are all the coupons codes and their details: HAPPY8THBIRTHDAY40 - 40% off for 40 purchases, starting June 10th (flash sale); HAPPY8THBIRTHDAY33 - 33% off for 33 purchases, starting June 17th (flash sale); HAPPY8THBIRTHDAY25 - 25% off, for 4 weeks, starting June 10th 2024; Terms: Who can use them? Anybody. New buyers and repeat buyers too. When do you use them? In the time windows above. All discounts expire July 7th 2024. Can I buy if my updates haven't expired? Yes, 12 more months of updates will be added to your access. How do you use them? At checkout, right before the TOTAL, click "Add Coupon". If you're new to Backpack, I hope you enjoy this opportunity to try what we've worked on for the past 8 years. If you've been with us for a while, thanks again for supporting us, all of these years. We couldn't do our jobs building out this software, if it weren't for people like you. You are freakin' awesome and we are super-grateful to have you 🙏 Now go ahead - go to https://backpackforlaravel.com and purchase our paid add-ons, at a huge discount. We recommend "everything", since that will give you the best experience. But you can start off with a Single-Project PRO license for as little as 42 EUR! 🤯 Here's to many more years of building and maintaining software for you 🍻 Cheers! The post Backpack turns 8 years old, celebrates with 40% discount appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

Sentry and Laravel announce a new partnership
Sentry and Laravel announce a new partnership

Sentry and Laravel announced a new partnership, making Sentry the preferred monitoring and debugging solution for Laravel projects using Forge or Vapor. Sentry is committed to the Laravel and PHP community, and we continue to build with you in mind. With the new Forge and Vapor integration, we’re forging (pun intended) a new standard for managing, deploying, and debugging your Laravel apps. Here is a video showing how this new integration works: <iframe width="560" height="315" src="https://www.youtube.com/embed/QcOfXATrAkg?si=ndtfrt_-OqxLgIus" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> Or, if you prefer step-by-step instructions: Log in to Laravel Forge or Vapor Navigate to “User Profile” in Forge or “Team Settings” in Vapor (when logged in as the team owner) where you can find the new Sentry integration option. Follow the prompts to link your Sentry account Configure Sentry and connect your site to create a Sentry project create the project from the site’s or project’s Sentry panel Deploy your application, and Sentry will start tracking errors immediately If you haven't tried Sentry yet, check out our guide on how Sentry can improve your Laravel application. It's also super easy to install and comes with new features like a new widget to get direct feedback from users when they encounter a bug on your site. Sentry will attach their comment with all the debugging context you could dream of, like replay events, screenshots, error details, URL tags, and more. The post Sentry and Laravel announce a new partnership appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

"Fast Projects" by Larafast: Real life, ready to use Laravel based Boilerplates
"Fast Projects" by Larafast: Real life, ready to use Laravel based Boilerplates

Larafast continues to extend its boilerplates list. Introducing Larafast Fast Projects, a new collection of ready-to-go boilerplates designed to accelerate your Laravel development journey. This launch includes the Larafast Directories Boilerplate and the Larafast API Boilerplate. Larafast Directories Boilerplate The Larafast Directories Boilerplate is a solution for creating directory websites with ease. Built on top of Larafast, it includes all the essential features you need to get your directory website up and running quickly. Key Features: Larafast Integration: Larafast Directories Boilerplate comes with Larafast Full Package features, providing access to a rich set of functionalities, including Admin, User Dashboard, SEO, Payments, Blog, Themes. You can find all Larafast features here Directory-specific Features: Enjoy a set of directory-specific features, such as listing management, user profiles, advanced search capabilities, categories. These features are crafted to meet the unique requirements of directory websites. SEO Optimization: Built-in SEO optimization features comes with programmatic SEO for Categories and Products, with implemented sitemap to quickly index all the categories and products in Google, you just need to run a command to generate a sitemap and boom! Subscriptions and One-time Payments: If your directory requires subscription or lifetime payment for project listing, Larafast Directories Boilerplate comes with it out of the box. Set your payment keys and you are good to go! Easy-peasy, doesn't it? Customizable Templates: Choose from a variety of customizable templates provided by DaisyUI and give your directory website a unique and visually appealing look. Larafast's flexible design allows for easy customization to match your branding and user experience preferences. Admin Dashboard: Easy to use admin dashboard, where you can manage all your categories and products, add new ones, approve new products or restrict the ones that does not meet your project requirements. Documentation and Support: Gain access to comprehensive documentation and dedicated support resources to help you navigate through the setup and customization process. Larafast API Boilerplate The Larafast API Boilerplate is perfect for developers looking to build their SPA website or mobile app and use Laravel as a backend API. Larafast API Boilerplate comes with all necessary features for your next Single Page or Mobile Applicatio Key Features: Auth: User Registration, Login, Forgot Password, Social Auth Subscriptions and One-time Payments: Powered by Stripe and LemonSqueezy, access to Billing Portal, and protected routes. Admin Dashboard: Easy to use admin dashboard, where you can manage all your Users, Blog Articles, "Coming Soon" emails, etc. OpenAI Service: Integrated OpenAI service, for text completion, text to speech and image generation with OpenAI API. Documentation and Support: Gain access to comprehensive documentation and dedicated support resources to help you navigate through the setup and customization process. The Main Larafast Boilerplate At the heart of these Fast Projects is the main Larafast Boilerplate. Larafast provides a solid foundation with features such as authentication, payment integration, pre-built UI components, and extensive documentation. Main Features of Larafast: Payments. Plan Checkout Sessions, Single Product Purchases, Customer Portal, Webhook Handling. All out of the box with Stripe, LemonSqueezy or Paddle. Users. User Registrations and Logins, Magic Links, Social Auth for Github, Twitter and Google out of the box. Admin Panel. Built with amazing FilamentPHP, admin panel comes with Users and Blog Articles management. SEO. SEO Meta Tags, Twitter Cards, Automatic Sitemap builder, Schema.org markup integrated, Blog and Articles SEO. Styles. Larafast styles are based on TailwindCSS and DaisyUI, which comes with 32 amazing themes out of the box. ...and many more. Components, OpenAI Service, Coming Soon Page, Terms and Privacy pages. Conclusion Larafast Fast Projects are designed to help developers launch their projects faster and with less hassle. Whether you're building a directory site, an API these boilerplates offer a comprehensive and efficient solution. Stay tuned for more exciting updates and new releases from Larafast! For more information and to get started with Larafast "Fast Projects", visit the official website. Happy coding! The post "Fast Projects" by Larafast: Real life, ready to use Laravel based Boilerplates appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.