laravel-rust 0.1.0

Laravel for Rust: a full-stack Rust web framework, inspired by PHP Laravel
Documentation
//! HTTP is stateless, so a session is how your application remembers a user from one request
//! to the next, such as who is signed in or which message to show after a redirect.
//!
//! A request's [`Session`] holds its data and flash data. [`csrf_token`] and [`csrf_field`] put the
//! session's CSRF token in forms, and the [`SessionStore`] trait adds drivers of your own. To
//! learn more, check out the
//! [session guide](https://github.com/laravel/rust-framework/blob/0.x/docs/session.md).
//!
//! The `web` middleware group starts a session for every request with [`StartSession`]. To use
//! the session, take a [`Session`] as a handler argument:
//!
//! ```no_run
//! use laravel::http::Redirect;
//! use laravel::session::Session;
//!
//! async fn store(session: Session) -> Redirect {
//!     session.put("theme", "dark");
//!     session.flash("status", "Saved!");
//!
//!     Redirect::back()
//! }
//! ```
//!
//! The configured [driver](crate::config::session::Driver) decides where the data lives. It may
//! be the encrypted session cookie itself, files, a database table, Redis, memory, or a store
//! that an application or package registers.
//!
//! Each request reads the session when it starts, and [`StartSession`] saves
//! the whole session when the request finishes. When two requests for the
//! same session overlap, the one that finishes last overwrites the other's
//! changes, so keep data that concurrent requests change in a database.

#[cfg(feature = "database")]
pub(crate) mod database;

pub(crate) use laravel_http::session::*;
#[doc(inline)]
pub use laravel_http::session::{
    Drivers, Identity, MemoryStore, Session, SessionStore, StartSession, Write, csrf_field, csrf_token,
};

/// Define a migration's `migrate` function to create the `database` session driver's table.
///
/// Put the macro alone in a migration file, and it creates the `sessions` table. To change the
/// table, replace the macro with the migration the
/// [session guide](https://github.com/laravel/rust-framework/blob/0.x/docs/session.md#the-database-session-table) shows,
/// then edit it.
///
/// ```
/// // database/migrations/0001_01_01_000000_create_sessions_table.rs
/// laravel::session::table!();
/// ```
#[cfg(feature = "database")]
pub use laravel_rust_database_macros::session_table as table;