0% found this document useful (0 votes)
55 views4 pages

Note Laravel 8

The document shows steps taken to create a Laravel project and its basic structure. This includes installing Composer, generating a new Laravel project, creating models and migrations, seeding data, and linking file storage.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views4 pages

Note Laravel 8

The document shows steps taken to create a Laravel project and its basic structure. This includes installing Composer, generating a new Laravel project, creating models and migrations, seeding data, and linking file storage.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Microsoft Windows [Version 10.0.18363.

1256]

(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\SAFARA>composer --version

Composer version 2.0.8 2020-12-03 17:20:38

C:\>E:

E:\>cd laravel_project

E:\laravel_project>cd latihan1

E:\laravel_project\latihan1>composer create-project laravel/laravel latihan1

Application key set successfully.

E:\laravel_project\latihan1>dir

Volume in drive E has no label.

Volume Serial Number is 1E12-1CAC

Directory of E:\laravel_project\latihan1

19/01/2021 20:30 <DIR> .

19/01/2021 20:30 <DIR> ..

19/01/2021 20:31 <DIR> latihan1

0 File(s) 0 bytes

3 Dir(s) 276.395.745.280 bytes free

E:\laravel_project\latihan1>cd latihan1

E:\laravel_project\latihan1\latihan1>code .

E:\laravel_project\latihan1\latihan1>
[20:17, 1/19/2021] Mr Dede Plg: https://getcomposer.org/download/

[20:20, 1/19/2021] Mr Dede Plg: https://laravel.com/docs/8.x

[20:37, 1/19/2021] Mr Dede Plg: composer create-project laravel/laravel first-app

[20:40, 1/19/2021] Mr Dede Plg: menjalankan laravel: php artisan serve

[22:40, 1/19/2021] Mr Dede Plg: NPM: Node Package Manager (Node.Js)

Composer: PHP

Full Stack Development (...)

Back End Development (API)

MVC: Model View Controller

Views: project - resource - views

name.blade.php

contoh:

index.blade.php

Controllers: project - app - Http - controllers

Model: project - app - Models

Routing

project > routes > web.php

camel: UserController, ProductController

php artisan make:controller UserController

php artisan make:model Produk -m

Model created successfully.

Created Migration: 2021_01_21_152205_create_produks_table


PS E:\laravel_project\latihan1\latihan1> php artisan make:model Kategori -m

Model created successfully.

Created Migration: 2021_01_21_152916_create_kategoris_table

PS E:\laravel_project\latihan1\latihan1> php artisan migrate

Migration table created successfully.

Migrating: 2014_10_12_000000_create_users_table

Migrated: 2014_10_12_000000_create_users_table (1,084.83ms)

Migrated: 2014_10_12_100000_create_password_resets_table (583.70ms)

Migrating: 2019_08_19_000000_create_failed_jobs_table

Migrated: 2019_08_19_000000_create_failed_jobs_table (569.44ms)

Migrating: 2021_01_21_152205_create_produks_table

Migrated: 2021_01_21_152205_create_produks_table (638.89ms)

Migrating: 2021_01_21_152916_create_kategoris_table

o_ditabel_produk --table-produks

The "--table-produks" option does not exist.

PS E:\laravel_project\latihan1\latihan1> php artisan make:migration tambah_foto_ditabel_produk --


table=produks

Created Migration: 2021_01_21_155115_tambah_foto_ditabel_produk

PS E:\laravel_project\latihan1\latihan1> php artisan migrate

Migrating: 2021_01_21_155115_tambah_foto_ditabel_produk

Migrated: 2021_01_21_155115_tambah_foto_ditabel_produk (170.37ms)

PS E:\laravel_project\latihan1\latihan1>

php artisan migrate:refresh


seeder tanpa factory

- Buat file seeder (php artisan make:seeder CategorySeeder)

seeder dengan factory (membuat data fake, digunakan untuk testing)

php artisan db:seed

• Menjalankan perintah seeder : menambah atau edit kategori yang diinput

APP_DEBUG=true ubah ini di .env

//untuk membuat file request

//lokasi: app > Http > Requests >

php artisan make:request ProductCreateRequest

FILE UPLOAD

php artisan storage:link

env : FILESYSTEM_DRIVER=public

img src="{{ asset('storage/' .$data->dok) }}" height="80px">

PAGINATE

app->provider->appserviceprovider

use Illuminate\Pagination\Paginator;

Paginator::useBootstrap();

tampil data di blade

</table>

{{ $datas->links() }}

You might also like