Laravel db:truncate command

March 22, 2023
Zacharias Creutznacher
Zacharias Creutznacher
Chief Technology Officer (CTO)

Checkout our latest addition to our laravel-useful-additions package - the <code>db:truncate<code> command!

This command truncates all the tables of your current database connection. Checkout <code>--help<code> to see arguments and options. Here are some examples:

Default

By default it truncates all existing tables of your database:

Note: in production environment it asks for confirmation

<code>php artisan db:truncate<code>

Specify tables

You could also only truncate some specific tables:

<code>php artisan db:truncate users details<code>

Disable foreign key checks

If you need to disable foreign key checks during truncation, this is also possible:

<code>php artisan db:truncate --checks=false<code>

code

What’s a Rich Text element?

The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.

Static and dynamic content editing

A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.

H4

H5
H6

http://google.de

<code>test123<code>

<span style="color:red;">asdfasdf</span>

composer require spatie/laravel-artisan-dispatchable

Setzen Sie Ihre Ideen um!
Heute ist der Tag, um das Geschäft Ihrer Träume aufzubauen. Teilen Sie Ihre Mission mit der Welt – und begeistern Sie Ihre Kunden.
Jetzt starten