100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary Web, Mobile & Security (Laravel) $8.90   Add to cart

Summary

Summary Web, Mobile & Security (Laravel)

 7 views  0 purchase
  • Course
  • Institution

Summary of all stuff you need to know for the exam. Including code. With this file you should be able to make the exam.

Preview 3 out of 17  pages

  • January 15, 2022
  • 17
  • 2020/2021
  • Summary
avatar-seller
web cheatsheet.md 1/15/2022




Cheatcheat web
Table of content
Including files
Routes
Controller
Yield
Routes & Yield
Databases
Models
Forms
Cookies
Sessions
API (JS)



including files
add css file to blade:


<link href="{{ asset('css/reset.css') }}" rel="stylesheet">
<link href="{{ asset('css/screen.css') }}" rel="stylesheet">



add script to blade (in body bottom)


<script src="{{ asset('js/script.js') }}"></script>



String concatenation:



<img src="{{ asset('media/' . $product -> id . '.png') }}" alt="image of product">




Routes
Routes(web.php) normal:






,web cheatsheet.md 1/15/2022




Route::get('/', function () {
return view('master');
});



Routes(web.php) through controller:


Route::get('/', [BookingController::class, "index"]);

Route::post('/summary', [ControllerName::class, "displaySummary"])
-> name("summary");



include "use \App\Http\Controllers\ControllerName;" at top of web.php

Route function

in blade:



@foreach($products as $product)
<li><a href="{{ route('details', $product -> id ) }}">{{ $product -> name }}
</a></li>
@endforeach



in web.php



Route::get('/products/101', [StoreController::class, "displayIphone"])
->name('101');




Controller
make a new controller:

go to project directory
php artisan make:controller MyController

simple route in controller:






, web cheatsheet.md 1/15/2022




function index() {
return view("master");
}




Yield
ex in master blade:


@yield("view-content")



ex in other blade file:


@extends("master")

@section("view-content")
<h2>Product catalog</h2>
<ul>
<li><a href="#">Apple Iphone 12</a></li>
<li><a href="#">Samsung S21</a></li>
<li><a href="#">LG OLED TV</a></li>
</ul>
@endsection



So now just simply choose which blade you want to use (not the master blade)



Routes & Yield
Make a url that leads to another page:


<li><a href="{{ url('iphone') }}">Apple Iphone 12</a></li>



in web.php it will look like


Route::get('/iphone', [StoreController::class, "displayIphone"]);

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller fredericgoossens. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $8.90. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

72042 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$8.90
  • (0)
  Add to cart