50% Off/-

50% Off/-

Php

50% Off/-

50% Off/-

Web

50% Off/-

50% Off/-

Latest Added Tutorials

$pdf = PDF::loadView('projects.pdf', ['project' => $project]); $options = new Options(); $options->set('isPhpEnabled', 'true'); $dompdf = new Dompdf($options); $dompdf->setOptions($options); $dompdf->loadHtml('<html>....'); $dompdf->setPaper('A4', ''); $dompdf->render(); // Instantiate canvas instance $canvas = $dompdf->getCanvas(); $w = $canvas->get_width(); $h = $canvas->get_height(); $pageNumberWidth = $w / 2; $pageNumberHeight = $h - 50; $GLOBALS["logo1"]=public_path('images/logo/icon.png'); $GLOBALS["logo2"]=public_path('images/logo/kultur_lo...Continue Reading
macOS Mojave Setup: Homebrew + Apache + PHP + MariaDB
Dropzone HTML Implementation <link href="<?php echo base_url() ?>assets/css/dropzone.css" rel="stylesheet"> <div class="card"> <div class="row"> <div class="col-sm-12"> <div class="col-md-12 col-sm-12"> <form action="<?= base_url('admin/do_send_gallery'); ?>" class="dropzone" id="my-awesome-dropzone"> </form> </div> </div> </div> </div> </div> <script src="<?php echo base_url() ?>a...Continue Reading
We can easly integrate file upload process in Laravel as follows: 1. Add following codes to create.blade.php file: <div class="box box-primary"> <div class="box-body"> <div class="row"> {!! Form::open(['route' => 'applications.store','files'=>true]) !!} <div class="form-group col-sm-6"> {!! Form::label('image', 'Image:') !!} @if(isset($application->image)) <img src="{{asset("$application-/>image")}}" width="125" height="125"/> <input...Continue Reading
<div class="form-group col-sm-6"> {{Form::hidden('is_active',0)}} {!! Form::label('is_active', 'Aktif:') !!} {!! Form::checkbox('is_active') !!} </div>...Continue Reading
We can Category Table CREATE TABLE category ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50) NULL, url VARCHAR(50) NULL, parent INT NULL, created_at TIMESTAMP NULL, updated_at TIMESTAMP NULL, deleted_at TIMESTAMP NULL, resim VARCHAR(255) NULL, kisaltma VARCHAR(255) NOT NULL, CONSTRAINT category_category_parent_fk FOREIGN KEY (parent) REFERENCES category (id) ON DELETE SET NULL ) ENGINE = InnoDB COLLATE = utf8_unicode_ci; CREATE INDEX category_category_parent_fk...Continue Reading
public function html() { return $this->builder() ->columns($this->getColumns()) ->minifiedAjax() ->addAction(['width' => '80px']) ->parameters([ 'dom' => 'Blfrtip', 'order' => [[0, 'desc']], "lengthMenu" => [10, 25, 50, 500], "pageLength"=> "10", 'buttons' => [ 'create', 'export', 'print', 'reset', 'reload',...Continue Reading
To send onesignal notification in Php, we can use following codes: function sendMessage($title, $message, $userId, array $extraParams, bool $isTest = false) { $app_id = "b21eaaf8-7da9-44e4-aa39-930e2503a109"; $rest_api_key = "NWEwMjU1YmItYzVmNy00YjBhLTlhNjEtNmZlMmUzOWU0Y2Ey"; $heading = array( "en" => $title ); $content = array( "en" => $message ); $fields = array( 'app_id' => $app_id, 'data' => $extraParams, 'contents' => $content, 'headings' => $heading ); $fields['large_icon'] = 'http...Continue Reading
Php Steps 1. Install Socialite: composer require laravel/socialite 2. Add following codes in config/services.php 'google' => [ 'client_id' => env('GOOGLE_CLIENT_ID'), // Your Google Client ID 'client_secret' => env('GOOGLE_CLIENT_SECRET'), // Your Google Client Secret 'redirect' => 'http://www.codesenior.com', ], And add GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET variables in .env file: GOOGLE_CLIENT_ID=692373818685-1s057a8mja62g3i7cmj88v2spt3d8b8e.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=c-4CsKAagTYHVyPKbGVcbAsr...Continue Reading
Php Codes <div class="pagination-wrapper"> <ul class="pagination"> <li><a href="?page=<?= $page > 1 ? ( $page - 1 ) : '1' ?>" aria-label="Previous"><span aria-hidden="true"><i class="fa fa-long-arrow-left"></i> Önceki Sayfa</span></a></li> <?php $databaseUtil = new \hatim\Libraries\DatabaseUtil(); $limit = 2; $total = $databaseUtil->count( "hatim" ); $pages = ceil( $total / $limit ); // What page are we currently on? $page = get_query_var( "page" ); $page = $page == 0 ? 1 : $page; // Calculate...Continue Reading
Associate User with same role: factory(\App\Models\User::class, 'random', 50)->create()->each(function ($u, $value) { if ($value == null) $value = factory(App\Models\Role::class, 'satici')->make(); else $value = \App\Models\Role::where(['name'=>'satici'])->firstOrFail(); $u->roles()->save($value); });...Continue Reading
Event::listen('Illuminate\Database\Events\QueryExecuted', function ($query) { if (App::environment() == 'local') { Log::info($query->sql . ' Parameters: ' . serialize($query->bindings)); } });...Continue Reading
Removing index.php from url in Laravel project use following .htaccess commands after RewriteRule ^ index.php [L] RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC] RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L] Full htaccess File <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUE...Continue Reading
Category table: id adi url parent 1 Elektronik elektronik NULL 2 Laptop laptop 1 We can use following codes to extract parent->child category array: /** * Show the application dashboard. * * @return \Illuminate\Http\Response */ public function index() { $categories = DB::table('kategori as k1') ->join('kategori as k2', 'k1.id', '=', 'k2.parent') ->select('k1.adi as parent_adi', 'k1.url as parent_url', 'k2.adi as child_adi', 'k2.url as child_url') ->get(); $parents = array()...Continue Reading
In Laravel framework, we can use following transaction block with repository pattern and classic eloquent usage: DB::transaction(function () use ($talep, $input,$id) { UrunTalep::where('talep_id', '=', $talep->id)->forceDelete(); $talep = $this->talepRepository->update($input, $id); });...Continue Reading

© 2019 All rights reserved. Codesenior.COM