\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{nemethrzr2} \pdfinfo{ /Title (laravel.pdf) /Creator (Cheatography) /Author (nemethrzr2) /Subject (Laravel Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{FFB726} \definecolor{LightBackground}{HTML}{FFFAF1} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Laravel Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{nemethrzr2} via \textcolor{DarkBackground}{\uline{cheatography.com/36130/cs/11363/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}nemethrzr2 \\ \uline{cheatography.com/nemethrzr2} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 4th April, 2017.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Artisan}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{php artisan routes \newline % Row Count 1 (+ 1) php artisan make:controller UserController \newline % Row Count 2 (+ 1) php artisan make:model User \newline % Row Count 3 (+ 1) php artisan make:model User -m \newline % Row Count 4 (+ 1) // Migrations \newline % Row Count 5 (+ 1) php artisan migrate:make create\_users\_table \newline % Row Count 7 (+ 2) php artisan migrate:make create\_users\_table -{}-create=users \newline % Row Count 9 (+ 2) php artisan migrate \newline % Row Count 10 (+ 1) php artisan migrate:rollback \newline % Row Count 11 (+ 1) php artisan migrate:refresh \newline % Row Count 12 (+ 1) // Seed \newline % Row Count 13 (+ 1) php artisan generate:seed posts \newline % Row Count 14 (+ 1) php artisan db:seed \newline % Row Count 15 (+ 1) php artisan migrate:refresh -{}-seed \newline % Row Count 16 (+ 1) php artisan db:seed -{}-class=PostsTableSeeder \newline % Row Count 18 (+ 2) // Generators \newline % Row Count 19 (+ 1) php artisan generate:resource post -{}-fields="title:string, body:text" \newline % Row Count 21 (+ 2) php artisan generate:pivot categories users% Row Count 22 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Model}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Relations}} \newline % Row Count 1 (+ 1) class Post extends Eloquent \{ \newline % Row Count 2 (+ 1) ... \newline % Row Count 3 (+ 1) public function user()\{ \newline % Row Count 4 (+ 1) return \$this-\textgreater{}belongsTo('User'); \newline % Row Count 5 (+ 1) // hasMany \newline % Row Count 6 (+ 1) // hasOne \newline % Row Count 7 (+ 1) // belongsToMany \newline % Row Count 8 (+ 1) \} \newline % Row Count 9 (+ 1) ... \newline % Row Count 10 (+ 1) \} \newline % Row Count 11 (+ 1) // SELECT \newline % Row Count 12 (+ 1) \$posts = Post::all(); \newline % Row Count 13 (+ 1) \$posts = Post::find(2); \newline % Row Count 14 (+ 1) \$posts = Post::where('title', 'LIKE', '\%et\%')-\textgreater{}get(); \newline % Row Count 16 (+ 2) \$posts = Post::where('title', 'LIKE', '\%et\%')-\textgreater{}take(1)-\textgreater{}skip(1)-\textgreater{}get(); \newline % Row Count 18 (+ 2) // INSERT \newline % Row Count 19 (+ 1) \$post = new Post; \newline % Row Count 20 (+ 1) \$post-\textgreater{}title = 'post1 title'; \newline % Row Count 21 (+ 1) \$post-\textgreater{}body = 'post1 body'; \newline % Row Count 22 (+ 1) \$post-\textgreater{}save(); \newline % Row Count 23 (+ 1) // Insert amb vector de dades \newline % Row Count 24 (+ 1) \$data = array( \newline % Row Count 25 (+ 1) 'title' =\textgreater{} 'post2 title', \newline % Row Count 26 (+ 1) 'body' =\textgreater{} 'post2 body' \newline % Row Count 27 (+ 1) ); \newline % Row Count 28 (+ 1) Post::create(\$data); \newline % Row Count 29 (+ 1) // UPDATE \newline % Row Count 30 (+ 1) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Model (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$post = Post::find(1); \newline % Row Count 1 (+ 1) \$post-\textgreater{}title('updated title'); \newline % Row Count 2 (+ 1) \$post-\textgreater{}save(); \newline % Row Count 3 (+ 1) // DELETE \newline % Row Count 4 (+ 1) \$post = Post::find(1); \newline % Row Count 5 (+ 1) \$post-\textgreater{}delete(); \newline % Row Count 6 (+ 1) \$post-\textgreater{}forceDelete(1); If using SoftDeletes columns \newline % Row Count 8 (+ 2) Post::destroy(1);% Row Count 9 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Általános info}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{A laravel model alapértelmezett visszatérési értéke json. \newline % Row Count 2 (+ 2) author(belongsTo) book (hasMany) \newline % Row Count 3 (+ 1) id id \newline % Row Count 4 (+ 1) name title \newline % Row Count 5 (+ 1) author\_id% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Laravel telepítése}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{1. Virtual box feltelepítése}} \newline % Row Count 1 (+ 1) {\bf{2. Vagrant telepítése}} \newline % Row Count 2 (+ 1) {\bf{3. git, composer telepítése}} \newline % Row Count 3 (+ 1) -{}-git parancskezelőből \newline % Row Count 4 (+ 1) -{}-c:/users/felhasználóneved \newline % Row Count 5 (+ 1) {\bf{4. vagrant box add laravel/homestead parancs kiadása git-ből}} \newline % Row Count 7 (+ 2) 5. git clone \seqsplit{https://github.com/laravel/homestead.git} Homestead \newline % Row Count 9 (+ 2) 6. cd Homestead \newline % Row Count 10 (+ 1) 7. bash init.sh** \newline % Row Count 11 (+ 1) 8. ssh beállítása \newline % Row Count 12 (+ 1) ssh-keygen -t rsa -C "ernax" - a későbbi kapcsolódáshoz jegyezzük meg a stringet \newline % Row Count 14 (+ 2) Homestead \seqsplit{beállításai:(homestead}.yaml) \newline % Row Count 15 (+ 1) -{}-{}- \newline % Row Count 16 (+ 1) ip: "192.168.10.10" \newline % Row Count 17 (+ 1) memory: 2048 \newline % Row Count 18 (+ 1) cpus: 1 \newline % Row Count 19 (+ 1) provider: virtualbox \newline % Row Count 20 (+ 1) authorize: \textasciitilde{}/.ssh/id\_rsa.pub \newline % Row Count 21 (+ 1) keys: \newline % Row Count 22 (+ 1) - \textasciitilde{}/.ssh/id\_rsa \newline % Row Count 23 (+ 1) folders: \newline % Row Count 24 (+ 1) - map: E:/Projects \newline % Row Count 25 (+ 1) // a host gépen a projectek mappájának elérése \newline % Row Count 27 (+ 2) to: /home/vagrant/Projects \newline % Row Count 28 (+ 1) // a virtuális gépen a mappák elérése \newline % Row Count 29 (+ 1) sites: \newline % Row Count 30 (+ 1) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Laravel telepítése (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{- map: laravel.dev \newline % Row Count 1 (+ 1) // a project elérése, mint a xamppnál a localhost vagy 127.0.0.1/ \newline % Row Count 3 (+ 2) to: \seqsplit{/home/vagrant/Projects/laravel/public} \newline % Row Count 4 (+ 1) //a virtuális gép url elérése \newline % Row Count 5 (+ 1) - map: homestead.dev \newline % Row Count 6 (+ 1) to: \seqsplit{/home/vagrant/Projects/homestead/public} \newline % Row Count 7 (+ 1) databases: \newline % Row Count 8 (+ 1) //adatbázisok, amiket a projectekhez használunk \newline % Row Count 10 (+ 2) - homestead \newline % Row Count 11 (+ 1) - laravel \newline % Row Count 12 (+ 1) - \newline % Row Count 13 (+ 1) {\bf{Host file szerkesztése:}} \newline % Row Count 14 (+ 1) A homestead.yaml-ben az ip-t kell hozzárendelni a project nevéhez \newline % Row Count 16 (+ 2) pl.: 192.168.10.10 laravel.dev \newline % Row Count 17 (+ 1) Ahhoz, hogy belépjünk a virtuális gépbe elősz{\"o}r bekell lépnünk a Homestead mappába (cd Homestead) , majd a vagrant ssh parancsot kell kiadnunk. \newline % Row Count 21 (+ 4) A k{\"o}vetkező parancssal létrehozzuk a projectünket: \newline % Row Count 23 (+ 2) composer create-project -{}-prefer-dist laravel/laravel ernax //azért ernax a project neve mert a homestead.yaml-ben ernax.dev-ként vettünk fel egy host nevet, azaz annak a hostnévnek a nevét kell megadni amelyikhez a projectet szeretnénk létrehozni. \newline % Row Count 29 (+ 6) mysql workbench csatlakozása a homestead-hez \newline % Row Count 30 (+ 1) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Laravel telepítése (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{ip 192.168.10.10 \newline % Row Count 1 (+ 1) port: 3306 \newline % Row Count 2 (+ 1) user homestead \newline % Row Count 3 (+ 1) pw secret \newline % Row Count 4 (+ 1) homstead futtatása, leállítása \newline % Row Count 5 (+ 1) vagrant up / vagrant halt / vagrant ssh(ctrl+d kilépés)% Row Count 7 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.04057 cm} x{2.93643 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Migration Columns methods reference}} \tn % Row 0 \SetRowColor{LightBackground} \$table-\textgreater{}bigIncrements('id'); & Incrementing ID using a big integer equivalent \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \$table-\textgreater{}bigInteger('votes'); & BIGINT equivalent to the table \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Migration Columns methods reference (copy)}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}bigIncrements('id');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Incrementing ID using a big integer equivalent} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}bigInteger('votes');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}BIGINT equivalent to the table} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}binary('data');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}BLOB equivalent to the table} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}boolean('confirmed');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}BOOLEAN equivalent to the table} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}char('name', 4);} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}CHAR equivalent with the length} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}date('created\_at')} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}DATE equivalent to the table} \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}dateTime('created\_at');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}DATETIME equivalent to the table} \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}decimal('amount', 5, 2);} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}DECIMAL equivalent with a precision and scale} \tn % Row Count 16 (+ 2) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}double('column', 15, 8);} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}DOUBLE equivalent with precision, 15 digits in total and 8 after the decimal point} \tn % Row Count 19 (+ 3) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}enum('choices', {[}'foo', 'bar'{]});} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}'bar'{]}); ENUM equivalent to the table} \tn % Row Count 21 (+ 2) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}float('amount');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}FLOAT equivalent to the table} \tn % Row Count 23 (+ 2) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}increments('id');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Incrementing ID to the table (primary key)} \tn % Row Count 25 (+ 2) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}integer('votes');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}INTEGER equivalent to the table} \tn % Row Count 27 (+ 2) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}json('options');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}JSON equivalent to the table} \tn % Row Count 29 (+ 2) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}longText('description');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}LONGTEXT equivalent to the table} \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Migration Columns methods reference (copy) (cont)}} \tn % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}mediumInteger('numbers');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}MEDIUMINT equivalent to the table} \tn % Row Count 2 (+ 2) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table\textgreater{}mediumText('description');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}MEDIUMTEXT equivalent to the table} \tn % Row Count 4 (+ 2) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}nullableTimestamps();} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Same as timestamps(), except the fact that this allows NULLs} \tn % Row Count 7 (+ 3) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}smallInteger('votes');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}SMALLINT equivalent to the table} \tn % Row Count 9 (+ 2) % Row 19 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}tinyInteger('numbers');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}TINYINT equivalent to the table} \tn % Row Count 11 (+ 2) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}string('email');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}VARCHAR equivalent column} \tn % Row Count 13 (+ 2) % Row 21 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}string('name', 100);} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}VARCHAR equivalent with the length of a string} \tn % Row Count 15 (+ 2) % Row 22 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$table-\textgreater{}text('description');} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}TEXT equivalent to the table} \tn % Row Count 17 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.58804 cm} x{2.38896 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Model relation}} \tn % Row 0 \SetRowColor{LightBackground} author(belongsTo) & book (hasMany) \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} id & id \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} name & title \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} & author\_id \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{hasMany - sok van \newline belongsTo - hozzá tartozik} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Migration other methods}} \tn % Row 0 \SetRowColor{LightBackground} \$table-\textgreater{}timestamps(); & \$table-\textgreater{}rememberToken(); \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \$table-\textgreater{}softDeletes(); & \$table-\textgreater{}integer('my\_column')-\textgreater{}unsigned(); \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \$table-\textgreater{}string('my\_column')-\textgreater{}default('my\_default\_value'); & \$table-\textgreater{}string('my\_column')-\textgreater{}nullable(); \tn % Row Count 8 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Updating tables and columns }} \newline Schema::table('books', function(Blueprint \$table) \{ \newline \$table-\textgreater{}string('title', 250)-\textgreater{}change(); \newline \}); \newline \newline \$table-\textgreater{}dropPrimary('authors\_id\_primary'); \$table-\textgreater{}dropUnique('authors\_email\_unique'); \$table-\textgreater{}dropIndex('books\_title\_index'); \$table-\textgreater{}dropForeign('books\_author\_id\_foreign');} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Route}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Simple route}} \newline % Row Count 1 (+ 1) Route::get('/'function()\{ \newline % Row Count 2 (+ 1) return view('view'); \newline % Row Count 3 (+ 1) \}); \newline % Row Count 4 (+ 1) Route::get('/','HomeController@index'); \newline % Row Count 5 (+ 1) Route::get('/article/\{id\}','ArticleController@index'); \newline % Row Count 7 (+ 2) Route::get('/article/\{id?\}','ArticleController@index');//? nullable parameter \newline % Row Count 9 (+ 2) Route::get('posts/\{id\}',function(\$id)\{ \newline % Row Count 11 (+ 2) return View::make('post.single')-\textgreater{}with('id', \$id); \newline % Row Count 13 (+ 2) \}); \newline % Row Count 14 (+ 1) Groups \newline % Row Count 15 (+ 1) \seqsplit{Route::group(array('before'} =\textgreater{} 'auth'), function()\{ \newline % Row Count 17 (+ 2) // Route:: ... \newline % Row Count 18 (+ 1) // Route:: ... \newline % Row Count 19 (+ 1) \}); \newline % Row Count 20 (+ 1) Prefixs \newline % Row Count 21 (+ 1) \seqsplit{Route::group(array('prefix'} =\textgreater{} 'admin'), function()\{ \newline % Row Count 23 (+ 2) // Route:: ... \newline % Row Count 24 (+ 1) // Route:: ... \newline % Row Count 25 (+ 1) \});% Row Count 26 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Blade}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Blade layout}} \newline % Row Count 1 (+ 1) \textless{}!-{}- HTML -{}-\textgreater{} \newline % Row Count 2 (+ 1) \seqsplit{@include('partials.menu');} \newline % Row Count 3 (+ 1) {[}...{]} \newline % Row Count 4 (+ 1) @yield('content'); \newline % Row Count 5 (+ 1) {[}...{]} \newline % Row Count 6 (+ 1) @section('sidebar'); \newline % Row Count 7 (+ 1) {[}...{]} \newline % Row Count 8 (+ 1) @show \newline % Row Count 9 (+ 1) {\bf{Blade Template}} \newline % Row Count 10 (+ 1) \seqsplit{@extends('layouts.default');} \newline % Row Count 11 (+ 1) @section('content'); \newline % Row Count 12 (+ 1) {[}...{]} \newline % Row Count 13 (+ 1) @stop \newline % Row Count 14 (+ 1) @section('sidebar') \newline % Row Count 15 (+ 1) @parent \newline % Row Count 16 (+ 1) {[}...{]} \newline % Row Count 17 (+ 1) @stop \newline % Row Count 18 (+ 1) {\bf{Blade functions}} \newline % Row Count 19 (+ 1) @if(count(\$posts)) \newline % Row Count 20 (+ 1) @foreach(\$posts as \$post) \newline % Row Count 21 (+ 1) \textless{}p\textgreater{}\{\{\{ \$post-\textgreater{}title \}\}\} \textless{}/p\textgreater{} \newline % Row Count 22 (+ 1) @endforeach \newline % Row Count 23 (+ 1) @endif% Row Count 24 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}