Email:   Password:
Blog :: Technical Learning by Thomas Riemer
RSS 2.0   RSS 1.0   Atom
laravel   (PDF)
Posted March 22nd, 2024

Laraval is a popular framework for php
1a. laravel required sqlite.
    > dnf install sqlite-devel
1b. To create a laravel project
    > composer create-project laravel/laravel:^11.0 project-name

2. So laravel when developing is generally done by running a local
   web server, which listens on port 8000.  From your project directory
   >  php artisan serve
   Now point your browser at http://localhost:8000

3. in the app:
   config directory - has configuration files.
       (app.php is main one)

4. So I chose to use postgres to use as a database.

A. create user and database
   > sudo -u postgres psql
   > create user foo password 'bar';
   > create database fubardb owner foo;

configure postgresql in .env in top level of project


configure /var/lib/pgsql/data/pg_hba.conf
change the line for for ipv4 to:
(ident needs to change to trust)
host    all             all               trust

5. So this doesn't work...
   need to compile pgsql, and/or mysql
   So php needs to be compiled with flags
   ./configure --with-pdo-mysql=mysqlnd \
       --with-pdo-pgsql=mysqlnd \
       --with-pgsql \

   // Laravel uses the PDO objects in its database access.

6. run php artisan migrate:fresh
   this generates the user account handling stuff for laravel

7. Routes are in the routes subdiretory

   To add an api
   php artisan install:api
   This generates routes/api.php
8. Creating a table in Laravel - Migration
   > php artisan make:migration migration_name

   This creates a php object datestamped, with the migration name in

   The object has an up and down function.
   So to create the table update the up function.
public function up(): void
        Schema::create('cave', function (Blueprint $table) {


Copyright © 2024 Mind Contract, Inc.   All Rights Reserved
For more information call or email 720-883-1866
Powered By: Build a Member