# Prepare the working directory
cd /path/to/www
git clone git@github.com:goodyweb/example-app.git
cd /path/to/www/example-app
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 | |
| namespace App\Http\Livewire; | |
| use Livewire\Component; | |
| use App\Models\User; | |
| class CreateComment extends Component | |
| { | |
| public $mentionables; |
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 | |
| function exportCSV() | |
| { | |
| // Define response headers for CSV download | |
| $headers = [ | |
| "Content-type" => "text/csv", | |
| // Specifies the content type as CSV | |
| "Content-Disposition" => "attachment; filename=products.csv", | |
| // Instructs the browser to treat it as a downloadable attachment with the filename 'products.csv' |
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 | |
| // In the Post model | |
| class Post extends Model | |
| { | |
| public function user() | |
| { | |
| return $this->belongsTo(User::class); | |
| } | |
| } |
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
| import 'dart:io'; | |
| import 'package:dio/dio.dart'; | |
| class Api { | |
| final dio = createDio(); | |
| String _token = ""; | |
| String _apiKey = ""; | |
| Api._internal(); |
Here's an example of how you might create a tree view component using Laravel Livewire: First, create a new Livewire component called TreeView:
php artisan make:livewire TreeViewNext, in the TreeView.php file, define a public property to store the tree data:
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
| import 'package:flutter/material.dart'; | |
| import 'package:get/get.dart'; | |
| void main() { | |
| runApp(GetMaterialApp( | |
| initialRoute: '/login', | |
| getPages: [ | |
| GetPage( | |
| name: '/login', | |
| page: () => LoginPage(), |
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
| import 'package:flutter/material.dart'; | |
| import 'package:get/get.dart'; | |
| void main() { | |
| runApp(GetMaterialApp( | |
| initialRoute: '/home', | |
| getPages: [ | |
| GetPage( | |
| name: '/home', | |
| page: () => HomePage(), |
you can use the flutter_local_notifications package. This package allows you to schedule and display local notifications in Flutter.
Here's an example of how you can use the flutter_local_notifications package to schedule an alarm in Flutter:
First, add the flutter_local_notifications package to your project's pubspec.yaml file:
dependencies:
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 | |
| namespace App\Http\Livewire; | |
| use App\Models\Tag; | |
| use Illuminate\View\View; | |
| use Illuminate\Contracts\View\Factory; | |
| use Illuminate\Contracts\Container\BindingResolutionException; | |
| use Livewire\Component; |
NewerOlder