This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$exportDate=DB::table('Klienty')->get(); | |
// dd($exportDate); | |
$export='<?xml version="1.0"?>'."\n"; | |
$export.='<Klienty>'."\n"; | |
foreach ($exportDate as $key => $value) { | |
$export.='<'.$value->id.'>'."\n"; | |
$export.='<Uslugi>'."\n"; | |
$export.=$value->Uslugi."\n"; | |
$export.='</Uslugi>'."\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
//ПЕРЕМЕННЫЕ | |
$a=100; //integer | |
$b=14.21; //float | |
$c='Hello!';//string | |
$c1='World';//string | |
$d1=[12,23]; //array массивы | |
$j= false; //boolean bool | |
$f=array( | |
'name'=>'Denis', //echo $f['name']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$('#id') //по id | |
$('TagName') //по имени тега | |
$('.class') //по имени тега | |
$('.class').css('boreder','solid 3px red'); //обращение к css | |
$('.class').parent().css('boreder','solid 3px red'); //обращение к родителям элементам |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHP: | |
<? | |
try { | |
$dbh = new PDO('mysql:dbname=name;host=host', 'login', 'password'); | |
} catch (PDOException $e) { | |
die($e->getMessage()); | |
} | |
$MTS = $dbh->prepare('SELECT * FROM test ORDER BY score DESC LIMIT 10' ); | |
$MTS->execute(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
В app/http/controllers/auth/registercontrolle.php | |
добавляем | |
'name' => 'required|string|max:255|unique:users', | |
в resurces/views/auth/login.blade.php вмесо полей email пишем name | |
В app/http/controllers/auth/LoginController | |
public function username() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app/http/controlleers | |
php artisan make:controller Name - создание | |
class IndexController extends Controller | |
{ | |
public function show() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routes/web.php | |
Route::get('/', function () { | |
return view('welcome'); | |
}); - сразу вызывает resources/views | |
Route::get('/', 'IndexController@show'); -на контроллер | |
Route::get - для получения данных | |
Route::post для отправки данных |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app/Http/Middleware/ | |
php artisan make:middleware OldMiddleware - создание | |
Пример | |
if ($request->input('age') < 200) | |
{ | |
return redirect('/'); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----------------------------Для исправления ошибки--------------------------------------- | |
app/Providers/AppServiceProvider.php | |
use Illuminate\Support\Facades\Schema; | |
public function boot() | |
{ | |
Schema::defaultStringLength(191); | |
} |
OlderNewer